From 443200c77dafa0e9d4a3b1a1883e0954033bbf4a Mon Sep 17 00:00:00 2001 From: Antoine Beyeler <49431240+abey79@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:32:59 +0100 Subject: [PATCH] Pin `numpy` to `<2` to avoid breakage upon release (#4808) ### What Numpy 2 is incoming and is a breaking release: https://pythonspeed.com/articles/numpy-2/ This PR pins numpy to ">=1.23,<2" to avoid an auto-break upon release. Of course, the end game is to actually be compatible with NumPy 2: - https://github.com/rerun-io/rerun/issues/4807 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/4808/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4808/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/4808/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4808) - [Docs preview](https://rerun.io/preview/2bf2466860fae9e8080504eb576355b0c62735ef/docs) - [Examples preview](https://rerun.io/preview/2bf2466860fae9e8080504eb576355b0c62735ef/examples) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --- .github/workflows/contrib_rerun_py.yml | 2 +- .github/workflows/reusable_build_examples.yml | 2 +- .github/workflows/reusable_publish_web.yml | 2 +- .github/workflows/reusable_run_notebook.yml | 2 +- .github/workflows/reusable_test_wheels.yml | 2 +- pixi.toml | 1 + rerun_py/pyproject.toml | 2 +- rerun_py/requirements-lint.txt | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/contrib_rerun_py.yml b/.github/workflows/contrib_rerun_py.yml index 18758db6d6ce..6fa4aa4e2440 100644 --- a/.github/workflows/contrib_rerun_py.yml +++ b/.github/workflows/contrib_rerun_py.yml @@ -68,7 +68,7 @@ jobs: # TODO(jleibs): understand why deps can't be installed in the same step as the wheel shell: bash run: | - pip install attrs>=23.1.0 numpy>=1.23 pillow pyarrow==14.0.2 pytest==7.1.2 torch==2.1.0 typing_extensions>=4.5 + pip install attrs>=23.1.0 'numpy>=1.23,<2' pillow pyarrow==14.0.2 pytest==7.1.2 torch==2.1.0 typing_extensions>=4.5 - name: Get version id: get-version diff --git a/.github/workflows/reusable_build_examples.yml b/.github/workflows/reusable_build_examples.yml index 228f51b47a5e..0da6f36f4753 100644 --- a/.github/workflows/reusable_build_examples.yml +++ b/.github/workflows/reusable_build_examples.yml @@ -69,7 +69,7 @@ jobs: shell: bash run: | pixi run pip uninstall rerun-sdk -y - pixi run pip install deprecated numpy>=1.23 pyarrow==14.0.2 pytest==7.1.2 + pixi run pip install deprecated '"numpy>=1.23,<2"' pyarrow==14.0.2 pytest==7.1.2 pixi run pip install rerun-sdk --no-index --find-links wheel - name: Verify built wheel version diff --git a/.github/workflows/reusable_publish_web.yml b/.github/workflows/reusable_publish_web.yml index a2c3f4b1100d..bd004b7089c5 100644 --- a/.github/workflows/reusable_publish_web.yml +++ b/.github/workflows/reusable_publish_web.yml @@ -95,7 +95,7 @@ jobs: run: | pixi run pip install -r scripts/ci/requirements.txt pixi run pip uninstall rerun-sdk -y - pixi run pip install deprecated numpy>=1.23 pyarrow==14.0.2 pytest==7.1.2 + pixi run pip install deprecated '"numpy>=1.23,<2"' pyarrow==14.0.2 pytest==7.1.2 pixi run pip install rerun-sdk --no-index --find-links wheel - name: Installed wheel version diff --git a/.github/workflows/reusable_run_notebook.yml b/.github/workflows/reusable_run_notebook.yml index c014b6c59999..1553dedfcceb 100644 --- a/.github/workflows/reusable_run_notebook.yml +++ b/.github/workflows/reusable_run_notebook.yml @@ -45,7 +45,7 @@ jobs: # TODO(jleibs): pull these deps from pyproject.toml shell: bash run: | - pip install deprecated numpy>=1.23 pillow>=9.5.0 pyarrow==14.0.2 pytest==7.1.2 + pip install deprecated 'numpy>=1.23,<2' pillow>=9.5.0 pyarrow==14.0.2 pytest==7.1.2 - name: Install downloaded wheel_artifact # Now install the wheel using a specific version and --no-index to guarantee we get the version from diff --git a/.github/workflows/reusable_test_wheels.yml b/.github/workflows/reusable_test_wheels.yml index edd7ae534543..394c45affb85 100644 --- a/.github/workflows/reusable_test_wheels.yml +++ b/.github/workflows/reusable_test_wheels.yml @@ -150,7 +150,7 @@ jobs: # TODO(jleibs): understand why deps can't be installed in the same step as the wheel shell: bash run: | - pip install attrs>=23.1.0 numpy>=1.23 pillow pyarrow==14.0.2 pytest==7.1.2 torch==2.1.0 typing_extensions>=4.5 + pip install attrs>=23.1.0 'numpy>=1.23,<2' pillow pyarrow==14.0.2 pytest==7.1.2 torch==2.1.0 typing_extensions>=4.5 - name: Get version id: get-version diff --git a/pixi.toml b/pixi.toml index cd0264b7893d..0fdaea27ed7e 100644 --- a/pixi.toml +++ b/pixi.toml @@ -106,6 +106,7 @@ gitpython = ">=3.1.40" just = ">=1.15.0" maturin = ">=0.14,<0.15" mypy = "1.4.1" +numpy = ">=1.23,<2" pip = ">=23" pyarrow = "14.0.2" pytest = ">=7" diff --git a/rerun_py/pyproject.toml b/rerun_py/pyproject.toml index 75a35086d461..c647cc61a58f 100644 --- a/rerun_py/pyproject.toml +++ b/rerun_py/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ dependencies = [ # Must match list in `.github/workflows/reusable_test_wheels.yml` "attrs>=23.1.0", - "numpy>=1.23", + "numpy>=1.23,<2", "pillow", # Used for JPEG encoding "pyarrow==14.0.2", "typing_extensions>=4.5", # Used for PEP-702 deprecated decorator diff --git a/rerun_py/requirements-lint.txt b/rerun_py/requirements-lint.txt index 1dfd04594a4e..368361db896a 100644 --- a/rerun_py/requirements-lint.txt +++ b/rerun_py/requirements-lint.txt @@ -1,7 +1,7 @@ attrs>=23.1.0 # for mypy to work blackdoc==0.3.8 mypy==1.4.1 -numpy>=1.24 # For mypy plugin +numpy>=1.23,<2 # For mypy plugin #TODO(#4704): clean that up when pytorch is available for 3.12 torch>=2.0.1 ; python_version < "3.12" pip-check-reqs==2.4.4 # Checks for missing deps in requirements.txt files