Skip to content

Commit c0e0bce

Browse files
committed
Port requirements to PEP735
1 parent 2c1ec43 commit c0e0bce

File tree

19 files changed

+162
-166
lines changed

19 files changed

+162
-166
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ commands:
103103
- run:
104104
name: Install Python dependencies
105105
command: |
106-
python -m pip install --user -r requirements/dev/build-requirements.txt
106+
python -m pip install --user --group build
107107
python -m pip install --user \
108108
numpy<< parameters.numpy_version >> \
109-
-r requirements/doc/doc-requirements.txt
109+
--group doc
110110
python -m pip install --no-deps --user \
111111
git+https://github.com/matplotlib/mpl-sphinx-theme.git
112112

.github/workflows/cygwin.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
144144
with:
145145
path: C:\cygwin\home\runneradmin\.cache\pip
146-
key: Cygwin-py3.${{ matrix.python-minor-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
146+
key: Cygwin-py3.${{ matrix.python-minor-version }}-pip-${{ hashFiles('pyproject.toml') }}
147147
restore-keys: ${{ matrix.os }}-py3.${{ matrix.python-minor-version }}-pip-
148148

149149
- name: Cache ccache
@@ -174,15 +174,9 @@ jobs:
174174
- name: Install Python dependencies
175175
shell: bash.exe -eo pipefail -o igncr "{0}"
176176
run: |
177-
python -m pip install --upgrade pip setuptools wheel
178-
python -m pip install kiwisolver 'numpy>=1.22,<1.26' pillow importlib_resources
179-
grep -v -F -e psutil requirements/testing/all.txt >requirements_test.txt
180-
python -m pip install meson-python pybind11
177+
python -m pip install --group build 'numpy>=1.25,<1.26'
181178
export PATH="/usr/local/bin:$PATH"
182-
python -m pip install --no-build-isolation 'contourpy>=1.0.1'
183-
python -m pip install --upgrade cycler fonttools \
184-
packaging pyparsing python-dateutil setuptools-scm \
185-
-r requirements_test.txt sphinx ipython
179+
python -m pip install --upgrade --group test sphinx ipython
186180
python -m pip install --upgrade pycairo 'cairocffi>=0.8' PyGObject &&
187181
python -c 'import gi; gi.require_version("Gtk", "3.0"); from gi.repository import Gtk' &&
188182
echo 'PyGObject is available' ||

.github/workflows/reviewdog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
python-version: '3.11'
6666

6767
- name: Install mypy
68-
run: pip3 install -r requirements/testing/mypy.txt -r requirements/testing/all.txt
68+
run: pip3 install --group build --group typing
6969

7070
- name: Set up reviewdog
7171
uses: reviewdog/action-setup@e04ffabe3898a0af8d0fb1af00c188831c4b5893 # v1.3.9

.github/workflows/tests.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ jobs:
5050
- name-suffix: "(Minimum Versions)"
5151
os: ubuntu-22.04
5252
python-version: '3.11'
53-
extra-requirements: '-c requirements/testing/minver.txt'
53+
extra-requirements: '--group test-minver'
5454
delete-font-cache: true
5555
# https://github.com/matplotlib/matplotlib/issues/29844
5656
pygobject-ver: '<3.52.0'
5757
- os: ubuntu-22.04
5858
python-version: '3.11'
5959
CFLAGS: "-fno-lto" # Ensure that disabling LTO works.
60-
extra-requirements: '-r requirements/testing/extra.txt'
60+
extra-requirements: '--group test-extra'
6161
# https://github.com/matplotlib/matplotlib/issues/29844
6262
pygobject-ver: '<3.52.0'
6363
- os: ubuntu-22.04-arm
@@ -183,15 +183,15 @@ jobs:
183183
if: startsWith(runner.os, 'Linux')
184184
with:
185185
path: ~/.cache/pip
186-
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
186+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
187187
restore-keys: |
188188
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
189189
- name: Cache pip
190190
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
191191
if: startsWith(runner.os, 'macOS')
192192
with:
193193
path: ~/Library/Caches/pip
194-
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('requirements/*/*.txt') }}
194+
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
195195
restore-keys: |
196196
${{ matrix.os }}-py${{ matrix.python-version }}-pip-
197197
- name: Cache ccache
@@ -228,12 +228,8 @@ jobs:
228228
229229
# Install dependencies from PyPI.
230230
# Preinstall build requirements to enable no-build-isolation builds.
231-
python -m pip install --upgrade $PRE \
232-
'contourpy>=1.0.1' cycler fonttools kiwisolver importlib_resources \
233-
packaging pillow 'pyparsing!=3.1.0' python-dateutil setuptools-scm \
234-
'meson-python>=0.13.1' 'pybind11>=2.13.2' \
235-
-r requirements/testing/all.txt \
236-
${{ matrix.extra-requirements }}
231+
python -m pip install --upgrade $PRE --prefer-binary \
232+
--group build --group test ${{ matrix.extra-requirements }}
237233
238234
# Install optional dependencies from PyPI.
239235
# Sphinx is needed to run sphinxext tests

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ stages:
7474
7575
- bash: |
7676
python -m pip install --upgrade pip
77-
python -m pip install --upgrade -r requirements/dev/build-requirements.txt
78-
python -m pip install -r requirements/testing/all.txt -r requirements/testing/extra.txt
77+
python -m pip install --upgrade --group build
78+
python -m pip install --prefer-binary --group test --group test-extra
7979
displayName: 'Install dependencies with pip'
8080
8181
- bash: |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pip 25.1 suggested for development
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Dependencies for development (build and testing) are now specified as `Dependency Groups
5+
<https://packaging.python.org/en/latest/specifications/dependency-groups/#dependency-groups>`_
6+
instead of `individual requirements files
7+
<https://pip.pypa.io/en/stable/reference/requirements-file-format/>`_.
8+
9+
Consequently, a version of pip that supports Dependency Groups is suggested, namely
10+
version 25.1 or higher. Note that if you install build/testing dependencies manually (by
11+
copying the list from ``pyproject.toml``), then an older version of pip is sufficient.

doc/devel/development_setup.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ setup.
177177

178178
Install the Python dependencies with ::
179179

180-
pip install -r requirements/dev/dev-requirements.txt
180+
pip install -U pip # You may skip this step if pip 25.1 is already available.
181+
pip install --group dev
181182

182183
Remember to activate the environment whenever you start working on Matplotlib!
183184

@@ -270,7 +271,7 @@ Install Matplotlib in editable mode
270271
Install Matplotlib in editable mode from the :file:`matplotlib` directory using the
271272
command ::
272273

273-
python -m pip install --verbose --no-build-isolation --editable ".[dev]"
274+
python -m pip install --verbose --no-build-isolation --group dev --editable .
274275

275276
The 'editable/develop mode' builds everything and places links in your Python environment
276277
so that Python will be able to import Matplotlib from your development source directory.

doc/devel/release_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ To build the documentation you must have the tagged version installed, but
429429
build the docs from the ``ver-doc`` branch. An easy way to arrange this is::
430430

431431
pip install matplotlib
432-
pip install -r requirements/doc/doc-requirements.txt
432+
pip install --group doc
433433
git checkout v3.7.0-doc
434434
git clean -xfd
435435
make -Cdoc O="-t release -j$(nproc)" html latexpdf LATEXMKOPTS="-silent -f"

doc/install/dependencies.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -396,17 +396,11 @@ Documentation dependencies
396396
Python
397397
------
398398

399-
The additional Python packages required to build the
400-
:ref:`documentation <documenting-matplotlib>` are listed in
401-
:file:`doc-requirements.txt` and can be installed using ::
402-
403-
pip install -r requirements/doc/doc-requirements.txt
404-
405-
The content of :file:`doc-requirements.txt` is also shown below:
406-
407-
.. include:: ../../requirements/doc/doc-requirements.txt
408-
:literal:
399+
The additional Python packages required to build the :ref:`documentation
400+
<documenting-matplotlib>` are listed in :file:`pyproject.toml` and can be
401+
installed using ::
409402

403+
pip install --group doc
410404

411405
.. _doc-dependencies-external:
412406

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# conda env create -f environment.yml
44
# conda activate mpl-dev
5-
# pip install --verbose --no-build-isolation --editable ".[dev]"
5+
# pip install --verbose --no-build-isolation --group dev --editable .
66
#
77
---
88
name: mpl-dev

0 commit comments

Comments
 (0)