chezou / tdworkflow

Unofficial Treasure Workflow Client
Apache License 2.0
7 stars 5 forks source link

Package incompatible with Python3.6 #12

Closed CyrillSolomon closed 3 years ago

CyrillSolomon commented 3 years ago

Checking the entry on PyPI, it is indicated this package should work with at least Python 3.6. However, attempting to run this package with Python 3.6 will first result in the message:

  File "<stdin>", line 1, in <module>
  File "/home/hcsolomon/tdworkflow/tdworkflow/__init__.py", line 5, in <module>
    from . import (
  File "/home/hcsolomon/tdworkflow/tdworkflow/attempt.py", line 1, in <module>
    import dataclasses
ModuleNotFoundError: No module named 'dataclasses'

which is easily fixed by installing the backport dataclasses found here.

After this, another problem arises due to the datetime type in Python 3.6:

target = '2019-12-15T07:27:16Z'

    def parse_iso8601(target: str) -> Optional[datetime]:
        if not target:
            return None

>       return datetime.fromisoformat(target.replace("Z", "+00:00"))
E       AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'

Because of this, the package is incompatible with Python 3.6, but I will be sending a PR that would allow this by parsing the ISO format string using dateutils. This would make the package compatible with Python 3.6 so long as the dataclasses package is also installed.

chezou commented 3 years ago

Thanks for raising an issue and sending a PR.

However, since numpy and pandas has been already dropped Python 3.6 support, I don't have a plan to add 3.6 support for now. https://github.com/pandas-dev/pandas/pull/35214 https://numpy.org/doc/stable/release/1.20.0-notes.html