Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing future as a dependency #402

Closed
gGonz opened this issue Feb 15, 2020 · 1 comment · Fixed by #404
Closed

Consider removing future as a dependency #402

gGonz opened this issue Feb 15, 2020 · 1 comment · Fixed by #404

Comments

@gGonz
Copy link
Contributor

gGonz commented Feb 15, 2020

I use zenpy as dependency on a project, we have many months seeing a weird warning while running our tests due to future raising a DeprecationWarning, by using the now deprecated imp module.

Yeah, I know we can just ignore this specific warning, but that seems "dirty". Please note that future has some issues about this, the oldest one has more than 3 years open without any change...
PythonCharmers/python-future#246

In the same issue above, there is a reference to a pysaml2's pull request where the maintainer tells that he will use six instead of future.
IdentityPython/pysaml2#576

Here's the traceback shown when I run our tests with pytest -W error:

================================================================================================ test session starts ================================================================================================
platform linux -- Python 3.7.6, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
django: settings: project.settings.test (from env)
rootdir: /opt/project/project, inifile: pytest.ini
plugins: xdist-1.31.0, factoryboy-2.0.3, cov-2.8.1, django-3.8.0, forked-1.1.3, mock-2.0.0
collecting 0 items / 1 error                                                                                                                                                                                        
====================================================================================================== ERRORS =======================================================================================================
__________________________________________________________________________________ ERROR collecting apps/contracts/api/v1/tests.py __________________________________________________________________________________
/home/python/.cache/pypoetry/virtualenvs/project-soWN0cI--py3.7/lib/python3.7/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
apps/contracts/api/v1/__init__.py:1: in <module>
    from .tasks import *  # NOQA
apps/contracts/api/v1/tasks.py:1: in <module>
    from zenpy import Zenpy
/home/python/.cache/pypoetry/virtualenvs/project-soWN0cI--py3.7/lib/python3.7/site-packages/zenpy/__init__.py:6: in <module>
    from zenpy.lib.api import (
/home/python/.cache/pypoetry/virtualenvs/project-soWN0cI--py3.7/lib/python3.7/site-packages/zenpy/lib/api.py:43: in <module>
    from zenpy.lib.response import *
/home/python/.cache/pypoetry/virtualenvs/project-soWN0cI--py3.7/lib/python3.7/site-packages/zenpy/lib/response.py:4: in <module>
    from zenpy.lib.generator import SearchResultGenerator, ZendeskResultGenerator, ChatResultGenerator, ViewResultGenerator, \
/home/python/.cache/pypoetry/virtualenvs/project-soWN0cI--py3.7/lib/python3.7/site-packages/zenpy/lib/generator.py:8: in <module>
    from future.standard_library import install_aliases
/home/python/.cache/pypoetry/virtualenvs/project-soWN0cI--py3.7/lib/python3.7/site-packages/future/standard_library/__init__.py:65: in <module>
    import imp
/usr/local/lib/python3.7/imp.py:33: in <module>
    DeprecationWarning, stacklevel=2)
E   DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! xdist.dsession.Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================= 1 error in 4.53s ==================================================================================================

Any way to have this fixed? 🙏

@facetoe
Copy link
Owner

facetoe commented Feb 16, 2020

AFAIK future is only used to have consistent behaviour for math.ceil in https://github.com/facetoe/zenpy/blob/master/zenpy/lib/generator.py#L19. Happy to accept a patch that solves that issue without the future module.

gGonz added a commit to gGonz/zenpy that referenced this issue Feb 17, 2020
facetoe pushed a commit that referenced this issue Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants