From f5ea78ce9b40ccc4a316527b225c759587622705 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:44:23 +0100 Subject: [PATCH] Bump minimum supported Python version to 3.12 --- .github/workflows/build.yml | 3 ++- .github/workflows/test.yml | 4 ++-- changes.d/729.break.md | 1 + cylc/uiserver/jupyter_config.py | 9 +-------- mypy.ini | 2 +- pyproject.toml | 4 ++-- setup.cfg | 8 +------- 7 files changed, 10 insertions(+), 21 deletions(-) create mode 100644 changes.d/729.break.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b4c930d..651ffd94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'macos-latest'] - python: ['3.9', '3'] # oldest/newest supported versions + python: ['3.12', '3'] # oldest/newest supported versions steps: - name: Checkout uses: actions/checkout@v5 @@ -54,6 +54,7 @@ jobs: - name: Inspect run: | unzip -l dist/*.whl | tee files + set -x grep -E 'cylc_uiserver.*.dist-info/.*COPYING' files grep 'cylc/uiserver/py.typed' files grep 'cylc/uiserver/ui' files diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10feff1f..da26c217 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,10 +27,10 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest'] - python-version: ['3.9', '3'] + python-version: ['3.12', '3'] include: - os: 'macos-latest' - python-version: '3.9' # oldest supported + python-version: '3.12' # oldest supported env: PYTEST_ADDOPTS: --cov --color=yes diff --git a/changes.d/729.break.md b/changes.d/729.break.md new file mode 100644 index 00000000..81004927 --- /dev/null +++ b/changes.d/729.break.md @@ -0,0 +1 @@ +Minimum supported Python version is now 3.12. diff --git a/cylc/uiserver/jupyter_config.py b/cylc/uiserver/jupyter_config.py index 2db21343..afde2cb0 100644 --- a/cylc/uiserver/jupyter_config.py +++ b/cylc/uiserver/jupyter_config.py @@ -15,15 +15,8 @@ # Configuration file for jupyterhub. +from importlib.resources import files from pathlib import Path -import sys - - -if sys.version_info[:2] > (3, 8): - from importlib.resources import files -else: - # BACK_COMPAT: importlib_resources - from importlib_resources import files from cylc.uiserver import ( __file__ as uis_pkg, diff --git a/mypy.ini b/mypy.ini index 96059f54..75f3dff3 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.9 +python_version = 3.12 ignore_missing_imports = True files = cylc/uiserver # don't run mypy on these files directly diff --git a/pyproject.toml b/pyproject.toml index 3eaf2766..54e659b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ verbosity_assertions = 2 [tool.ruff] line-length = 79 -target-version = "py37" +target-version = "py312" [tool.ruff.format] quote-style = "preserve" @@ -71,7 +71,7 @@ quote-style = "preserve" [tool.black] line-length = 79 -target-version = ['py37'] +target-version = ['py312'] skip-string-normalization = true diff --git a/setup.cfg b/setup.cfg index 755db55d..669ace2d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,17 +33,12 @@ classifiers = License :: OSI Approved :: GNU General Public License v3 (GPLv3) Operating System :: POSIX Programming Language :: Python - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 Programming Language :: Python :: 3 :: Only Programming Language :: Python :: Implementation :: CPython [options] packages = find_namespace: -python_requires = >=3.9 +python_requires = >=3.12 include_package_data = True install_requires = # NB: We have cylc-flow at the top to force it to install its transitive @@ -52,7 +47,6 @@ install_requires = # bleeding-edge version. cylc-flow==8.6.* ansimarkup>=1.0.0 - importlib-resources>=1.3.0; python_version < "3.9" jupyter_server>=2.13.0 requests packaging