Skip to content

Commit 47797c6

Browse files
authored
Bump min python from 3.7 to 3.12 (#6809)
* Bump min python from 3.7 to 3.12 * Remove typing-extensions * Tidy * Address Mypy errors * GH Actions: use new bash-docker image * Remove `types-six` dependency
1 parent ad7b86d commit 47797c6

38 files changed

+112
-256
lines changed

.github/workflows/bash.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,21 @@ jobs:
5151
- '4.2'
5252
# if you use a value like 5.0, YAML will round it to 5, which will cause an error later on
5353
- '5.0'
54+
env:
55+
IMAGE: 'ghcr.io/cylc/cylc-bash-testing-2:master'
5456
steps:
5557
- name: Checkout
5658
uses: actions/checkout@v5
5759

5860
- name: Run Docker container
5961
run: |
60-
docker pull ghcr.io/cylc/cylc-bash-testing:master
61-
docker run --name bash -v $(pwd -P):/root/cylc-flow --rm -t -d -m 1G --memory-swap 1G ghcr.io/cylc/cylc-bash-testing:master /bin/bash
62+
docker pull "$IMAGE"
63+
docker run --name bash -v $(pwd -P):/root/cylc-flow --rm -t -d -m 1G --memory-swap 1G "$IMAGE" /bin/bash
6264
docker ps -a
6365
6466
- name: Install Cylc dependencies in the container
6567
run: |
66-
docker exec bash python3.7 -m pip install six==1.12
67-
docker exec -w /root/cylc-flow bash python3.7 -m pip install .[all]
68+
docker exec -w /root/cylc-flow bash python3.12 -m pip install .[all] --break-system-packages
6869
6970
- name: Set the container bash version
7071
run: docker exec bash update-alternatives --set bash /bash/bash-${{ matrix.bash-version }}

.github/workflows/build.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
os: ['ubuntu-latest', 'macos-latest']
36-
python: ['3.7', '3.8', '3.9', '3.10', '3']
37-
exclude:
38-
- os: 'macos-latest'
39-
python: '3.7'
36+
python: ['3.12', '3']
4037
steps:
4138
- name: Checkout
4239
uses: actions/checkout@v5

.github/workflows/test_conda-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
python-version: ['3.8', '3']
31+
python-version: ['3.12', '3']
3232
env:
3333
ENV_FILE: conda-environment.yml
3434
steps:

.github/workflows/test_fast.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
fail-fast: false # don't stop on first failure
2828
matrix:
2929
os: ['ubuntu-latest']
30-
python-version: ['3.7', '3.8', '3.10', '3.11', '3.12', '3']
30+
python-version: ['3.12', '3']
3131
include:
3232
- os: 'macos-latest'
33-
python-version: '3.8' # oldest version with arm64 builds
33+
python-version: '3.12' # oldest version we support
3434
# non-utc timezone test
3535
- os: 'ubuntu-latest'
36-
python-version: '3.9' # not the oldest, not the most recent version
36+
python-version: '3'
3737
time-zone: 'XXX-09:35'
3838
env:
3939
TZ: ${{ matrix.time-zone }}

.github/workflows/test_functional.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
fail-fast: false
5050
matrix:
5151
os: ['ubuntu-22.04']
52-
python-version: ['3.7']
52+
python-version: ['3.12'] # oldest version we support
5353
test-base: ['tests/f']
5454
chunk: ['1/4', '2/4', '3/4', '4/4']
5555
platform: ['_local_background* _local_at*']
@@ -65,27 +65,27 @@ jobs:
6565
# tests/k
6666
- name: 'flaky'
6767
os: 'ubuntu-latest'
68-
python-version: '3.7'
68+
python-version: '3.12'
6969
test-base: 'tests/k'
7070
chunk: '1/1'
7171
platform: '_local_background* _local_at*'
7272
# remote platforms
7373
- name: '_remote_background_indep_poll'
7474
os: 'ubuntu-latest'
75-
python-version: '3.7'
75+
python-version: '3.12'
7676
test-base: 'tests/f tests/k'
7777
chunk: '1/1'
7878
platform: '_remote_background_indep_poll _remote_at_indep_poll'
7979
- name: '_remote_background_indep_tcp'
8080
os: 'ubuntu-latest'
8181
test-base: 'tests/f tests/k'
82-
python-version: '3.7'
82+
python-version: '3.12'
8383
chunk: '1/1'
8484
platform: '_remote_background_indep_tcp _remote_at_indep_tcp'
8585
# macos
8686
- name: 'macos 1/5'
8787
os: 'macos-latest'
88-
python-version: '3.8' # oldest available
88+
python-version: '3.12' # oldest version we support
8989
test-base: 'tests/f'
9090
chunk: '1/5'
9191
platform: '_local_background*'

.github/workflows/test_tutorial_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- os: 'ubuntu-latest'
3535
python-version: '3'
3636
- os: 'ubuntu-22.04'
37-
python-version: '3.7'
37+
python-version: '3.12'
3838
runs-on: ${{ matrix.os }}
3939
timeout-minutes: 10
4040
steps:

changes.d/6809.break.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dropped support for Python 3.7-3.11. The minimum supported version is now 3.12.

conda-environment.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ channels:
33
- conda-forge
44
dependencies:
55
- ansimarkup >=1.0.0
6-
- async-timeout>=3.0.0 # [py<3.11]
76
- colorama >=0.4,<1.0
87
- graphql-core >=3.2,<3.3
98
- graphene >=3.4.0,<3.5
@@ -17,9 +16,7 @@ dependencies:
1716
- psutil >=5.6.0
1817
- python
1918
- pyzmq >=22
20-
- importlib_metadata >=5.0 # [py<3.12]
2119
- urwid >=2.2,<3,!=2.6.2,!=2.6.3
22-
- tomli >=2 # [py<3.11]
2320

2421
# optional dependencies
2522
#- pandas >=1.0,<2

cylc/flow/__init__.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,7 @@ def environ_init():
5858

5959
def iter_entry_points(entry_point_name):
6060
"""Iterate over Cylc entry points."""
61-
import sys
62-
if sys.version_info[:2] > (3, 11):
63-
from importlib.metadata import entry_points
64-
else:
65-
# BACK COMPAT: importlib_metadata
66-
# importlib.metadata was added in Python 3.8. The required interfaces
67-
# were completed by 3.12. For lower versions we must use the
68-
# importlib_metadata backport.
69-
# FROM: Python 3.7
70-
# TO: Python: 3.12
71-
from importlib_metadata import entry_points
61+
from importlib.metadata import entry_points
7262
yield from (
7363
entry_point
7464
# for entry_point in entry_points()[entry_point_name]

cylc/flow/config.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,21 +2363,18 @@ def load_graph(self):
23632363
def check_terminal_outputs(self, terminals: Iterable[str]) -> None:
23642364
"""Check that task outputs have been registered with tasks.
23652365
2366-
23672366
Where a "terminal output" is an output for a task at the end of a
23682367
graph string, such as "end" in `start => middle => end`.
23692368
23702369
Raises: WorkflowConfigError if a custom output is not defined.
23712370
"""
2372-
# BACK COMPAT: (On drop 3.7): Can be simplified with walrus :=
2373-
# if (b := a[1].strip("?")) not in TASK_QUALIFIERS
2374-
terminal_outputs = [
2375-
(a[0].strip("!"), a[1].strip("?"))
2376-
for a in (t.split(':') for t in terminals if ":" in t)
2377-
if (a[1].strip("?")) not in TASK_QUALIFIERS
2378-
]
2379-
2380-
for task, output in terminal_outputs:
2371+
for t in terminals:
2372+
if ':' not in t:
2373+
continue
2374+
task, output = t.split(':')
2375+
if (output := output.strip('?')) in TASK_QUALIFIERS:
2376+
continue
2377+
task = task.strip('!')
23812378
if output not in self.cfg['runtime'][task]['outputs']:
23822379
raise WorkflowConfigError(
23832380
f"Undefined custom output: {task}:{output}"

0 commit comments

Comments
 (0)