Skip to content

Commit

Permalink
bump minimum required version of python to 3.7
Browse files Browse the repository at this point in the history
Comment out the pending deprecation notice. It cannot be reached
anymore, but is still useful for the next time we do a version bump.
  • Loading branch information
eli-schwartz committed Jan 10, 2022
1 parent 0c30db2 commit ad525dc
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
versionSpec: '3.7'
addToPath: true
architecture: 'x64'
- task: PowerShell@2
Expand Down
2 changes: 1 addition & 1 deletion ci/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/markdown/Getting-meson.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/markdown/Getting-meson_ptbr.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/markdown/snippets/about_minimum_python_version.md
Original file line number Diff line number Diff line change
@@ -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.

7 changes: 5 additions & 2 deletions mesonbuild/mesonmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def run(self, args):
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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ad525dc

Please sign in to comment.