Skip to content

Commit

Permalink
Bump minimum supported Python version to 3.6. Closes #6297.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Sep 6, 2020
1 parent bfb8d25 commit 61ecbca
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 38 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/os_comp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@ on:
pull_request:

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:
CI: '1'
XENIAL: '1'

arch:
name: ${{ matrix.cfg.name }}
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.5'
versionSpec: '3.6'
addToPath: true
architecture: 'x64'
- template: ci/azure-steps.yml
Expand Down
6 changes: 6 additions & 0 deletions docs/markdown/snippets/pythonbump.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 2 additions & 13 deletions mesonbuild/mesonmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def run_help_command(self, options):
return 0

def run(self, args):
print_py35_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']
Expand All @@ -125,17 +124,10 @@ def run(self, args):
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, 6):
print_py35_notice = True

try:
return options.run_func(options)
except MesonException as e:
Expand All @@ -152,9 +144,6 @@ def run(self, args):
traceback.print_exc()
return 2
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()

def run_script_command(script_name, script_args):
Expand Down Expand Up @@ -192,8 +181,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, 5):
print('Meson works correctly only with python 3.5+.')
if sys.version_info < (3, 6):
print('Meson works correctly only with python 3.6+.')
print('You have python {}.'.format(sys.version))
print('Please update your environment')
return 1
Expand Down
5 changes: 2 additions & 3 deletions run_project_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ def __exit__(self, _type, value, traceback):
failing_logs = []
print_debug = 'MESON_PRINT_TEST_OUTPUT' 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)
do_debug = under_ci or print_debug
no_meson_log_msg = 'No meson-log.txt found.'
Expand Down Expand Up @@ -828,8 +827,8 @@ def have_java():
return False

def skippable(suite, test):
# Everything is optional when not running on CI, or on Ubuntu 16.04 CI
if not under_ci or under_xenial_ci:
# Everything is optional when not running on CI
if not under_ci:
return True

if not suite.endswith('frameworks'):
Expand Down

0 comments on commit 61ecbca

Please sign in to comment.