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 pyjnius 1.4.1 is not compatible with all Python versions. #618

Open
PyVCEchecker opened this issue Mar 1, 2022 · 1 comment
Labels

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 3.5, and I encounter the following error when executing “pip install pyjnius”

Collecting pyjnius
  Downloading pyjnius-1.4.1.tar.gz (47 kB)
     |████████████████████████████████| 47 kB 232 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /usr/local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp61sq3ndw
       cwd: /tmp/pip-install-4yqajmr2/pyjnius
  Complete output (21 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-wavx3f29/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-wavx3f29/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-wavx3f29/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 254, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/tmp/pip-build-env-wavx3f29/overlay/lib/python3.5/site-packages/setuptools/build_meta.py", line 145, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 24, in <module>
      from env import (
    File "jnius/env.py", line 353
      print(f"         Using cpu = '{machine}' instead!")
                                                       ^
  SyntaxError: invalid syntax
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp61sq3ndw Check the logs for full command output.

I found that jnius/env.py used the syntax feature f-string. The feature is only compatible with Python 3.6 and above, leading to installation failure of pyjnius in Python3.5.

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

@Julian-O
Copy link
Contributor

Oops. Not fixed. Should be an easy PR for someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants