Bump minimum supported Python version to 3.6. Closes #6297.

pull/7658/head^2
Jussi Pakkanen 5 years ago
parent 8fbf10c4bc
commit bca90722ec
  1. 20
      .github/workflows/os_comp.yml
  2. 2
      azure-pipelines.yml
  3. 6
      docs/markdown/snippets/pythonbump.md
  4. 15
      mesonbuild/mesonmain.py
  5. 5
      run_project_tests.py

@ -7,26 +7,6 @@ on:
pull_request: pull_request:
jobs: jobs:
xenial:
name: Ubuntu 16.04
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt update -yq
sudo apt install -yq --no-install-recommends python3-setuptools python3-pip g++ gfortran gobjc gobjc++ zlib1g-dev python-dev python3-dev python3-jsonschema
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v1
- name: Python version
run: python3 --version
- name: Ninja version
run: ninja --version
- name: Run tests
run: LD_LIBRARY_PATH=/usr/local/share/boost/1.69.0/lib/:$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH python3 run_tests.py
env:
XENIAL: '1'
arch: arch:
name: ${{ matrix.cfg.name }} name: ${{ matrix.cfg.name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest

@ -36,7 +36,7 @@ jobs:
steps: steps:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: '3.5' versionSpec: '3.6'
addToPath: true addToPath: true
architecture: 'x64' architecture: 'x64'
- template: ci/azure-steps.yml - template: ci/azure-steps.yml

@ -0,0 +1,6 @@
## Minimum required Python version updated to 3.6
Meson now requires at least Python version 3.6 to run as Python 3.5
reaches EOL on September 2020. In practice this should only affect
people developing on Ubuntu Xenial, which will similarly reach EOL in
April 2021.

@ -111,7 +111,6 @@ class CommandLineParser:
return 0 return 0
def run(self, args): def run(self, args):
print_py35_notice = False
# If first arg is not a known command, assume user wants to run the setup # If first arg is not a known command, assume user wants to run the setup
# command. # command.
known_commands = list(self.commands.keys()) + ['-h', '--help'] known_commands = list(self.commands.keys()) + ['-h', '--help']
@ -125,17 +124,10 @@ class CommandLineParser:
args = args[1:] args = args[1:]
else: else:
parser = self.parser parser = self.parser
command = None
args = mesonlib.expand_arguments(args) args = mesonlib.expand_arguments(args)
options = parser.parse_args(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, 6):
print_py35_notice = True
try: try:
return options.run_func(options) return options.run_func(options)
except MesonException as e: except MesonException as e:
@ -152,9 +144,6 @@ class CommandLineParser:
traceback.print_exc() traceback.print_exc()
return 2 return 2
finally: finally:
if print_py35_notice:
mlog.notice('You are using Python 3.5 which is EOL. Starting with v0.57, '
'Meson will require Python 3.6 or newer', fatal=False)
mlog.shutdown() mlog.shutdown()
def run_script_command(script_name, script_args): def run_script_command(script_name, script_args):
@ -192,8 +181,8 @@ def ensure_stdout_accepts_unicode():
sys.stdout.buffer = sys.stdout.raw if hasattr(sys.stdout, 'raw') else sys.stdout sys.stdout.buffer = sys.stdout.raw if hasattr(sys.stdout, 'raw') else sys.stdout
def run(original_args, mainfile): def run(original_args, mainfile):
if sys.version_info < (3, 5): if sys.version_info < (3, 6):
print('Meson works correctly only with python 3.5+.') print('Meson works correctly only with python 3.6+.')
print('You have python {}.'.format(sys.version)) print('You have python {}.'.format(sys.version))
print('Please update your environment') print('Please update your environment')
return 1 return 1

@ -242,7 +242,6 @@ class AutoDeletedDir:
failing_logs = [] failing_logs = []
print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ
under_ci = 'CI' in os.environ under_ci = 'CI' in os.environ
under_xenial_ci = under_ci and ('XENIAL' in os.environ)
skip_scientific = under_ci and ('SKIP_SCIENTIFIC' in os.environ) skip_scientific = under_ci and ('SKIP_SCIENTIFIC' in os.environ)
do_debug = under_ci or print_debug do_debug = under_ci or print_debug
no_meson_log_msg = 'No meson-log.txt found.' no_meson_log_msg = 'No meson-log.txt found.'
@ -828,8 +827,8 @@ def have_java():
return False return False
def skippable(suite, test): def skippable(suite, test):
# Everything is optional when not running on CI, or on Ubuntu 16.04 CI # Everything is optional when not running on CI
if not under_ci or under_xenial_ci: if not under_ci:
return True return True
if not suite.endswith('frameworks'): if not suite.endswith('frameworks'):

Loading…
Cancel
Save