Skip to content

Commit 8830387

Browse files
committed
Update CI for Meson build
1 parent 0c0a9d3 commit 8830387

File tree

10 files changed

+45
-53
lines changed

10 files changed

+45
-53
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ install:
7070
test_script:
7171
# Now build the thing..
7272
- set LINK=/LIBPATH:%cd%\lib
73-
- pip install -ve .
73+
- pip install -v --no-build-isolation --config-settings=setup-args="--vsenv" --editable .[dev]
7474
# this should show no freetype dll...
7575
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
7676
- '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0'

.circleci/config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ commands:
5555
graphviz \
5656
inkscape \
5757
lmodern \
58+
ninja-build \
5859
optipng \
5960
texlive-fonts-recommended \
6061
texlive-latex-base \
@@ -97,6 +98,7 @@ commands:
9798
- run:
9899
name: Install Python dependencies
99100
command: |
101+
python -m pip install --user meson-python pybind11
100102
python -m pip install --user \
101103
numpy<< parameters.numpy_version >> \
102104
-r requirements/doc/doc-requirements.txt
@@ -114,7 +116,8 @@ commands:
114116
version=${version#v}
115117
python -m pip install matplotlib==${version}
116118
else
117-
python -m pip install --user -ve .
119+
python -m pip install --user --verbose \
120+
--no-build-isolation --editable .[dev]
118121
fi
119122
- save_cache:
120123
key: build-deps-2
@@ -215,8 +218,8 @@ jobs:
215218
- fonts-install
216219
- pip-install
217220

218-
- mpl-install
219221
- doc-deps-install
222+
- mpl-install
220223

221224
- doc-build
222225
- doc-show-errors-warnings

.github/workflows/cibuildwheel.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,17 @@ jobs:
9191
runs-on: ${{ matrix.os }}
9292
env:
9393
CIBW_BEFORE_BUILD: >-
94-
pip install certifi numpy>=1.25 &&
94+
pip install numpy>=1.25 &&
9595
rm -rf {package}/build
9696
CIBW_BEFORE_BUILD_WINDOWS: >-
97-
pip install certifi delvewheel numpy>=1.25 &&
97+
pip install delvewheel numpy>=1.25 &&
9898
rm -rf {package}/build
9999
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
100100
delvewheel repair -w {dest_dir} {wheel}
101101
CIBW_AFTER_BUILD: >-
102102
twine check {wheel} &&
103103
python {package}/ci/check_wheel_licenses.py {wheel}
104+
CIBW_CONFIG_SETTINGS: setup-args="--vsenv"
104105
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
105106
CIBW_SKIP: "*-musllinux_aarch64"
106107
CIBW_TEST_COMMAND: >-
@@ -144,11 +145,11 @@ jobs:
144145
CIBW_ARCHS: ${{ matrix.cibw_archs }}
145146
# Remove this once NumPy with Python 3.12 wheels is not pre-release.
146147
CIBW_BEFORE_BUILD: >-
147-
pip install certifi "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" &&
148+
pip install "meson-python>=0.13.1" ninja "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" &&
148149
pip install --pre "numpy>=1.25" &&
149150
rm -rf {package}/build
150151
CIBW_BEFORE_BUILD_WINDOWS: >-
151-
pip install certifi delvewheel "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" &&
152+
pip install delvewheel "meson-python>=0.13.1" ninja "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" &&
152153
pip install --pre "numpy>=1.25" &&
153154
rm -rf {package}/build
154155
CIBW_ENVIRONMENT: PIP_NO_BUILD_ISOLATION=0

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
# dependencies so we don't need another copy here.
4242
# https://github.com/jazzband/pip-tools/pull/1681
4343
python -m pip install --upgrade \
44-
certifi contourpy cycler fonttools kiwisolver importlib_resources \
45-
numpy packaging pillow pyparsing python-dateutil setuptools-scm \
46-
pybind11
44+
build contourpy cycler fonttools kiwisolver \
45+
importlib_resources meson-python numpy packaging pillow pybind11 \
46+
pyparsing python-dateutil setuptools-scm
4747
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
4848
4949
- name: Initialize CodeQL
@@ -56,7 +56,7 @@ jobs:
5656
if: matrix.language == 'cpp'
5757
run: |
5858
mkdir ~/.cache/matplotlib
59-
$CODEQL_PYTHON setup.py build
59+
$CODEQL_PYTHON -m build
6060
6161
- name: Perform CodeQL Analysis
6262
uses: github/codeql-action/analyze@v2

.github/workflows/cygwin.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,14 @@ jobs:
203203
AUTOCONF: /usr/bin/autoconf-2.69
204204
MAKEFLAGS: dw
205205
run: |
206+
export PATH="/usr/local/bin:$PATH"
206207
ccache -s
207208
git describe
208-
cat <<EOT >> mplsetup.cfg
209-
[rc_options]
210-
backend=Agg
211-
212-
[libs]
213-
system_freetype = False
214-
system_qhull = True
215-
EOT
216-
cat mplsetup.cfg
217209
# All dependencies must have been pre-installed, so that the minver
218210
# constraints are held.
219-
python -m pip install --no-deps -ve .
211+
python -m pip install --no-deps --no-build-isolation --verbose \
212+
--config-settings=setup-args="-DrcParams-backend=Agg" \
213+
--editable .[dev]
220214
221215
- name: Find DLLs to rebase
222216
shell: bash.exe -eo pipefail -o igncr "{0}"

.github/workflows/mypy-stubtest.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
pip3 install -r requirements/testing/mypy.txt \
2424
-r requirements/testing/all.txt
25-
pip3 install -e .
25+
pip3 install .
2626
2727
- name: Set up reviewdog
2828
run: |
@@ -38,6 +38,7 @@ jobs:
3838
run: |
3939
set -o pipefail
4040
MPLBACKEND=agg python tools/stubtest.py | \
41+
sed -e "s!$pythonLocation/lib/python3.9/site-packages!lib!g" | \
4142
reviewdog \
4243
-efm '%Eerror: %m' \
4344
-efm '%CStub: in file %f:%l' \

.github/workflows/tests.yml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ jobs:
5656
pyside2-ver: '==5.15.1' # oldest version with working Py3.9 wheel.
5757
pyside6-ver: '==6.0.0'
5858
delete-font-cache: true
59-
no-build-isolation: true
6059
- os: ubuntu-20.04
6160
python-version: 3.9
6261
extra-requirements: '-r requirements/testing/extra.txt'
@@ -81,7 +80,6 @@ jobs:
8180
python-version: '3.12-dev'
8281
pyside6-ver: '!=6.5.1'
8382
pre: true
84-
no-build-isolation: true
8583
- os: macos-latest
8684
python-version: 3.9
8785
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-2346
@@ -131,6 +129,7 @@ jobs:
131129
libxcb-render-util0 \
132130
libxcb-xinerama0 \
133131
lmodern \
132+
ninja-build \
134133
pkg-config \
135134
qtbase5-dev \
136135
texlive-fonts-recommended \
@@ -150,7 +149,7 @@ jobs:
150149
macOS)
151150
brew install ccache
152151
brew tap homebrew/cask-fonts
153-
brew install font-noto-sans-cjk gobject-introspection gtk4
152+
brew install font-noto-sans-cjk gobject-introspection gtk4 ninja
154153
;;
155154
esac
156155
@@ -205,17 +204,14 @@ jobs:
205204
fi
206205
207206
# Install dependencies from PyPI.
207+
# Preinstall build requirements to enable no-build-isolation builds.
208208
python -m pip install --upgrade $PRE \
209209
'contourpy>=1.0.1' cycler fonttools kiwisolver importlib_resources \
210210
numpy packaging pillow 'pyparsing!=3.1.0' python-dateutil setuptools-scm \
211+
'meson-python>=0.13.1' 'pybind11>=2.6' \
211212
-r requirements/testing/all.txt \
212213
${{ matrix.extra-requirements }}
213214
214-
# Preinstall pybind11 on no-build-isolation builds.
215-
if [[ "${{ matrix.no-build-isolation }}" == 'true' ]]; then
216-
python -m pip install 'pybind11>=2.6'
217-
fi
218-
219215
# Install optional dependencies from PyPI.
220216
# Sphinx is needed to run sphinxext tests
221217
python -m pip install --upgrade sphinx!=6.1.2
@@ -300,20 +296,9 @@ jobs:
300296
fi
301297
fi
302298
303-
cat <<EOT >> mplsetup.cfg
304-
[rc_options]
305-
backend=Agg
306-
EOT
307-
308-
cat mplsetup.cfg
309-
310-
if [[ "${{ matrix.no-build-isolation }}" == 'true' ]]; then
311-
# Minimum versions run does not use build isolation so that it
312-
# builds against the pre-installed minver dependencies.
313-
python -m pip install --no-deps --no-build-isolation -ve .
314-
else
315-
python -m pip install --no-deps -ve .
316-
fi
299+
python -m pip install --no-deps --no-build-isolation --verbose \
300+
--config-settings=setup-args="-DrcParams-backend=Agg" \
301+
--editable .[dev]
317302
318303
if [[ "${{ runner.os }}" != 'macOS' ]]; then
319304
unset CPPFLAGS

azure-pipelines.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ stages:
9696
cm-super \
9797
dvipng \
9898
ffmpeg \
99+
fonts-freefont-otf \
99100
fonts-noto-cjk \
100101
fonts-wqy-zenhei \
101102
gdb \
@@ -105,23 +106,24 @@ stages:
105106
libcairo2 \
106107
libgirepository-1.0-1 \
107108
lmodern \
108-
fonts-freefont-otf \
109+
ninja-build \
109110
poppler-utils \
110-
texlive-pictures \
111111
texlive-fonts-recommended \
112112
texlive-latex-base \
113113
texlive-latex-extra \
114114
texlive-latex-recommended \
115115
texlive-luatex \
116+
texlive-pictures \
116117
texlive-xetex
117118
;;
118119
darwin)
119120
brew install --cask xquartz
120-
brew install pkg-config ffmpeg imagemagick mplayer ccache
121+
brew install ccache ffmpeg imagemagick mplayer ninja pkg-config
121122
brew tap homebrew/cask-fonts
122123
brew install font-noto-sans-cjk-sc
123124
;;
124125
win32)
126+
choco install ninja
125127
;;
126128
*)
127129
exit 1
@@ -131,12 +133,15 @@ stages:
131133
132134
- bash: |
133135
python -m pip install --upgrade pip
136+
python -m pip install --upgrade meson-python pybind11
134137
python -m pip install -r requirements/testing/all.txt -r requirements/testing/extra.txt ||
135138
[[ "$PYTHON_VERSION" = 'Pre' ]]
136139
displayName: 'Install dependencies with pip'
137140
138141
- bash: |
139-
python -m pip install -ve . ||
142+
python -m pip install \
143+
--no-build-isolation --config-settings=setup-args="--vsenv" \
144+
--verbose --editable .[dev] ||
140145
[[ "$PYTHON_VERSION" = 'Pre' ]]
141146
displayName: "Install self"
142147

environment.yml

Lines changed: 3 additions & 2 deletions
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 -e .
5+
# pip install -e .[dev]
66
#
77
name: mpl-dev
88
channels:
@@ -15,14 +15,15 @@ dependencies:
1515
- fonttools>=4.22.0
1616
- importlib-resources>=3.2.0
1717
- kiwisolver>=1.3.1
18+
- meson-python>=0.13.1
1819
- numpy>=1.21
1920
- pillow>=8
21+
- pkg-config
2022
- pybind11>=2.6.0
2123
- pygobject
2224
- pyparsing>=2.3.1
2325
- pyqt
2426
- python-dateutil>=2.1
25-
- setuptools
2627
- setuptools_scm
2728
- wxpython
2829
# building documentation

requirements/testing/minver.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
contourpy==1.0.1
44
cycler==0.10
5-
kiwisolver==1.3.1
5+
fonttools==4.22.0
66
importlib-resources==3.2.0
7+
kiwisolver==1.3.1
8+
meson-python==0.13.1
9+
meson==1.1.0
710
numpy==1.21.0
811
packaging==20.0
912
pillow==8.0.0
1013
pyparsing==2.3.1
11-
python-dateutil==2.7
12-
fonttools==4.22.0
1314
pytest==7.0.0
15+
python-dateutil==2.7

0 commit comments

Comments
 (0)