Skip to content

Pinned dependency in requirements.txt works, but dependency in another package causes python version check problem #11989

Open
@kwsp

Description

@kwsp

Description

Pinning dep versions in requirements.txt works as expected in general, but I found some weird behaviour.

Given this requirements.txt:

numba==0.57.0rc1
rocket-fft

Run pip install -r requirements.txt

In a python 3.10 environment, this works perfectly fine. The pinned numba version is installed.

However, in a python 3.11 environment, while trying to setup rocket-fft, pip tries to install the latest stable numba=0.56.4 (maybe because rocket-fft requires numba>=0.56.0), which breaks because numba==0.56 doesn't support python 3.11. (Hence why I pinned the 0.57.0rc1 in the requirements.txt).

Error trace:

$ pip install -r requiements.txt
Collecting numba==0.57.0rc1 (from -r requirements.txt (line 1))
  Using cached numba-0.57.0rc1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.6 MB)
Collecting rocket-fft (from -r requirements.txt (line 2))
  Using cached rocket-fft-0.2.0.tar.gz (42 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      Collecting setuptools>=59.2.0
        Using cached setuptools-67.7.1-py3-none-any.whl (1.1 MB)
      Collecting numba>=0.56.0
        Using cached numba-0.56.4.tar.gz (2.4 MB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'error'
        error: subprocess-exited-with-error

        × python setup.py egg_info did not run successfully.
        │ exit code: 1
        ╰─> [8 lines of output]
            Traceback (most recent call last):
              File "<string>", line 2, in <module>
              File "<pip-setuptools-caller>", line 34, in <module>
              File "/tmp/pip-install-cjq2ceft/numba_038204029f80492abe9a98cd3f937572/setup.py", line 51, in <module>
                _guard_py_ver()
              File "/tmp/pip-install-cjq2ceft/numba_038204029f80492abe9a98cd3f937572/setup.py", line 48, in _guard_py_ver
                raise RuntimeError(msg.format(cur_py, min_py, max_py))
            RuntimeError: Cannot install on Python version 3.11.3; only versions >=3.7,<3.11 are supported.
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed

      × Encountered error while generating package metadata.
      ╰─> See above for output.

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

This is weird because 0.57.0rc1 should've satisfied rocket-fft's requirement of numba>=0.56.0, but pip still tries to install numba=0.56.4 even when I have numba=0.57.0rc1 installed during the setup of rocket-fft.

Expected behavior

Pinned numba version should've resolved this.

pip version

23.1

Python version

3.11.3

OS

linux

How to Reproduce

Mentioned above

Output

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: build logicStuff related to metadata generation / wheel generationtype: supportUser Support

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions