From 281047b206d093e9b9c8a5e0629f3725822be7d3 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Mon, 15 Jun 2026 15:31:43 +0200 Subject: [PATCH 1/4] run tox deps on py311 --- requirements/base.txt | 15 ++++----- requirements/basetest.txt | 45 +++++++++++++------------- requirements/ci.txt | 26 +++++++-------- requirements/dev.txt | 16 +++++----- requirements/docs.txt | 66 +++++++++++++++++++-------------------- requirements/mypy.txt | 6 ++-- requirements/nightly.txt | 54 ++++++++++++++++++-------------- requirements/static.txt | 10 +++--- requirements/test.txt | 2 +- 9 files changed, 127 insertions(+), 113 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 9049f1f2a..96fc8366e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -# SHA1:4f04315d1f87df878cc2b5bc25669f4e7cbedbab +# SHA1:ede6ef9217a70513643c0f6401f97176330d1bf3 # # This file was generated by pip-compile-multi. # To update, run: @@ -15,13 +15,13 @@ dnspython==2.8.0 # via email-validator email-validator==2.3.0 # via -r base.in -fonttools==4.62.1 +fonttools==4.63.0 # via matplotlib h5py==3.16.0 # via # -r base.in # scippnexus -idna==3.13 +idna==3.18 # via email-validator kiwisolver==1.5.0 # via matplotlib @@ -35,7 +35,7 @@ matplotlib==3.10.9 # plopp mpltoolbox==26.2.0 # via -r base.in -numpy==2.4.4 +numpy==2.4.6 # via # -r base.in # contourpy @@ -49,11 +49,11 @@ packaging==26.2 # matplotlib pillow==12.2.0 # via matplotlib -plopp==26.4.2 +plopp==26.5.0 # via -r base.in -pydantic==2.13.3 +pydantic==2.13.4 # via -r base.in -pydantic-core==2.46.3 +pydantic-core==2.46.4 # via pydantic pyparsing==3.3.2 # via matplotlib @@ -64,6 +64,7 @@ python-dateutil==2.9.0.post0 scipp==26.3.1 # via # -r base.in + # plopp # scippnexus scippnexus==26.1.1 # via -r base.in diff --git a/requirements/basetest.txt b/requirements/basetest.txt index ce7ec1c08..330c32e2c 100644 --- a/requirements/basetest.txt +++ b/requirements/basetest.txt @@ -9,7 +9,7 @@ appdirs==1.4.4 # via pace-neutrons asttokens==3.0.1 # via stack-data -certifi==2026.4.22 +certifi==2026.5.20 # via requests charset-normalizer==3.4.7 # via requests @@ -23,11 +23,11 @@ cyclebane==24.10.0 # via sciline cycler==0.12.1 # via matplotlib -debugpy==1.8.20 +debugpy==1.8.21 # via ipykernel -decorator==5.2.1 +decorator==5.3.1 # via ipython -euphonic[phonopy-reader]==1.6.1 +euphonic[phonopy-reader]==2.0.0 # via pace-neutrons execnet==2.1.2 # via pytest-xdist @@ -37,23 +37,23 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.62.1 +fonttools==4.63.0 # via matplotlib h5py==3.16.0 # via euphonic -hypothesis==6.152.4 +hypothesis==6.155.2 # via -r basetest.in -idna==3.13 +idna==3.18 # via requests iniconfig==2.3.0 # via pytest ipydatawidgets==4.3.5 # via pythreejs -ipykernel==7.2.0 +ipykernel==7.3.0 # via -r basetest.in ipympl==0.10.0 # via -r basetest.in -ipython==9.13.0 +ipython==9.14.1 # via # ipykernel # ipympl @@ -66,9 +66,9 @@ ipywidgets==8.1.8 # ipydatawidgets # ipympl # pythreejs -jedi==0.19.2 +jedi==0.20.0 # via ipython -jupyter-client==8.8.0 +jupyter-client==8.9.1 # via ipykernel jupyter-core==5.9.1 # via @@ -84,15 +84,15 @@ matplotlib==3.10.9 # via # ipympl # pace-neutrons -matplotlib-inline==0.2.1 +matplotlib-inline==0.2.2 # via # ipykernel # ipython -nest-asyncio==1.6.0 +nest-asyncio2==1.7.2 # via ipykernel networkx==3.6.1 # via cyclebane -numpy==2.4.4 +numpy==2.4.6 # via # contourpy # euphonic @@ -115,7 +115,7 @@ packaging==26.2 # matplotlib # pooch # pytest -parso==0.8.6 +parso==0.8.7 # via jedi pexpect==4.9.0 # via ipython @@ -125,7 +125,7 @@ pillow==12.2.0 # matplotlib pint==0.25.3 # via euphonic -platformdirs==4.9.6 +platformdirs==4.10.0 # via # jupyter-core # pint @@ -171,7 +171,7 @@ pyzmq==27.1.0 # via # ipykernel # jupyter-client -requests==2.33.1 +requests==2.34.2 # via # pace-neutrons # pooch @@ -197,11 +197,11 @@ threadpoolctl==3.6.0 # via euphonic toolz==1.1.0 # via euphonic -tornado==6.5.5 +tornado==6.5.7 # via # ipykernel # jupyter-client -traitlets==5.14.3 +traitlets==5.15.1 # via # ipykernel # ipympl @@ -216,13 +216,16 @@ traittypes==0.2.3 # via ipydatawidgets typing-extensions==4.15.0 # via + # euphonic # flexcache # flexparser + # ipython + # jupyter-client # pint # spglib -urllib3==2.6.3 +urllib3==2.7.0 # via requests -wcwidth==0.6.0 +wcwidth==0.8.1 # via prompt-toolkit widgetsnbextension==4.0.15 # via ipywidgets diff --git a/requirements/ci.txt b/requirements/ci.txt index 2ea24bba5..1e17399be 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -5,54 +5,54 @@ # # requirements upgrade # -cachetools==7.0.6 +cachetools==7.1.4 # via tox -certifi==2026.4.22 +certifi==2026.5.20 # via requests charset-normalizer==3.4.7 # via requests colorama==0.4.6 # via tox -distlib==0.4.0 +distlib==0.4.2 # via virtualenv -filelock==3.29.0 +filelock==3.29.1 # via # python-discovery # tox # virtualenv gitdb==4.0.12 # via gitpython -gitpython==3.1.49 +gitpython==3.1.50 # via -r ci.in -idna==3.13 +idna==3.18 # via requests packaging==26.2 # via # -r ci.in # pyproject-api # tox -platformdirs==4.9.6 +platformdirs==4.10.0 # via # python-discovery # tox # virtualenv pluggy==1.6.0 # via tox -pyproject-api==1.10.0 +pyproject-api==1.10.1 # via tox -python-discovery==1.2.2 +python-discovery==1.4.0 # via # tox # virtualenv -requests==2.33.1 +requests==2.34.2 # via -r ci.in smmap==5.0.3 # via gitdb tomli-w==1.2.0 # via tox -tox==4.53.0 +tox==4.55.1 # via -r ci.in -urllib3==2.6.3 +urllib3==2.7.0 # via requests -virtualenv==21.3.0 +virtualenv==21.4.2 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 67cf4d3ec..6299269e7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -26,11 +26,11 @@ async-lru==2.3.0 # via jupyterlab cffi==2.0.0 # via argon2-cffi-bindings -click==8.3.3 +click==8.4.1 # via # pip-compile-multi # pip-tools -copier==9.14.3 +copier==9.15.1 # via -r dev.in dunamai==1.26.1 # via copier @@ -61,7 +61,7 @@ jupyter-events==0.12.1 # via jupyter-server jupyter-lsp==2.3.1 # via jupyterlab -jupyter-server==2.17.0 +jupyter-server==2.19.0 # via # jupyter-lsp # jupyterlab @@ -69,7 +69,7 @@ jupyter-server==2.17.0 # notebook-shim jupyter-server-terminals==0.5.4 # via jupyter-server -jupyterlab==4.5.7 +jupyterlab==4.5.8 # via -r dev.in jupyterlab-server==2.28.0 # via jupyterlab @@ -77,11 +77,13 @@ lark==1.3.1 # via rfc3987-syntax notebook-shim==0.2.4 # via jupyterlab +overrides==7.7.0 + # via jupyter-server pip-compile-multi==3.3.1 # via -r dev.in pip-tools==7.5.3 # via pip-compile-multi -plumbum==1.10.0 +plumbum==2.0.1 # via copier prometheus-client==0.25.0 # via jupyter-server @@ -109,9 +111,9 @@ terminado==0.18.1 # jupyter-server-terminals toposort==1.10 # via pip-compile-multi -types-docutils==0.22.3.20260408 +types-docutils==0.22.3.20260518 # via -r dev.in -types-requests==2.33.0.20260408 +types-requests==2.33.0.20260518 # via -r dev.in tzdata==2026.2 # via arrow diff --git a/requirements/docs.txt b/requirements/docs.txt index 491ba9070..5692d56d2 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -22,13 +22,13 @@ babel==2.18.0 # via # pydata-sphinx-theme # sphinx -beautifulsoup4==4.14.3 +beautifulsoup4==4.15.0 # via # nbconvert # pydata-sphinx-theme -bleach[css]==6.3.0 +bleach[css]==6.4.0 # via nbconvert -certifi==2026.4.22 +certifi==2026.5.20 # via requests charset-normalizer==3.4.7 # via requests @@ -36,9 +36,9 @@ comm==0.2.3 # via # ipykernel # ipywidgets -debugpy==1.8.20 +debugpy==1.8.21 # via ipykernel -decorator==5.2.1 +decorator==5.3.1 # via ipython defusedxml==0.7.1 # via nbconvert @@ -56,11 +56,11 @@ fastjsonschema==2.21.2 # via nbformat imagesize==2.0.0 # via sphinx -ipykernel==7.2.0 +ipykernel==7.3.0 # via -r docs.in ipympl==0.10.0 # via -r docs.in -ipython==9.13.0 +ipython==9.14.1 # via # -r docs.in # ipykernel @@ -70,7 +70,7 @@ ipython-pygments-lexers==1.1.1 # via ipython ipywidgets==8.1.8 # via ipympl -jedi==0.19.2 +jedi==0.20.0 # via ipython jinja2==3.1.6 # via @@ -82,7 +82,7 @@ jsonschema==4.26.0 # via nbformat jsonschema-specifications==2025.9.1 # via jsonschema -jupyter-client==8.8.0 +jupyter-client==8.9.1 # via # ipykernel # nbclient @@ -99,7 +99,7 @@ jupyterlab-widgets==3.0.16 # via ipywidgets latexcodec==3.0.1 # via pybtex -markdown-it-py==4.0.0 +markdown-it-py==4.2.0 # via # mdit-py-plugins # myst-parser @@ -107,19 +107,19 @@ markupsafe==3.0.3 # via # jinja2 # nbconvert -matplotlib-inline==0.2.1 +matplotlib-inline==0.2.2 # via # ipykernel # ipython -mdit-py-plugins==0.5.0 +mdit-py-plugins==0.6.1 # via myst-parser mdurl==0.1.2 # via markdown-it-py -mistune==3.2.0 +mistune==3.2.1 # via nbconvert -myst-parser==5.0.0 +myst-parser==5.1.0 # via -r docs.in -nbclient==0.10.4 +nbclient==0.11.0 # via nbconvert nbconvert==7.17.1 # via nbsphinx @@ -130,15 +130,15 @@ nbformat==5.10.4 # nbsphinx nbsphinx==0.9.8 # via -r docs.in -nest-asyncio==1.6.0 +nest-asyncio2==1.7.2 # via ipykernel pandocfilters==1.5.1 # via nbconvert -parso==0.8.6 +parso==0.8.7 # via jedi pexpect==4.9.0 # via ipython -platformdirs==4.9.6 +platformdirs==4.10.0 # via # jupyter-core # pooch @@ -162,9 +162,9 @@ pybtex==0.26.1 # sphinxcontrib-bibtex pybtex-docutils==1.0.3 # via sphinxcontrib-bibtex -pydantic-settings==2.14.0 +pydantic-settings==2.14.1 # via autodoc-pydantic -pydata-sphinx-theme==0.17.1 +pydata-sphinx-theme==0.18.0 # via -r docs.in pygments==2.20.0 # via @@ -188,21 +188,21 @@ referencing==0.37.0 # via # jsonschema # jsonschema-specifications -requests==2.33.1 +requests==2.34.2 # via # pooch # sphinx roman-numerals==4.1.0 # via sphinx -rpds-py==0.30.0 +rpds-py==2026.5.1 # via # jsonschema # referencing -snowballstemmer==3.0.1 +snowballstemmer==3.1.1 # via sphinx -soupsieve==2.8.3 +soupsieve==2.8.4 # via beautifulsoup4 -sphinx==9.1.0 +sphinx==9.0.4 # via # -r docs.in # autodoc-pydantic @@ -213,7 +213,7 @@ sphinx==9.1.0 # sphinx-copybutton # sphinx-design # sphinxcontrib-bibtex -sphinx-autodoc-typehints==3.10.2 +sphinx-autodoc-typehints==3.6.1 # via -r docs.in sphinx-copybutton==0.5.2 # via -r docs.in @@ -221,7 +221,7 @@ sphinx-design==0.7.0 # via -r docs.in sphinxcontrib-applehelp==2.0.0 # via sphinx -sphinxcontrib-bibtex==2.6.5 +sphinxcontrib-bibtex==2.7.0 # via -r docs.in sphinxcontrib-devhelp==2.0.0 # via sphinx @@ -235,15 +235,15 @@ sphinxcontrib-serializinghtml==2.0.0 # via sphinx stack-data==0.6.3 # via ipython -tinycss2==1.4.0 +tinycss2==1.5.1 # via bleach -tof==26.3.0 +tof==26.6.0 # via -r docs.in -tornado==6.5.5 +tornado==6.5.7 # via # ipykernel # jupyter-client -traitlets==5.14.3 +traitlets==5.15.1 # via # ipykernel # ipympl @@ -256,9 +256,9 @@ traitlets==5.14.3 # nbconvert # nbformat # nbsphinx -urllib3==2.6.3 +urllib3==2.7.0 # via requests -wcwidth==0.6.0 +wcwidth==0.8.1 # via prompt-toolkit webencodings==0.5.1 # via diff --git a/requirements/mypy.txt b/requirements/mypy.txt index 7b5e4cb84..eac13b0aa 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -6,9 +6,11 @@ # requirements upgrade # -r test.txt -librt==0.9.0 +ast-serialize==0.5.0 # via mypy -mypy==1.20.2 +librt==0.11.0 + # via mypy +mypy==2.1.0 # via -r mypy.in mypy-extensions==1.1.0 # via mypy diff --git a/requirements/nightly.txt b/requirements/nightly.txt index ad85511a0..84151561b 100644 --- a/requirements/nightly.txt +++ b/requirements/nightly.txt @@ -14,7 +14,7 @@ appdirs==1.4.4 # via pace-neutrons asttokens==3.0.1 # via stack-data -certifi==2026.4.22 +certifi==2026.5.20 # via requests charset-normalizer==3.4.7 # via requests @@ -28,15 +28,15 @@ cyclebane==24.10.0 # via sciline cycler==0.12.1 # via matplotlib -debugpy==1.8.20 +debugpy==1.8.21 # via ipykernel -decorator==5.2.1 +decorator==5.3.1 # via ipython dnspython==2.8.0 # via email-validator email-validator==2.3.0 # via -r nightly.in -euphonic[phonopy-reader]==1.6.1 +euphonic[phonopy-reader]==2.0.0 # via pace-neutrons execnet==2.1.2 # via pytest-xdist @@ -46,16 +46,17 @@ flexcache==0.3 # via pint flexparser==0.4 # via pint -fonttools==4.62.1 +fonttools==4.63.0 # via matplotlib h5py==3.16.0 # via # -r nightly.in # euphonic # scippnexus -hypothesis==6.152.4 + # tof +hypothesis==6.155.2 # via -r nightly.in -idna==3.13 +idna==3.18 # via # email-validator # requests @@ -63,11 +64,11 @@ iniconfig==2.3.0 # via pytest ipydatawidgets==4.3.5 # via pythreejs -ipykernel==7.2.0 +ipykernel==7.3.0 # via -r nightly.in ipympl==0.10.0 # via -r nightly.in -ipython==9.13.0 +ipython==9.14.1 # via # ipykernel # ipympl @@ -80,9 +81,9 @@ ipywidgets==8.1.8 # ipydatawidgets # ipympl # pythreejs -jedi==0.19.2 +jedi==0.20.0 # via ipython -jupyter-client==8.8.0 +jupyter-client==8.9.1 # via ipykernel jupyter-core==5.9.1 # via @@ -99,23 +100,23 @@ lazy-loader==0.5 # tof libpymcr==0.2.1 # via pace-neutrons -matplotlib==3.11.0rc1 +matplotlib==3.11.0rc2 # via # ipympl # mpltoolbox # pace-neutrons # plopp -matplotlib-inline==0.2.1 +matplotlib-inline==0.2.2 # via # ipykernel # ipython mpltoolbox @ git+https://github.com/scipp/mpltoolbox@main # via -r nightly.in -nest-asyncio==1.6.0 +nest-asyncio2==1.7.2 # via ipykernel networkx==3.6.1 # via cyclebane -numpy==2.4.4 +numpy==2.4.6 # via # -r nightly.in # contourpy @@ -141,7 +142,7 @@ packaging==26.2 # matplotlib # pooch # pytest -parso==0.8.6 +parso==0.8.7 # via jedi pexpect==4.9.0 # via ipython @@ -151,7 +152,7 @@ pillow==12.2.0 # matplotlib pint==0.25.3 # via euphonic -platformdirs==4.9.6 +platformdirs==4.10.0 # via # jupyter-core # pint @@ -178,9 +179,9 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.3 # via stack-data -pydantic==2.13.3 +pydantic==2.14.0a1 # via -r nightly.in -pydantic-core==2.46.3 +pydantic-core==2.47.0 # via pydantic pygments==2.20.0 # via @@ -208,7 +209,7 @@ pyzmq==27.1.0 # via # ipykernel # jupyter-client -requests==2.33.1 +requests==2.34.2 # via # pace-neutrons # pooch @@ -217,6 +218,7 @@ sciline @ git+https://github.com/scipp/sciline@main scipp==100.0.0.dev0 # via # -r nightly.in + # plopp # scippnexus # tof scippnexus @ git+https://github.com/scipp/scippnexus@main @@ -226,6 +228,7 @@ scipy==1.17.1 # -r nightly.in # euphonic # scippnexus + # tof seekpath==2.2.1 # via euphonic six==1.17.0 @@ -246,11 +249,11 @@ tof @ git+https://github.com/scipp/tof@main # via -r nightly.in toolz==1.1.0 # via euphonic -tornado==6.5.5 +tornado==6.5.7 # via # ipykernel # jupyter-client -traitlets==5.14.3 +traitlets==5.15.1 # via # ipykernel # ipympl @@ -265,8 +268,11 @@ traittypes==0.2.3 # via ipydatawidgets typing-extensions==4.15.0 # via + # euphonic # flexcache # flexparser + # ipython + # jupyter-client # pint # pydantic # pydantic-core @@ -274,9 +280,9 @@ typing-extensions==4.15.0 # typing-inspection typing-inspection==0.4.2 # via pydantic -urllib3==2.6.3 +urllib3==2.7.0 # via requests -wcwidth==0.6.0 +wcwidth==0.8.1 # via prompt-toolkit widgetsnbextension==4.0.15 # via ipywidgets diff --git a/requirements/static.txt b/requirements/static.txt index 177fcdc2c..ab7c093a2 100644 --- a/requirements/static.txt +++ b/requirements/static.txt @@ -7,9 +7,9 @@ # cfgv==3.5.0 # via pre-commit -distlib==0.4.0 +distlib==0.4.2 # via virtualenv -filelock==3.29.0 +filelock==3.29.1 # via # python-discovery # virtualenv @@ -17,15 +17,15 @@ identify==2.6.19 # via pre-commit nodeenv==1.10.0 # via pre-commit -platformdirs==4.9.6 +platformdirs==4.10.0 # via # python-discovery # virtualenv pre-commit==4.6.0 # via -r static.in -python-discovery==1.2.2 +python-discovery==1.4.0 # via virtualenv pyyaml==6.0.3 # via pre-commit -virtualenv==21.3.0 +virtualenv==21.4.2 # via pre-commit diff --git a/requirements/test.txt b/requirements/test.txt index 4e8caccf2..290922165 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -7,5 +7,5 @@ # -r base.txt -r basetest.txt -tof==26.3.0 +tof==26.6.0 # via -r test.in From 89ad1eb171a10270930bf83f14b23d8306da7ef8 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 17 Jun 2026 13:19:38 +0200 Subject: [PATCH 2/4] add script to automatically sync versions between requirements folder and conda buildconfig --- .buildconfig/ci-linux.yml | 48 ++++++++++++++--------------- requirements/sync_versions.py | 58 +++++++++++++++++++++++++++++++++++ tox.ini | 1 + 3 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 requirements/sync_versions.py diff --git a/.buildconfig/ci-linux.yml b/.buildconfig/ci-linux.yml index 91613e70d..10bcab76c 100644 --- a/.buildconfig/ci-linux.yml +++ b/.buildconfig/ci-linux.yml @@ -7,41 +7,41 @@ channels: - mantid dependencies: - email-validator==2.3.0 - - h5py==3.15.1 - - hypothesis==6.151.9 - - ipykernel==6.29.5 - - ipympl==0.9.8 + - h5py==3.16.0 + - hypothesis==6.155.2 + - ipykernel==7.3.0 + - ipympl==0.10.0 - ipywidgets==8.1.8 - - lazy-loader==0.4 + - lazy-loader==0.5 - mantid==6.15.0 - - matplotlib==3.9.4 - - mpltoolbox==25.10.0 - - plopp==26.4.1 + - matplotlib==3.10.9 + - mpltoolbox==26.2.0 + - plopp==26.5.0 - pooch==1.9.0 - - pydantic==2.12.4 - - pytest==8.3.3 + - pydantic==2.2.0 + - pytest==9.0.3 - pytest-asyncio==0.24.0 - - python-dateutil==2.9.0 + - python-dateutil==2.9.0.post0 - python-graphviz==0.21 - pythreejs==2.4.2 - - scipp==26.3.0 - - scippnexus==25.11.0 - - scipy==1.16.3 - - tox==4.23.2 + - scipp==26.3.1 + - scippnexus==26.1.1 + - scipy==1.17.1 + - tox==4.55.1 # docs - autodoc-pydantic=2.1.0 - - myst-parser==4.0.0 - - nbsphinx==0.9.5 - - packaging==25.0 + - myst-parser==5.1.0 + - nbsphinx==0.9.8 + - packaging==26.2 - pandoc==3.4.0 - - pydata-sphinx-theme==0.16.0 - - sphinx==8.1.3 - - sphinx-autodoc-typehints==2.5.0 + - pydata-sphinx-theme==0.18.0 + - sphinx==0.9.8 + - sphinx-autodoc-typehints==3.6.1 - sphinx-copybutton==0.5.2 - - sphinx-design==0.6.1 - - sphinxcontrib-bibtex==2.6.3 - - tof==26.1.0 + - sphinx-design==0.7.0 + - sphinxcontrib-bibtex==2.7.0 + - tof==26.6.0 # docs and tests - sciline==25.11.1 diff --git a/requirements/sync_versions.py b/requirements/sync_versions.py new file mode 100644 index 000000000..c814d2155 --- /dev/null +++ b/requirements/sync_versions.py @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: BSD-3-Clause + +import argparse +from pathlib import Path + + +def main(fname, requirements_folder): + """ + Get versions from requirements folder and copy them to the conda env file. + This ensures that the same versions are used across both pip and conda environments. + """ + print(f"Syncing versions from {requirements_folder} to {fname}\n") + + with open(fname, "r") as f: + lines = f.readlines() + + with open(fname, "w") as f: + for line in lines: + if "==" not in line: + f.write(line) + continue + + # Grep in requirements folder for package name and copy version over + parts = line.split("==") + package_name = parts[0].strip() + old_version = parts[1].strip() + pattern = package_name.lstrip(" -") + "==" + found = False + for req_file in requirements_folder.glob("*.txt"): + if "nightly" in req_file.name: + continue + with open(req_file, "r") as req_f: + for req_line in req_f: + if pattern in req_line: + version = req_line.split("==")[1].strip() + if version != old_version: + print(f"{package_name}: {old_version} --> {version}") + f.write(f" {package_name}=={version}\n") + found = True + break + if found: + break + + if not found: + f.write(line) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Get versions from requirements folder and copy them to the conda env file." + ) + parser.add_argument("fname", type=str, help="Path to conda env file.") + parser.add_argument( + "requirements_folder", type=str, help="Path to requirements folder." + ) + args = parser.parse_args() + + main(fname=Path(args.fname), requirements_folder=Path(args.requirements_folder)) diff --git a/tox.ini b/tox.ini index a08d20717..0677aa916 100644 --- a/tox.ini +++ b/tox.ini @@ -49,3 +49,4 @@ skip_install = true changedir = requirements commands = python ./make_base.py --nightly scipp,scippnexus,plopp,mpltoolbox,sciline,tof pip-compile-multi -d . --backtracking --annotate-index + python ./sync_versions.py ../.buildconfig/ci-linux.yml . From 592352c0dd46c4771a0dc40fda2246cacd265b3f Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 17 Jun 2026 13:52:37 +0200 Subject: [PATCH 3/4] lint --- requirements/sync_versions.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/requirements/sync_versions.py b/requirements/sync_versions.py index c814d2155..345bd3e7f 100644 --- a/requirements/sync_versions.py +++ b/requirements/sync_versions.py @@ -1,17 +1,21 @@ # SPDX-License-Identifier: BSD-3-Clause import argparse +import logging from pathlib import Path +logger = logging.getLogger(" ") +logging.basicConfig(level=logging.INFO) + def main(fname, requirements_folder): """ Get versions from requirements folder and copy them to the conda env file. This ensures that the same versions are used across both pip and conda environments. """ - print(f"Syncing versions from {requirements_folder} to {fname}\n") + logger.info("Syncing versions from %s to %s\n", requirements_folder, fname) - with open(fname, "r") as f: + with open(fname) as f: lines = f.readlines() with open(fname, "w") as f: @@ -29,12 +33,14 @@ def main(fname, requirements_folder): for req_file in requirements_folder.glob("*.txt"): if "nightly" in req_file.name: continue - with open(req_file, "r") as req_f: + with open(req_file) as req_f: for req_line in req_f: if pattern in req_line: version = req_line.split("==")[1].strip() if version != old_version: - print(f"{package_name}: {old_version} --> {version}") + logger.info( + "%s: %s --> %s", package_name, old_version, version + ) f.write(f" {package_name}=={version}\n") found = True break @@ -47,7 +53,7 @@ def main(fname, requirements_folder): if __name__ == "__main__": parser = argparse.ArgumentParser( - description="Get versions from requirements folder and copy them to the conda env file." + description="Synchronize versions from requirements folder to conda env file." ) parser.add_argument("fname", type=str, help="Path to conda env file.") parser.add_argument( From 2b93c7658b4efc36cbb54810701b576cae02a778 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 17 Jun 2026 14:11:23 +0200 Subject: [PATCH 4/4] fix script with long names containing other packages names --- .buildconfig/ci-linux.yml | 4 ++-- requirements/sync_versions.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.buildconfig/ci-linux.yml b/.buildconfig/ci-linux.yml index 10bcab76c..f79af899f 100644 --- a/.buildconfig/ci-linux.yml +++ b/.buildconfig/ci-linux.yml @@ -18,7 +18,7 @@ dependencies: - mpltoolbox==26.2.0 - plopp==26.5.0 - pooch==1.9.0 - - pydantic==2.2.0 + - pydantic==2.13.4 - pytest==9.0.3 - pytest-asyncio==0.24.0 - python-dateutil==2.9.0.post0 @@ -36,7 +36,7 @@ dependencies: - packaging==26.2 - pandoc==3.4.0 - pydata-sphinx-theme==0.18.0 - - sphinx==0.9.8 + - sphinx==9.0.4 - sphinx-autodoc-typehints==3.6.1 - sphinx-copybutton==0.5.2 - sphinx-design==0.7.0 diff --git a/requirements/sync_versions.py b/requirements/sync_versions.py index 345bd3e7f..8bd73ff8b 100644 --- a/requirements/sync_versions.py +++ b/requirements/sync_versions.py @@ -28,7 +28,8 @@ def main(fname, requirements_folder): parts = line.split("==") package_name = parts[0].strip() old_version = parts[1].strip() - pattern = package_name.lstrip(" -") + "==" + clean_package_name = package_name.lstrip(" -") + pattern = clean_package_name + "==" found = False for req_file in requirements_folder.glob("*.txt"): if "nightly" in req_file.name: @@ -36,7 +37,14 @@ def main(fname, requirements_folder): with open(req_file) as req_f: for req_line in req_f: if pattern in req_line: - version = req_line.split("==")[1].strip() + # We need to guard against cases where a package with a long + # name contains the pattern of a shorter package. For + # example "autodoc-pydantic==2.2.0" contains + # "pydantic==2.2.0", which would be a false match. + split_req_line = req_line.split("==") + if split_req_line[0].strip() != clean_package_name: + continue + version = split_req_line[1].strip() if version != old_version: logger.info( "%s: %s --> %s", package_name, old_version, version