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

ensure_python deprecated in python 3.10 #3364

Closed
jonringer opened this issue Jan 31, 2022 · 6 comments
Closed

ensure_python deprecated in python 3.10 #3364

jonringer opened this issue Jan 31, 2022 · 6 comments

Comments

@jonringer
Copy link

Description

ensure_python deprecated in python 3.10, will kill sdist installation.

Reproduce

  1. Install python 3.10, pip, setuptools
  2. Run:
pip install --user https://files.pythonhosted.org/packages/27/f1/0d3a09c0069467ed9636faf3a9b5b758378216bb891066a0bc24799681e3/jupyterlab_widgets-1.0.2.tar.gz

Expected behavior

Doesn't fail

Context

relevant logs:

    File "setup.py", line 18, in <module>
      ensure_python(">=3.6")
    File "/run/user/1000/pip-build-env-s322v3pd/overlay/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 103, in ensure_python
      raise ValueError('Python version %s unsupported' % part)
  ValueError: Python version 3.10 unsupported
Full logs:
$ pip install --user https://files.pythonhosted.org/packages/27/f1/0d3a09c0069467ed9636faf3a9b5b758378216bb891066a0bc24799681e3/jupyterlab_widgets-1.0.2.tar.gz
Collecting https://files.pythonhosted.org/packages/27/f1/0d3a09c0069467ed9636faf3a9b5b758378216bb891066a0bc24799681e3/jupyterlab_widgets-1.0.2.tar.gz
  Using cached jupyterlab_widgets-1.0.2.tar.gz (118 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /nix/store/b798fp24zf2fdafmyyc4sxfr48ly5yy9-python3-3.10.1/bin/python3.10 /nix/store/37l3w8cibfijh8if4iy25ra37zi5pdds-python3.10-pip-21.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /run/user/1000/tmp1puyfj05
       cwd: /run/user/1000/pip-req-build-17ejtea5
  Complete output (18 lines):
  Traceback (most recent call last):
    File "/nix/store/37l3w8cibfijh8if4iy25ra37zi5pdds-python3.10-pip-21.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/nix/store/37l3w8cibfijh8if4iy25ra37zi5pdds-python3.10-pip-21.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/nix/store/37l3w8cibfijh8if4iy25ra37zi5pdds-python3.10-pip-21.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/run/user/1000/pip-build-env-s322v3pd/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "/run/user/1000/pip-build-env-s322v3pd/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
      self.run_setup()
    File "/run/user/1000/pip-build-env-s322v3pd/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 18, in <module>
      ensure_python(">=3.6")
    File "/run/user/1000/pip-build-env-s322v3pd/overlay/lib/python3.10/site-packages/jupyter_packaging/setupbase.py", line 103, in ensure_python
      raise ValueError('Python version %s unsupported' % part)
  ValueError: Python version 3.10 unsupported
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/27/f1/0d3a09c0069467ed9636faf3a9b5b758378216bb891066a0bc24799681e3/jupyterlab_widgets-1.0.2.tar.gz. Command errored out with exit status 1: /nix/store/b798fp24zf2fdafmyyc4sxfr48ly5yy9-python3-3.10.1/bin/python3.10 /nix/store/37l3w8cibfijh8if4iy25ra37zi5pdds-python3.10-pip-21.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /run/user/1000/tmp1puyfj05 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /nix/store/b798fp24zf2fdafmyyc4sxfr48ly5yy9-python3-3.10.1/bin/python3.10 /nix/store/37l3w8cibfijh8if4iy25ra37zi5pdds-python3.10-pip-21.3.1/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /run/user/1000/tmp1puyfj05 Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 22.0.2 is available.
You should consider upgrading via the '/nix/store/b798fp24zf2fdafmyyc4sxfr48ly5yy9-python3-3.10.1/bin/python3.10 -m pip install --upgrade pip' command.

don't worry about the /nix/store paths.

@jasongrout
Copy link
Member

Thanks. We may need to just bump our requirement for jupyter_packaging to the latest version.

@jasongrout jasongrout added this to the 8.0 milestone Jan 31, 2022
@jasongrout
Copy link
Member

Actually, the jupyter_packaging code says to just use python_requires instead: https://github.com/jupyter/jupyter-packaging/blob/fe87c6ae46df9d13c363111aa4fbfb3c25418843/jupyter_packaging/setupbase.py#L462-L463

Use setuptools python_requires instead

jasongrout added a commit to jasongrout/ipywidgets that referenced this issue Feb 3, 2022
jupyter_packaging deprecates ensure_python and recommends using python_requres.
We already use python_requires, so there is no need to also use ensure_python.
Apparently, there are problems on Python 3.10.

Fixes jupyter-widgets#3364
@jasongrout jasongrout modified the milestones: 8.0, 7.x Feb 3, 2022
@jasongrout
Copy link
Member

ensure_python is not used on master, only on the 7.x series, so #3368 just takes care of it on the 7.x branch.

jasongrout added a commit to jasongrout/ipywidgets that referenced this issue Feb 8, 2022
jupyter_packaging deprecates ensure_python and recommends using python_requres.
We already use python_requires, so there is no need to also use ensure_python.
Apparently, there are problems on Python 3.10.

Fixes jupyter-widgets#3364
@jasongrout
Copy link
Member

FIxed in #3368

@jonringer
Copy link
Author

Thanks :)

@jasongrout jasongrout modified the milestones: 7.x, 7.7 Feb 8, 2022
@jasongrout
Copy link
Member

We plan to release later this week or next week.

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

No branches or pull requests

2 participants