From 05d104e8136a9418874ba6497482bfd5db2ef22b Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 2 May 2025 08:35:03 +0200 Subject: [PATCH] Backport PR #29997: BLD: Ensure meson.build has the right version of Python (cherry picked from commit 440eb61accb18de4a2270b44831d646a09a8e196) --- meson.build | 5 ++++- pyproject.toml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a50f0b8f743a..34b4de13addf 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,10 @@ project( 'matplotlib', 'c', 'cpp', - version: run_command(find_program('python3'), '-m', 'setuptools_scm', check: true).stdout().strip(), + version: run_command( + # Also keep version in sync with pyproject.toml. + find_program('python3', 'python', version: '>= 3.10'), + '-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 diff --git a/pyproject.toml b/pyproject.toml index 832d76308e0b..e6d1abaf530b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ dependencies = [ "pyparsing >= 2.3.1", "python-dateutil >= 2.7", ] +# Also keep in sync with find_program of meson.build. requires-python = ">=3.10" [project.optional-dependencies]