setuptools_scm icon indicating copy to clipboard operation
setuptools_scm copied to clipboard

packages that depend on setuptools-scm can no longer be installed on ubuntu 22.04

Open bhearsum opened this issue 8 months ago • 11 comments
trafficstars

Ubuntu 22.04 (an LTS release) ships with pip 22.0.2 and setuptools 59.6.0. The former is notable because it does not include a fix for https://github.com/pypa/pip/issues/6264. With these two packages installed, the following happens when trying to build a package that uses setuptools-scm:

root@b951a2723ddb:~/gpustat# pip3 install .
WARNING: The directory '/builds/worker/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Processing /builds/worker/gpustat
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      /tmp/pip-build-env-1sp5tf3c/overlay/local/lib/python3.10/dist-packages/setuptools_scm/_integration/setuptools.py:31: RuntimeWarning:
      ERROR: setuptools==59.6.0 is used in combination with setuptools-scm>=8.x
      
      Your build configuration is incomplete and previously worked by accident!
      setuptools-scm requires setuptools>=61
      
      Suggested workaround if applicable:
       - migrating from the deprecated setup_requires mechanism to pep517/518
         and using a pyproject.toml to declare build dependencies
         which are reliably pre-installed before running the build tools
      
        warnings.warn(
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 143, in _get_build_requires
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
          super(_BuildMetaLegacyBackend,
        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 105, 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 109, in setup
          _setup_distribution = dist = klass(attrs)
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 459, in __init__
          _Distribution.__init__(
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 293, in __init__
          self.finalize_options()
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 836, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 835, in <lambda>
          loaded = map(lambda e: e.load(), filtered)
        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2464, in load
          self.require(*args, **kwargs)
        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2487, in require
          items = working_set.resolve(reqs, env, installer, extras=self.extras)
        File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 782, in resolve
          raise VersionConflict(dist, req).with_context(dependent_req)
      pkg_resources.VersionConflict: (setuptools 59.6.0 (/usr/lib/python3/dist-packages), Requirement.parse('setuptools>=61'))
      [end of output]

Possibly workarounds for this include upgrading one or both of pip and setuptools either in the system, or in a virtualenv before installing. Neither of these are great options, but they are at least tractable.

(This is possibly the same as #1111, but the symptoms are different enough that I don't want to assume that upfront.)

bhearsum avatar Feb 24 '25 18:02 bhearsum