From ad525dcce45487def9d3950bed159f1c158e3581 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 31 Oct 2021 19:05:46 -0400 Subject: bump minimum required version of python to 3.7 Comment out the pending deprecation notice. It cannot be reached anymore, but is still useful for the next time we do a version bump. --- README.md | 2 +- azure-pipelines.yml | 2 +- ci/run.ps1 | 2 +- docs/markdown/Getting-meson.md | 4 ++-- docs/markdown/Getting-meson_ptbr.md | 4 ++-- docs/markdown/snippets/about_minimum_python_version.md | 7 +++++++ mesonbuild/mesonmain.py | 7 +++++-- setup.cfg | 3 +-- setup.py | 4 ++-- 9 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 docs/markdown/snippets/about_minimum_python_version.md diff --git a/README.md b/README.md index aac22b0..342830f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ build system. #### Dependencies - - [Python](https://python.org) (version 3.6 or newer) + - [Python](https://python.org) (version 3.7 or newer) - [Ninja](https://ninja-build.org) (version 1.8.2 or newer) #### Installing from source diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2696fc1..2bdc65a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -62,7 +62,7 @@ jobs: steps: - task: UsePythonVersion@0 inputs: - versionSpec: '3.6' + versionSpec: '3.7' addToPath: true architecture: 'x64' - task: PowerShell@2 diff --git a/ci/run.ps1 b/ci/run.ps1 index 33a01fe..ddbf3d1 100644 --- a/ci/run.ps1 +++ b/ci/run.ps1 @@ -20,7 +20,7 @@ if ($env:arch -eq 'x64') { # Rust puts its shared stdlib in a secret place, but it is needed to run tests. $env:Path += ";$HOME/.rustup/toolchains/stable-i686-pc-windows-msvc/bin" # Need 32-bit Python for tests that need the Python dependency - $env:Path = "C:\hostedtoolcache\windows\Python\3.6.8\x86;C:\hostedtoolcache\windows\Python\3.6.8\x86\Scripts;$env:Path" + $env:Path = "C:\hostedtoolcache\windows\Python\3.7.9\x86;C:\hostedtoolcache\windows\Python\3.7.9\x86\Scripts;$env:Path" } # Set the CI env var for the meson test framework diff --git a/docs/markdown/Getting-meson.md b/docs/markdown/Getting-meson.md index ec6f1c6..c3c3cc8 100644 --- a/docs/markdown/Getting-meson.md +++ b/docs/markdown/Getting-meson.md @@ -1,6 +1,6 @@ # Getting Meson -Meson is implemented in Python 3, and requires 3.6 or newer. If your +Meson is implemented in Python 3, and requires 3.7 or newer. If your operating system provides a package manager, you should install it with that. For platforms that don't have a package manager, you need to download it from [Python's home page]. See below for @@ -14,7 +14,7 @@ itself without doing anything special. On Windows, if you did not install Python with the installer options that make Python scripts executable, you will have to run `python -/path/to/meson.py`, where `python` is Python 3.6 or newer. +/path/to/meson.py`, where `python` is Python 3.7 or newer. The newest development code can be obtained directly from [Git], and we strive to ensure that it will always be working and usable. All diff --git a/docs/markdown/Getting-meson_ptbr.md b/docs/markdown/Getting-meson_ptbr.md index b5af345..f4f3ac1 100644 --- a/docs/markdown/Getting-meson_ptbr.md +++ b/docs/markdown/Getting-meson_ptbr.md @@ -1,6 +1,6 @@ # Obtendo o Meson -Meson é implementado em Python 3, e requer a versão 3.6 ou mais nova. +Meson é implementado em Python 3, e requer a versão 3.7 ou mais nova. se o seu sistema operacional provê um gerenciador de pacotes, você deve instalar o Meson com ele. Para plataformas que não tem um gerenciador de pacotes, você precisa baixa-lo da [página inicial do Python]. Veja abaixo @@ -14,7 +14,7 @@ do git sem fazer nada de especial. No Windows, se você não instalar o Python com a opção do instalador que fazem os *scripts* Python executáveis, você vai ter que executar `python -/path/to/meson.py`, onde `python` é o Python 3.6 ou mais novo. +/path/to/meson.py`, onde `python` é o Python 3.7 ou mais novo. O código de desenvolvimento mais recente pode ser obtido diretamente do [Git], e nós lutamos para garatir que ele vai estar sempre funcionando e usável. Todos diff --git a/docs/markdown/snippets/about_minimum_python_version.md b/docs/markdown/snippets/about_minimum_python_version.md new file mode 100644 index 0000000..fa44a75 --- /dev/null +++ b/docs/markdown/snippets/about_minimum_python_version.md @@ -0,0 +1,7 @@ +## Minimum required Python version updated to 3.7 + +Meson now requires at least Python version 3.7 to run as Python 3.6 reached EOL +on December 2021. In practice this should only affect people developing on +Ubuntu Bionic, who will need to manually install python3.8 from the official +repositories. + diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index ecf1f7a..4d873e5 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -139,6 +139,9 @@ class CommandLineParser: if command is None: command = options.command + # Bump the version here in order to add a pre-exit warning that we are phasing out + # support for old python. If this is already the oldest supported version, then + # this can never be true and does nothing. if command in ('setup', 'compile', 'test', 'install') and sys.version_info < (3, 7): pending_python_deprecation_notice = True @@ -204,8 +207,8 @@ def ensure_stdout_accepts_unicode(): sys.stdout.buffer = sys.stdout.raw if hasattr(sys.stdout, 'raw') else sys.stdout def run(original_args, mainfile): - if sys.version_info < (3, 6): - print('Meson works correctly only with python 3.6+.') + if sys.version_info < (3, 7): + print('Meson works correctly only with python 3.7+.') print(f'You have python {sys.version}.') print('Please update your environment') return 1 diff --git a/setup.cfg b/setup.cfg index c8c52ba..cd188c0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,6 @@ classifiers = Operating System :: POSIX :: BSD Operating System :: POSIX :: Linux Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -32,7 +31,7 @@ long_description = Meson is a cross-platform build system designed to be both as [options] packages = find: -python_requires = >= 3.6 +python_requires = >= 3.7 setup_requires = setuptools diff --git a/setup.py b/setup.py index 976afb2..7ff28e2 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,9 @@ import sys -if sys.version_info < (3, 6): +if sys.version_info < (3, 7): raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}' - '\nMeson requires Python 3.6.0 or greater'.format(sys.version)) + '\nMeson requires Python 3.7.0 or greater'.format(sys.version)) from setuptools import setup -- cgit v1.1