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

“python_requires” should be set with “>=3.6”, as easyquotation 0.7.5 is not compatible with all Python versions. #119

Open
PyVCEchecker opened this issue Mar 8, 2022 · 0 comments

Comments

@PyVCEchecker
Copy link

Currently, the keyword argument python_requires of setup() is not set, and thus it is assumed that this distribution is compatible with all Python versions.
However, I found it is not compatible with Python<3.6. My local Python version is 2.7, and I encounter the following error when executing “pip install easyquotation”

Collecting easyquotation
  Using cached easyquotation-0.7.5.tar.gz (36 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-SQkgjH/easyquotation/setup.py'"'"'; __file__='"'"'/tmp/pip-install-SQkgjH/easyquotation/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-install-SQkgjH/easyquotation/pip-egg-info
         cwd: /tmp/pip-install-SQkgjH/easyquotation/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-SQkgjH/easyquotation/setup.py", line 8, in <module>
        with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I found that setup.py used a Python3-specific keyword argument encoding for the function open, which lead to installation failure of easyquotation in Python2. Besides, jsl.py used the syntax feature Syntax for variable annotations, and the feature is only compatible with Python 3.6 and above.

Way to fix:
modify setup() in setup.py, add python_requires keyword argument:

setup(…
     python_requires=">=3.6",
     …)

Thanks for your attention.
Best regrads,
PyVCEchecker

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

1 participant