Skip to content

Commit e080610

Browse files
author
Release Manager
committed
gh-39251: Require Python 3.11 or newer; remove outdated workarounds <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> In line with Spec 0, we remove support for Python 3.9 and 3.10. Many outdated patches/workarounds for these older (or even older) Python versions are removed, but I cannot guarantee that I've found all obsolete ones. Nothing in sage-the-distro is touched. For next years cleaning job: - Search for `3.11`, `311`, `PY_VERSION`, `PY_MINOR_VERSION` and `sys.version_info` - Change version in `pyproject.toml` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #39251 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
2 parents ac8406f + 1884ebc commit e080610

27 files changed

+48
-506
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
platform:
1616
description: 'Platform'
1717
required: true
18-
default: 'ubuntu-jammy-standard'
18+
default: 'ubuntu-noble-standard'
1919
docker_tag:
2020
description: 'Docker tag'
2121
required: true
@@ -68,8 +68,8 @@ concurrency:
6868

6969
env:
7070
# Adapted from docker.yml
71-
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-incremental"
72-
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-with-targets:ci"
71+
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-incremental"
72+
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-with-targets:ci"
7373
FROM_DOCKER_REPOSITORY: "ghcr.io/sagemath/sage/"
7474
FROM_DOCKER_TARGET: "with-targets"
7575
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}

.github/workflows/dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ jobs:
216216
#
217217
CIBW_ARCHS: ${{ matrix.arch }}
218218
# https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
219-
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
219+
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.11, <3.13"
220220
# Environment during wheel build
221221
CIBW_ENVIRONMENT: "PATH=$(pwd)/prefix/bin:$PATH CPATH=$(pwd)/prefix/include:$CPATH LIBRARY_PATH=$(pwd)/prefix/lib:$LIBRARY_PATH LD_LIBRARY_PATH=$(pwd)/prefix/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/prefix/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal PIP_CONSTRAINT=$(pwd)/constraints.txt PIP_FIND_LINKS=file://$(pwd)/wheelhouse SAGE_NUM_THREADS=6"
222222
# Use 'build', not 'pip wheel'

.github/workflows/doc-build-pdf.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
platform:
1010
description: 'Platform'
1111
required: true
12-
default: 'ubuntu-jammy-standard'
12+
default: 'ubuntu-noble-standard'
1313
docker_tag:
1414
description: 'Docker tag'
1515
required: true
@@ -22,8 +22,8 @@ concurrency:
2222

2323
env:
2424
# Same as in build.yml
25-
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-incremental"
26-
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-with-targets:ci"
25+
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-incremental"
26+
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-with-targets:ci"
2727
FROM_DOCKER_REPOSITORY: "ghcr.io/sagemath/sage/"
2828
FROM_DOCKER_TARGET: "with-targets"
2929
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}

.github/workflows/doc-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
platform:
2121
description: 'Platform'
2222
required: true
23-
default: 'ubuntu-jammy-standard'
23+
default: 'ubuntu-noble-standard'
2424
docker_tag:
2525
description: 'Docker tag'
2626
required: true
@@ -33,8 +33,8 @@ concurrency:
3333

3434
env:
3535
# Same as in build.yml
36-
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-incremental"
37-
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-with-targets:ci"
36+
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-incremental"
37+
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-with-targets:ci"
3838
FROM_DOCKER_REPOSITORY: "ghcr.io/sagemath/sage/"
3939
FROM_DOCKER_TARGET: "with-targets"
4040
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}

.github/workflows/pyright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818
jobs:
1919
pyright:
2020
runs-on: ubuntu-latest
21-
container: ghcr.io/sagemath/sage/sage-ubuntu-jammy-standard-with-targets:dev
21+
container: ghcr.io/sagemath/sage/sage-ubuntu-noble-standard-with-targets:dev
2222
steps:
2323
- name: Checkout
2424
id: checkout

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ __pycache__/
158158
/src/sage/modular/arithgroup/farey_symbol.h
159159
# List of C and C++ files that are actual source files,
160160
# NOT generated by Cython. The same list appears in src/MANIFEST.in
161-
!/src/sage/cpython/debugimpl.c
162161
!/src/sage/graphs/base/boost_interface.cpp
163162
!/src/sage/graphs/cliquer/cl.c
164163
!/src/sage/graphs/graph_decompositions/sage_tdlib.cpp

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ in the Installation Guide.
222222
more details.
223223

224224
- Python 3.4 or later, or Python 2.7, a full installation including
225-
`urllib`; but ideally version 3.9.x, 3.10.x, 3.11.x, 3.12.x, which
225+
`urllib`; but ideally version 3.11.x or later, which
226226
will avoid having to build Sage's own copy of Python 3.
227227
See [build/pkgs/python3/SPKG.rst](build/pkgs/python3/SPKG.rst)
228228
for more details.
@@ -557,11 +557,11 @@ SAGE_ROOT Root directory (create by git clone)
557557
│ │ ├── installed/
558558
│ │ │ Records of installed non-Python packages
559559
│ │ ├── scripts/ Scripts for uninstalling installed packages
560-
│ │ └── venv-python3.9 (SAGE_VENV)
560+
│ │ └── venv-python (SAGE_VENV)
561561
│ │ │ Installation hierarchy (virtual environment)
562562
│ │ │ for Python packages
563563
│ │ ├── bin/ Executables and installed scripts
564-
│ │ ├── lib/python3.9/site-packages/
564+
│ │ ├── lib/python/site-packages/
565565
│ │ │ Python modules/packages are installed here
566566
│ │ └── var/lib/sage/
567567
│ │ └── wheels/

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,14 @@ classifiers = [
6262
"Operating System :: POSIX",
6363
"Operating System :: MacOS :: MacOS X",
6464
"Programming Language :: Python :: 3 :: Only",
65-
"Programming Language :: Python :: 3.9",
66-
"Programming Language :: Python :: 3.10",
6765
"Programming Language :: Python :: 3.11",
6866
"Programming Language :: Python :: 3.12",
6967
"Programming Language :: Python :: 3.13",
7068
"Programming Language :: Python :: Implementation :: CPython",
7169
"Topic :: Scientific/Engineering :: Mathematics",
7270
]
7371
urls = {Homepage = "https://www.sagemath.org"}
74-
requires-python = ">=3.9, <3.14"
72+
requires-python = ">=3.11, <3.14"
7573

7674
[project.optional-dependencies]
7775
R = [

pyrightconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"root": "src"
88
}
99
],
10-
"pythonVersion": "3.9",
10+
"pythonVersion": "3.11",
1111
"exclude": ["venv"],
1212
"venvPath": "./venv/",
1313
"venv": "./",

ruff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# https://docs.astral.sh/ruff/configuration/#config-file-discovery
22

3-
# Assume Python 3.9
4-
target-version = "py39"
3+
# Python 3.11 is the minimum supported version
4+
target-version = "py311"
55

66
lint.select = [
77
"E", # pycodestyle errors - https://docs.astral.sh/ruff/rules/#error-e

0 commit comments

Comments
 (0)