pytest-dev / pytest-timeout

MIT License
216 stars 64 forks source link

pytest-timeout release 2.0.0 breaks pytest-timeout installation on python 2 #104

Closed exarkun closed 3 years ago

exarkun commented 3 years ago
Collecting pytest-timeout
  Downloading pytest-timeout-2.0.0.tar.gz (16 kB)
    ERROR: Command errored out with exit status 1:
     command: /tmp/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-Xl8UN2/pytest-timeout/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-Xl8UN2/pytest-timeout/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-KMLkn5
         cwd: /tmp/pip-wheel-Xl8UN2/pytest-timeout/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-wheel-Xl8UN2/pytest-timeout/setup.py", line 4, in <module>
        with open("README.rst", encoding="utf-8") as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

Compare with installation log from prior to 2.0.0 release:

Collecting pytest-timeout
  Downloading pytest_timeout-1.4.2-py2.py3-none-any.whl (10 kB)

I don't know if pytest-timeout cares to continue supporting Python 2 in new releases (from the metadata, I guess not) but it would be considerate if the project set its metadata correctly so that Python 2 installations could find the last Python 2-supporting release automatically instead of trying to use a Python 3-only release.

Nicusor97 commented 3 years ago

@exarkun See this PR: https://github.com/pytest-dev/pytest-timeout/pull/103 It should fix the issue that you spotted.

henryiii commented 3 years ago

Same thing hit on pybind11 - I'd rather not have to mess with our Python 2 CI, hoping to leave it alone until we drop it at the end of the year. Thanks for the PR and looking forward to the yank! :heart: