aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
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 /mesonbuild/mesonmain.py
parent43c6860a3a129522886cc99ab93df1e23e4cd51f (diff)
downloadmeson-09f03a8424a5ab45bbf251e5edd6341c6503f8e1.zip
meson-09f03a8424a5ab45bbf251e5edd6341c6503f8e1.tar.gz
meson-09f03a8424a5ab45bbf251e5edd6341c6503f8e1.tar.bz2
add pending deprecation notice for python 3.6
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py11
1 files changed, 11 insertions, 0 deletions
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):