Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
"CI: Run cibuildwheel":
- changed-files:
- any-glob-to-any-file: ['.github/workflows/cibuildwheel.yml']
- any-glob-to-any-file:
- '.github/workflows/cibuildwheel.yml'
- 'pyproject.toml'
"CI: Run cygwin":
- changed-files:
- any-glob-to-any-file: ['.github/workflows/cygwin.yml']
Expand Down
37 changes: 1 addition & 36 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ jobs:
with:
python-version: '3.11'

# Something changed somewhere that prevents the downloaded-at-build-time
# licenses from being included in built wheels, so pre-download them so
# that they exist before the build and are included.
- name: Pre-download bundled licenses
run: >
curl -Lo LICENSE/LICENSE_QHULL
https://github.com/qhull/qhull/raw/2020.2/COPYING.txt

- name: Install dependencies
run: python -m pip install build twine

Expand Down Expand Up @@ -94,31 +86,6 @@ jobs:
needs: build_sdist
name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
env:
CIBW_BEFORE_BUILD: >-
rm -rf {package}/build
CIBW_BEFORE_BUILD_WINDOWS: >-
pip install delvewheel &&
rm -rf {package}/build
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >-
delvewheel repair -w {dest_dir} {wheel}
CIBW_AFTER_BUILD: >-
twine check {wheel} &&
python {package}/ci/check_wheel_licenses.py {wheel}
# On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
# MinGW on PATH that would be picked otherwise), switch to a static build for
# runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
# and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
# keeping shared state with the rest of the Python process/extensions.
CIBW_CONFIG_SETTINGS_WINDOWS: >-
setup-args="--vsenv"
setup-args="-Db_vscrt=mt"
setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_SKIP: "*-musllinux_aarch64"
CIBW_TEST_COMMAND: >-
python {package}/ci/check_version_number.py
MACOSX_DEPLOYMENT_TARGET: "10.12"
strategy:
matrix:
include:
Expand Down Expand Up @@ -148,17 +115,15 @@ jobs:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp314-* cp314t-*"
CIBW_ENABLE: "cpython-freethreading cpython-prerelease"
CIBW_ENABLE: "cpython-prerelease"
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28

- name: Build wheels for CPython 3.13
uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
with:
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }}
env:
CIBW_BUILD: "cp313-* cp313t-*"
CIBW_ENABLE: cpython-freethreading
CIBW_ARCHS: ${{ matrix.cibw_archs }}

- name: Build wheels for CPython 3.12
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ jobs:
python -m pip install --upgrade $PRE \
'contourpy>=1.0.1' cycler fonttools kiwisolver importlib_resources \
packaging pillow 'pyparsing!=3.1.0' python-dateutil setuptools-scm \
'meson-python>=0.13.1' 'pybind11>=2.13.2' \
'meson-python>=0.18.0' 'pybind11>=2.13.2' \
-r requirements/testing/all.txt \
${{ matrix.extra-requirements }}

Expand Down
2 changes: 1 addition & 1 deletion ci/check_wheel_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
with zipfile.ZipFile(wheel) as f:
wheel_license_file_names = {Path(path).name
for path in sorted(f.namelist())
if '.dist-info/LICENSE' in path}
if '.dist-info/licenses/LICENSE' in path}
if not (len(wheel_license_file_names) and
wheel_license_file_names.issuperset(license_file_names)):
sys.exit(f'LICENSE file(s) missing:\n'
Expand Down
5 changes: 3 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ project(
'-m', 'setuptools_scm', check: true).stdout().strip(),
# qt_editor backend is MIT
# ResizeObserver at end of lib/matplotlib/backends/web_backend/js/mpl.js is CC0
# Carlogo, STIX and Computer Modern is OFL
# Carlogo, STIX, Computer Modern and Last Resort are OFL
# DejaVu is Bitstream Vera and Public Domain
license: 'PSF-2.0 AND MIT AND CC0-1.0 AND OFL-1.1 AND Bitstream-Vera AND Public-Domain',
license: 'PSF-2.0 AND MIT AND CC0-1.0 AND OFL-1.1 AND Bitstream-Vera AND LicenseRef-Public-Domain',
license_files: [
'LICENSE/LICENSE',
'LICENSE/LICENSE_AMSFONTS',
Expand All @@ -18,6 +18,7 @@ project(
'LICENSE/LICENSE_COLORBREWER',
'LICENSE/LICENSE_COURIERTEN',
'LICENSE/LICENSE_JSXTOOLS_RESIZE_OBSERVER',
'LICENSE/LICENSE_LAST_RESORT_FONT',
'LICENSE/LICENSE_QT4_EDITOR',
'LICENSE/LICENSE_SOLARIZED',
'LICENSE/LICENSE_STIX',
Expand Down
50 changes: 42 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ authors = [
]
description = "Python plotting package"
readme = "README.md"
license = { file = "LICENSE/LICENSE" }
dynamic = ["version"]
dynamic = ["version", "license", "license-files"]
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Matplotlib",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
"License :: OSI Approved :: Python Software Foundation License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -46,10 +44,10 @@ requires-python = ">=3.11"
[project.optional-dependencies]
# Should be a copy of the build dependencies below.
dev = [
"meson-python>=0.13.1,!=0.17.*",
"meson-python>=0.18.0",
"pybind11>=2.13.2,!=2.13.3",
"setuptools_scm>=7",
# Not required by us but setuptools_scm without a version, cso _if_
# Not required by us but setuptools_scm without a version, so _if_
# installed, then setuptools_scm 8 requires at least this version.
# Unfortunately, we can't do a sort of minimum-if-installed dependency, so
# we need to keep this for now until setuptools_scm _fully_ drops
Expand All @@ -70,9 +68,7 @@ dev = [
build-backend = "mesonpy"
# Also keep in sync with optional dependencies above.
requires = [
# meson-python 0.17.x breaks symlinks in sdists. You can remove this pin if
# you really need it and aren't using an sdist.
"meson-python>=0.13.1,!=0.17.*",
"meson-python>=0.18.0",
"pybind11>=2.13.2,!=2.13.3",
"setuptools_scm>=7",
]
Expand All @@ -86,6 +82,44 @@ local_scheme = "node-and-date"
parentdir_prefix_version = "matplotlib-"
fallback_version = "0.0+UNKNOWN"

[tool.cibuildwheel]
enable = ["cpython-freethreading"]
skip = "*-musllinux_aarch64"
manylinux-x86_64-image = "manylinux2014"

before-build = "rm -rf {package}/build"
test-command = [
"python {package}/ci/check_wheel_licenses.py {wheel}",
"python {package}/ci/check_version_number.py",
]
test-environment = "PIP_PREFER_BINARY=true"

[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.12"

[tool.cibuildwheel.windows]
before-build = [
"pip install delvewheel",
"rm -rf {package}/build",
]
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"

[tool.cibuildwheel.windows.config-settings]
# On Windows, we explicitly request MSVC compilers (as GitHub Action runners have
# MinGW on PATH that would be picked otherwise), switch to a static build for
# runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`,
# and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while
# keeping shared state with the rest of the Python process/extensions.
setup-args = [
"--vsenv",
"-Db_vscrt=mt",
"-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']",
]

[[tool.cibuildwheel.overrides]]
select = "cp314*"
manylinux-x86_64-image = "manylinux_2_28"

[tool.isort]
known_pydata = "numpy, matplotlib.pyplot"
known_firstparty = "matplotlib,mpl_toolkits"
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev/build-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pybind11>=2.13.2,!=2.13.3
meson-python
meson-python>=0.18.0
setuptools-scm
2 changes: 1 addition & 1 deletion requirements/testing/minver.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cycler==0.10
fonttools==4.22.0
importlib-resources==3.2.0
kiwisolver==1.3.2
meson-python==0.13.1
meson-python==0.18.0
meson==1.1.0
numpy==1.25.0
packaging==20.0
Expand Down
Loading