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

[BUG] defaulting to use of release candidate numpy on Python 3.12 #570

Closed
matthewfeickert opened this issue May 29, 2024 · 2 comments
Closed
Assignees

Comments

@matthewfeickert
Copy link
Member

Describe the bug

This might not really be a "bug", but it is different from the expected user experience.

hist v2.7.2 has different NumPy requirements between Python 3.12 and older Pythons

hist/pyproject.toml

Lines 41 to 42 in 8ab9594

'numpy>=1.14.5;python_version<"3.12"',
'numpy>=1.26.0b1;python_version>="3.12"',

For Python 3.12, the numpy>=1.26.0b1 means that using pip's default upgrade strategy, this will also pick up release candidates, which might not be desirable (c.f. scikit-hep/cabinetry#477)

$ docker run --rm -ti python:3.12 /bin/bash
root@b825552eb42f:/# python -m venv venv && . venv/bin/activate
(venv) root@b825552eb42f:/# python -m pip --quiet install --upgrade pip wheel
(venv) root@b825552eb42f:/# python -m pip install 'numpy>=1.26.0b1'
Collecting numpy>=1.26.0b1
  Downloading numpy-2.0.0rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 kB 1.0 MB/s eta 0:00:00
Downloading numpy-2.0.0rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.0/19.0 MB 51.5 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-2.0.0rc2
(venv) root@b825552eb42f:/#

This was fixed in #543 with the move to

'numpy>=1.14.5',

but there hasn't been a release since then. A new release would resolve this issue, without users needing to explicitly guard against release candidates.

Steps to reproduce

$ docker run --rm -ti python:3.12 /bin/bash
root@ae8245ca153b:/# python -m venv venv && . venv/bin/activate
(venv) root@ae8245ca153b:/# python -m pip --quiet install --upgrade pip wheel
(venv) root@ae8245ca153b:/# python -m pip install --upgrade hist
Collecting hist
  Downloading hist-2.7.2-py3-none-any.whl.metadata (17 kB)
Collecting boost-histogram<1.5,>=1.3.1 (from hist)
  Downloading boost_histogram-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (25 kB)
Collecting histoprint>=2.2.0 (from hist)
  Downloading histoprint-2.4.0-py3-none-any.whl.metadata (17 kB)
Collecting numpy>=1.26.0b1 (from hist)
  Downloading numpy-2.0.0rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 kB 1.3 MB/s eta 0:00:00
Collecting click>=7.0.0 (from histoprint>=2.2.0->hist)
  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting uhi>=0.2.1 (from histoprint>=2.2.0->hist)
  Downloading uhi-0.4.0-py3-none-any.whl.metadata (7.2 kB)
Downloading hist-2.7.2-py3-none-any.whl (40 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.4/40.4 kB 5.1 MB/s eta 0:00:00
Downloading boost_histogram-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 13.4 MB/s eta 0:00:00
Downloading histoprint-2.4.0-py3-none-any.whl (16 kB)
Downloading numpy-2.0.0rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.0/19.0 MB 49.7 MB/s eta 0:00:00
Downloading click-8.1.7-py3-none-any.whl (97 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 25.3 MB/s eta 0:00:00
Downloading uhi-0.4.0-py3-none-any.whl (11 kB)
Installing collected packages: numpy, click, uhi, boost-histogram, histoprint, hist
Successfully installed boost-histogram-1.4.1 click-8.1.7 hist-2.7.2 histoprint-2.4.0 numpy-2.0.0rc2 uhi-0.4.0
(venv) root@ae8245ca153b:/# python -m pip list | grep numpy
numpy           2.0.0rc2
(venv) root@ae8245ca153b:/# deactivate && rm -rf venv && python -m venv venv && . venv/bin/activate
(venv) root@ae8245ca153b:/# python -m pip install --upgrade --no-cache-dir 'hist@git+https://github.com/scikit-hep/hist.git'
Collecting hist@ git+https://github.com/scikit-hep/hist.git
  Cloning https://github.com/scikit-hep/hist.git to /tmp/pip-install-0yiw9keq/hist_0512fe2498364f79ba39b33babffa6e9
  Running command git clone --filter=blob:none --quiet https://github.com/scikit-hep/hist.git /tmp/pip-install-0yiw9keq/hist_0512fe2498364f79ba39b33babffa6e9
  Resolved https://github.com/scikit-hep/hist.git to commit 9c3a275ff3f614d5ea201149b7851905a4c2e8b4
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting boost-histogram<1.5,>=1.3.1 (from hist@ git+https://github.com/scikit-hep/hist.git)
  Downloading boost_histogram-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (25 kB)
Collecting histoprint>=2.2.0 (from hist@ git+https://github.com/scikit-hep/hist.git)
  Downloading histoprint-2.4.0-py3-none-any.whl.metadata (17 kB)
Collecting numpy>=1.14.5 (from hist@ git+https://github.com/scikit-hep/hist.git)
  Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 2.2 MB/s eta 0:00:00
Collecting click>=7.0.0 (from histoprint>=2.2.0->hist@ git+https://github.com/scikit-hep/hist.git)
  Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting uhi>=0.2.1 (from histoprint>=2.2.0->hist@ git+https://github.com/scikit-hep/hist.git)
  Downloading uhi-0.4.0-py3-none-any.whl.metadata (7.2 kB)
Downloading boost_histogram-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 16.3 MB/s eta 0:00:00
Downloading histoprint-2.4.0-py3-none-any.whl (16 kB)
Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.0/18.0 MB 58.7 MB/s eta 0:00:00
Downloading click-8.1.7-py3-none-any.whl (97 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 98.4 MB/s eta 0:00:00
Downloading uhi-0.4.0-py3-none-any.whl (11 kB)
Building wheels for collected packages: hist
  Building wheel for hist (pyproject.toml) ... done
  Created wheel for hist: filename=hist-2.7.3.dev18+g9c3a275-py3-none-any.whl size=40760 sha256=e58b8f99dda4ebd75d7c4e07a278976f8e22f30504587739a0703de75b13b86c
  Stored in directory: /tmp/pip-ephem-wheel-cache-8uy3fw2_/wheels/0f/56/88/8a37ccc417d17d4bf263d4615cb853b05ceaf6c0aefc1b9b90
Successfully built hist
Installing collected packages: numpy, click, uhi, boost-histogram, histoprint, hist
Successfully installed boost-histogram-1.4.1 click-8.1.7 hist-2.7.3.dev18+g9c3a275 histoprint-2.4.0 numpy-1.26.4 uhi-0.4.0
(venv) root@ae8245ca153b:/# python -m pip list | grep numpy
numpy           1.26.4
@matthewfeickert matthewfeickert changed the title [BUG] forcing use of release candidate numpy on Python 3.12 [BUG] defaulting to use of release candidate numpy on Python 3.12 May 29, 2024
@henryiii
Copy link
Member

Ah, forgot that was in hist too, I fixed it in boost-histogram.

@henryiii
Copy link
Member

Fixed in 2.7.3.

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

No branches or pull requests

2 participants