Shopify / pyoozie

Library for querying and scheduling with Apache Oozie
https://py-oozie.readthedocs.io
MIT License
11 stars 12 forks source link

Use Python's typing package if available #86

Closed sebmartin closed 4 years ago

sebmartin commented 4 years ago

The typing module was introduced natively with Python 3.5. This change skip installing it via PIP if the version of Python >= 3.5.

This was causing problems when installing pyoozie from another project running Python 3.7.3:

  File "/artifacts/virtualenv/python3/lib/python3.7/site-packages/foo/__init__.py", line 1, in <module>
    import typing
  File "/artifacts/virtualenv/python3/lib/python3.7/site-packages/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/artifacts/virtualenv/python3/lib/python3.7/site-packages/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'