Package: python3-pip
Version: 22.0.2+dfsg-1
Severity: important

I found this issue with my local Python project since I just upgraded
my testing system to python3 3.10.4-1, which now makes python3.10 the
default Python.

I then tested with this simple example repository:
https://github.com/pypa/sampleproject

Steps to reproduce:
1. Clone the above repository
2. Run `pip3 install --user .`

This is the result I observe:

Processing /<...>/sampleproject
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: peppercorn in 
/home/jdg/.local/lib/python3.10/site-packages (from sampleproject==2.0.0) (0.6)
Building wheels for collected packages: sampleproject
  Building wheel for sampleproject (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
 × Building wheel for sampleproject (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [2011 lines of output]
      running bdist_wheel
      running build
      running build_py
      running install
      Traceback (most recent call last):
        File 
"/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 
94, in _load_sysconfig_schemes
          for scheme in sysconfig.get_scheme_names()
        File "/usr/lib/python3.10/sysconfig.py", line 583, in get_scheme_names
          return tuple(sorted(_INSTALL_SCHEMES))
      RecursionError: maximum recursion depth exceeded while calling a Python 
object
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File 
"/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", 
line 363, in <module>
          main()
        File 
"/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", 
line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File 
"/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", 
line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 
230, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 
215, in _build_with_temp_dir
          self.run_setup()
       File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 
158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 20, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, 
in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", 
line 148, in setup
          return run_commands(dist)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", 
line 163, in run_commands
          dist.run_commands()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", 
line 967, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", 
line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, 
in run
          self.run_command('install')
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", 
line 985, in run_command
          cmd_obj.ensure_finalized()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 107, in ensure_finalized
          self.finalize_options()
        File "/usr/lib/python3/dist-packages/setuptools/command/install.py", 
line 45, in finalize_options
          orig.install.finalize_options(self)
        File 
"/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 
320, in finalize_options
          self.finalize_unix()
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 59, in 
finalize_unix
          super().finalize_unix()
        File 
"/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 
488, in finalize_unix
          self.select_scheme("posix_prefix")
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 55, in 
select_scheme
          super().select_scheme(name)
        File 
"/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 
522, in select_scheme
          scheme = _load_schemes()[name]
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 137, in 
wrapped_load_schemes
          _inject_headers(name, scheme)
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 125, in 
_inject_headers
          scheme['headers'] = 
orig_install._load_schemes()['posix_prefix']['headers']
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 137, in 
wrapped_load_schemes
          _inject_headers(name, scheme)

and then the last four lines repeat hundreds of times until:

        File 
"/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 
103, in _load_schemes
          sysconfig_schemes = _load_sysconfig_schemes() or {}
        File 
"/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 
91, in _load_sysconfig_schemes
          with contextlib.suppress(AttributeError):
        File "/usr/lib/python3.10/contextlib.py", line 436, in __exit__
          return exctype is not None and issubclass(exctype, self._exceptions)
      RecursionError: maximum recursion depth exceeded in __subclasscheck__
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem 
with pip.
  ERROR: Failed building wheel for sampleproject
Failed to build sampleproject
ERROR: Could not build wheels for sampleproject, which is required to install 
pyproject.toml-based projects


I get the same behaviour (obviously) with `python3.10 -m pip install
--user .` but `python3.9 -m pip install --user .` works fine:

$ python3.9 -m pip install --user .
Processing /<...>/sampleproject
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting peppercorn
  Using cached peppercorn-0.6-py3-none-any.whl (4.8 kB)
Building wheels for collected packages: sampleproject
  Building wheel for sampleproject (pyproject.toml) ... done
  Created wheel for sampleproject: 
filename=sampleproject-2.0.0-py3-none-any.whl size=4225 
sha256=2bc606f6e112f9a897f877416f8b471b9fdd9986e53fad88dafc2a11bbfdf6c1
  Stored in directory: 
/tmp/pip-ephem-wheel-cache-xmhzpetx/wheels/81/80/ff/23c143a1a2de938d596153b57b2a71f1fb269f3e1007dab618
Successfully built sampleproject
Installing collected packages: peppercorn, sampleproject
Successfully installed peppercorn-0.6 sampleproject-2.0.0

So there is definitely some interaction of pip with python3.10 that is
not working well.

Deleting the pyproject.toml file allows pip to work with 3.10; this
file is minimal:

[build-system]
# These are the assumed default build requirements from pip:
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"

I've not got further than that, unfortunately.

Best wishes,

   Julian

-- System Information:
Debian Release: bookworm/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.17.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-pip depends on:
ii  ca-certificates     20211016
ii  python3             3.10.4-1
ii  python3-distutils   3.9.12-1
ii  python3-setuptools  59.6.0-1.2
ii  python3-wheel       0.37.1-2

Versions of packages python3-pip recommends:
ii  build-essential  12.9
ii  python3-dev      3.10.4-1

python3-pip suggests no packages.

-- no debconf information

Reply via email to