tantale / deprecated

Python @deprecated decorator to deprecate old python classes, functions or methods.
MIT License
301 stars 32 forks source link

Tests fail with wrapt<1.10 #9

Closed douardda closed 5 years ago

douardda commented 5 years ago

Current setup.py express the dependency on wrapt as:

 install_requires=[
        'wrapt < 2, >= 1',
    ],

However using wrapt 1.9.0 (since it's the current version available on debian stretch) fails with:

____________________ ERROR collecting tests/test.py _____________________
tests/test.py:4: in <module>
    import deprecated
deprecated/__init__.py:13: in <module>
    from deprecated.classic import deprecated
deprecated/classic.py:18: in <module>
    class ClassicAdapter(wrapt.AdapterFactory):
E   AttributeError: module 'wrapt' has no attribute 'AdapterFactory'

(as well as in other tests).

Using wrapt 1.10+ works as expected.

tantale commented 5 years ago

Deprecated was tested with wrapt v1.11.1.

The latest minor releases are: v1.0.0, v1.1.4, v1.2.1, v1.3.1, v1.4.2, v1.5.1, v1.6.0, v1.7.0, v1.8.0, v1.9.0, v1.10.11, v1.11.2.

I'm investigating this issue… Stay tuned.

tantale commented 5 years ago

Currently, Deprecated uses wrapt.AdapterFactory which is available since wrapt v1.10 or above.

I do not intend to modify the source code to support an old version of Wrapt.

But, I can change the constraint to the requirements:

 install_requires=[
        'wrapt < 2, >= 1.10',
    ],
tantale commented 5 years ago

To solve your problem, you can add this constraint in your own setup.py:

 install_requires=[
        'deprecated',
        'wrapt < 2, >= 1.10',
        ...
    ],

I hope this will suit you needs.