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

Version 0.14.0 allows pip to be installed on Python 2.7 #492

Closed
andy-maier opened this issue Nov 16, 2023 · 2 comments
Closed

Version 0.14.0 allows pip to be installed on Python 2.7 #492

andy-maier opened this issue Nov 16, 2023 · 2 comments

Comments

@andy-maier
Copy link

andy-maier commented Nov 16, 2023

Version 0.14.0 introduced the use of type hints, but its package definition does not require Python 3.6 or higher.

The Trove classifiers in the setup.py file state Python 2.7 and 3.6 and higher, but pip does not use that information, so pip happily installs 0.14.0 on Python 2.7, resulting in:

$ pip install voluptuous==0.14.0
Collecting voluptuous==0.14.0
  Downloading voluptuous-0.14.0.tar.gz (49 kB)
     |████████████████████████████████| 49 kB 2.7 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /Users/maiera/virtualenvs/zhmc27/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lh/v0_07k9d7dbfqdytfzzxks3r0000gn/T/pip-install-hJvLr2/voluptuous/setup.py'"'"'; __file__='"'"'/private/var/folders/lh/v0_07k9d7dbfqdytfzzxks3r0000gn/T/pip-install-hJvLr2/voluptuous/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 /private/var/folders/lh/v0_07k9d7dbfqdytfzzxks3r0000gn/T/pip-pip-egg-info-u7zqr9
         cwd: /private/var/folders/lh/v0_07k9d7dbfqdytfzzxks3r0000gn/T/pip-install-hJvLr2/voluptuous/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/lh/v0_07k9d7dbfqdytfzzxks3r0000gn/T/pip-install-hJvLr2/voluptuous/setup.py", line 6, in <module>
        version = __import__('voluptuous').__version__
      File "./voluptuous/__init__.py", line 3, in <module>
        from voluptuous.schema_builder import *
      File "./voluptuous/schema_builder.py", line 132
        def Self() -> None:
                   ^
    SyntaxError: invalid syntax
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I am well aware that Python 2.7 is no longer supported by the PSF, but we still need to support it in some of our projects for certain environments (including RedHat), and our builds currently break due to that.

The mitigation for us is to pin voluptuous on Python 2.7 to <0.14.0.

The vuluptuous project should do two things:

  • correct the Trove classifiers to only the supported Python versions
  • state the supported Python versions in the python_requires argument to setup()

The question is, what is the minimum Python 3.x version now for version 0.14.0, is 3.6 sufficient?

@andy-maier
Copy link
Author

PR #493 fixes this issue (assuming that Python 3.6 is the intended minimum Python version).
Let me know if you want a higher version, then I can adjust the PR.

@spacegaier
Copy link
Collaborator

Resolved via #494

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

No branches or pull requests

2 participants