Skip to content

8.3.0 introduces dependency loop with importlib_metadata on Python < 3.10 #1131

@legoktm

Description

@legoktm

Hi, thanks for working on and maintaining setuptools-scm.

fc2d841 introduced a dependency on importlib_metadata for Python < 3.10, which causes a dependency loop when building from source, because importlib_metadata depends on setuptools-scm. From what I can tell this is the same loop that was identified as problematic in #722 (2022), and then again in #918 (2023). Maybe there needs to be some stronger mechanism to prevent it in the future?

A simple reproducer (some output omitted to make it more readable):

$ podman run --rm -it python:3.9 bash -c "pip install --no-binary=:all: --no-cache-dir setuptools-scm==8.3.0"
Collecting setuptools-scm==8.3.0
  Downloading setuptools_scm-8.3.0.tar.gz (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.0/78.0 kB 4.4 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [99 lines of output]
      ...
      Collecting importlib-metadata>=4.6
        Downloading importlib_metadata-8.6.1.tar.gz (55 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 kB 13.0 MB/s eta 0:00:00
        Installing build dependencies: started
        Installing build dependencies: finished with status 'error'
        error: subprocess-exited-with-error
      
        × pip subprocess to install build dependencies did not run successfully.
        │ exit code: 2
        ╰─> [60 lines of output]
            Collecting setuptools_scm[toml]>=3.4.1
              Downloading setuptools_scm-8.3.0.tar.gz (78 kB)
                 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.0/78.0 kB 2.8 MB/s eta 0:00:00
            ERROR: Exception:
            Traceback (most recent call last):
              ...
              File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/build/build_tracker.py", line 92, in add
                raise LookupError(message)
            LookupError: https://files.pythonhosted.org/packages/ae/c1/0eb89ad8a0aa7033bbd0cc9fb44a0090c20edaba495f291e31be010e6ec1/setuptools_scm-8.3.0.tar.gz (from https://pypi.org/simple/setuptools-scm/) (requires-python:>=3.8) is already being built: setuptools-scm==8.3.0 from https://files.pythonhosted.org/packages/ae/c1/0eb89ad8a0aa7033bbd0cc9fb44a0090c20edaba495f291e31be010e6ec1/setuptools_scm-8.3.0.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions