aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-01-09 14:29:54 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2022-01-10 01:36:46 +0200
commit09f03a8424a5ab45bbf251e5edd6341c6503f8e1 (patch)
treebbacd5799f55dbfd0976cc1eb3bec0f2df5c072e
parent43c6860a3a129522886cc99ab93df1e23e4cd51f (diff)
downloadmeson-09f03a8424a5ab45bbf251e5edd6341c6503f8e1.zip
meson-09f03a8424a5ab45bbf251e5edd6341c6503f8e1.tar.gz
meson-09f03a8424a5ab45bbf251e5edd6341c6503f8e1.tar.bz2
add pending deprecation notice for python 3.6
-rw-r--r--docs/markdown/snippets/about_minimum_python_version.md13
-rw-r--r--mesonbuild/mesonmain.py11
2 files changed, 24 insertions, 0 deletions
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..7f7fb0d
--- /dev/null
+++ b/docs/markdown/snippets/about_minimum_python_version.md
@@ -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.
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 06f589b..ecf1f7a 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -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):