add pending deprecation notice for python 3.6

pull/9799/head
Eli Schwartz 3 years ago committed by Jussi Pakkanen
parent 43c6860a3a
commit 09f03a8424
  1. 13
      docs/markdown/snippets/about_minimum_python_version.md
  2. 11
      mesonbuild/mesonmain.py

@ -0,0 +1,13 @@
## Python 3.6 support will be dropped in the next release
The final [Python 3.6 release was 3.6.15 in September](https://www.python.org/dev/peps/pep-0494/#lifespan).
This release series is now End-of-Life (EOL). The only LTS distribution that
still ships Python 3.5 as the default Python is Ubuntu 18.04, which has Python
3.8 available as well.
Python 3.7 has various features that we find useful such as future annotations,
the importlib.resources module, and dataclasses.
As a result, we will begin requiring Python 3.7 or newer in Meson 0.62, which
is the next release. Starting with Meson 0.61, we now print a `NOTICE:` when
a `meson` command is run on Python 3.6 to inform users about this.

@ -117,6 +117,7 @@ class CommandLineParser:
return 0
def run(self, args):
pending_python_deprecation_notice = False
# If first arg is not a known command, assume user wants to run the setup
# command.
known_commands = list(self.commands.keys()) + ['-h', '--help']
@ -130,10 +131,17 @@ class CommandLineParser:
args = args[1:]
else:
parser = self.parser
command = None
args = mesonlib.expand_arguments(args)
options = parser.parse_args(args)
if command is None:
command = options.command
if command in ('setup', 'compile', 'test', 'install') and sys.version_info < (3, 7):
pending_python_deprecation_notice = True
try:
return options.run_func(options)
except MesonException as e:
@ -156,6 +164,9 @@ class CommandLineParser:
mlog.exception(e)
return 2
finally:
if pending_python_deprecation_notice:
mlog.notice('You are using Python 3.6 which is EOL. Starting with v0.62.0, '
'Meson will require Python 3.7 or newer', fatal=False)
mlog.shutdown()
def run_script_command(script_name, script_args):

Loading…
Cancel
Save