Skip to content

Commit af010af

Browse files
authored
Merge pull request #3106 from CoolCat467/drop-3.8-support
Drop 3.8 support
2 parents 3d592af + 507dee3 commit af010af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+165
-140
lines changed

.github/workflows/autodeps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
- name: Setup python
2525
uses: actions/setup-python@v5
2626
with:
27-
python-version: "3.8"
27+
python-version: "3.9"
2828

2929
- name: Bump dependencies
3030
run: |
3131
python -m pip install -U pip pre-commit
3232
python -m pip install -r test-requirements.txt
33-
uv pip compile --universal --python-version=3.8 --upgrade test-requirements.in -o test-requirements.txt
33+
uv pip compile --universal --python-version=3.9 --upgrade test-requirements.in -o test-requirements.txt
3434
uv pip compile --universal --python-version=3.11 --upgrade docs-requirements.in -o docs-requirements.txt
3535
pre-commit autoupdate --jobs 0
3636
@@ -43,7 +43,7 @@ jobs:
4343

4444
- name: uv
4545
run: |
46-
uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
46+
uv pip compile --universal --python-version=3.9 test-requirements.in -o test-requirements.txt
4747
uv pip compile --universal --python-version=3.11 docs-requirements.in -o docs-requirements.txt
4848
4949
- name: Commit changes and create automerge PR

.github/workflows/ci.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12']
21+
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13']
2222
arch: ['x86', 'x64']
2323
lsp: ['']
2424
lsp_extract_file: ['']
2525
extra_name: ['']
2626
include:
27-
- python: '3.8'
27+
- python: '3.9'
2828
arch: 'x64'
2929
lsp: 'https://raw.githubusercontent.com/python-trio/trio-ci-assets/master/komodia-based-vpn-setup.zip'
3030
lsp_extract_file: 'komodia-based-vpn-setup.exe'
3131
extra_name: ', with Komodia LSP'
32-
- python: '3.8'
32+
- python: '3.9'
3333
arch: 'x64'
3434
lsp: 'https://www.proxifier.com/download/legacy/ProxifierSetup342.exe'
3535
lsp_extract_file: ''
3636
extra_name: ', with IFS LSP'
37-
#- python: '3.8'
37+
#- python: '3.9'
3838
# arch: 'x64'
3939
# lsp: 'http://download.pctools.com/mirror/updates/9.0.0.2308-SDavfree-lite_en.exe'
4040
# lsp_extract_file: ''
@@ -87,16 +87,16 @@ jobs:
8787
strategy:
8888
fail-fast: false
8989
matrix:
90-
python: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
90+
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13']
9191
check_formatting: ['0']
9292
no_test_requirements: ['0']
9393
extra_name: ['']
9494
include:
95-
- python: '3.12'
95+
- python: '3.13'
9696
check_formatting: '1'
9797
extra_name: ', check formatting'
9898
# separate test run that doesn't install test-requirements.txt
99-
- python: '3.8'
99+
- python: '3.9'
100100
no_test_requirements: '1'
101101
extra_name: ', no test-requirements'
102102
continue-on-error: >-
@@ -143,7 +143,7 @@ jobs:
143143
strategy:
144144
fail-fast: false
145145
matrix:
146-
python: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12']
146+
python: ['pypy-3.10', '3.9', '3.10', '3.11', '3.12', '3.13']
147147
continue-on-error: >-
148148
${{
149149
(
@@ -203,7 +203,15 @@ jobs:
203203
strategy:
204204
fail-fast: false
205205
matrix:
206-
python: ['3.8', '3.12']
206+
include:
207+
- python: '3.9' # We support running on cython 2 and 3 for 3.9
208+
cython: '<3' # cython 2
209+
- python: '3.9'
210+
cython: '>=3' # cython 3 (or greater)
211+
- python: '3.11' # 3.11 is the last version Cy2 supports
212+
cython: '<3' # cython 2
213+
- python: '3.13' # We support running cython3 on 3.13
214+
cython: '>=3' # cython 3 (or greater)
207215
steps:
208216
- name: Checkout
209217
uses: actions/checkout@v4
@@ -216,18 +224,11 @@ jobs:
216224
- name: install trio and setuptools
217225
run: python -m pip install --upgrade pip . setuptools
218226

219-
- name: install cython<3
220-
run: python -m pip install "cython<3"
221-
- name: compile pyx file
222-
run: cythonize -i tests/cython/test_cython.pyx
223-
- name: import & run module
224-
run: python -c 'import tests.cython.test_cython'
227+
- name: install cython & compile pyx file
228+
run: |
229+
python -m pip install "cython${{ matrix.cython }}"
230+
cythonize --inplace tests/cython/test_cython.pyx
225231
226-
- name: install cython>=3
227-
run: python -m pip install "cython>=3"
228-
- name: compile pyx file
229-
# different cython version should trigger a re-compile, but --force just in case
230-
run: cythonize --inplace --force tests/cython/test_cython.pyx
231232
- name: import & run module
232233
run: python -c 'import tests.cython.test_cython'
233234

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-python@v5
1414
with:
15-
python-version: "3.8"
15+
python-version: "3.9"
1616
- run: python -m pip install build
1717
- run: python -m build
1818

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ demonstration of implementing the "Happy Eyeballs" algorithm in an
9292
older library versus Trio.
9393

9494
**Cool, but will it work on my system?** Probably! As long as you have
95-
some kind of Python 3.8-or-better (CPython or `currently maintained versions of
95+
some kind of Python 3.9-or-better (CPython or `currently maintained versions of
9696
PyPy3 <https://doc.pypy.org/en/latest/faq.html#which-python-versions-does-pypy-implement>`__
9797
are both fine), and are using Linux, macOS, Windows, or FreeBSD, then Trio
9898
will work. Other environments might work too, but those

check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fi
7878

7979
# Check pip compile is consistent
8080
echo "::group::Pip Compile - Tests"
81-
uv pip compile --universal --python-version=3.8 test-requirements.in -o test-requirements.txt
81+
uv pip compile --universal --python-version=3.9 test-requirements.in -o test-requirements.txt
8282
echo "::endgroup::"
8383
echo "::group::Pip Compile - Docs"
8484
uv pip compile --universal --python-version=3.11 docs-requirements.in -o docs-requirements.txt

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Vital statistics:
4545

4646
* Supported environments: We test on
4747

48-
- Python: 3.8+ (CPython and PyPy)
48+
- Python: 3.9+ (CPython and PyPy)
4949
- Windows, macOS, Linux (glibc and musl), FreeBSD
5050

5151
Other environments might also work; give it a try and see.

docs/source/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Okay, ready? Let's get started.
8888
Before you begin
8989
----------------
9090

91-
1. Make sure you're using Python 3.8 or newer.
91+
1. Make sure you're using Python 3.9 or newer.
9292

9393
2. ``python3 -m pip install --upgrade trio`` (or on Windows, maybe
9494
``py -3 -m pip install --upgrade trio`` – `details

newsfragments/3106.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for Python 3.8. (`#3104 <https://github.com/python-trio/trio/issues/3104>`__)

pyproject.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ classifiers = [
2626
"Programming Language :: Python :: Implementation :: CPython",
2727
"Programming Language :: Python :: Implementation :: PyPy",
2828
"Programming Language :: Python :: 3 :: Only",
29-
"Programming Language :: Python :: 3.8",
3029
"Programming Language :: Python :: 3.9",
3130
"Programming Language :: Python :: 3.10",
3231
"Programming Language :: Python :: 3.11",
@@ -35,7 +34,7 @@ classifiers = [
3534
"Topic :: System :: Networking",
3635
"Typing :: Typed",
3736
]
38-
requires-python = ">=3.8"
37+
requires-python = ">=3.9"
3938
dependencies = [
4039
# attrs 19.2.0 adds `eq` option to decorators
4140
# attrs 20.1.0 adds @frozen
@@ -75,7 +74,6 @@ include-package-data = true
7574
version = {attr = "trio._version.__version__"}
7675

7776
[tool.black]
78-
target-version = ['py38']
7977
force-exclude = '''
8078
(
8179
^/docs/source/reference-.*
@@ -170,7 +168,7 @@ combine-as-imports = true
170168
fixture-parentheses = false
171169

172170
[tool.mypy]
173-
python_version = "3.8"
171+
python_version = "3.9"
174172
files = ["src/trio/", "docs/source/*.py"]
175173

176174
# Be flexible about dependencies that don't have stubs yet (like pytest)
@@ -195,7 +193,7 @@ disallow_untyped_defs = true
195193
check_untyped_defs = true
196194

197195
[tool.pyright]
198-
pythonVersion = "3.8"
196+
pythonVersion = "3.9"
199197
reportUnnecessaryTypeIgnoreComment = true
200198
typeCheckingMode = "strict"
201199

src/trio/_channel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from typing import (
66
TYPE_CHECKING,
77
Generic,
8-
Tuple, # only needed for typechecking on <3.9
98
)
109

1110
import attrs
@@ -93,8 +92,7 @@ def _open_memory_channel(
9392
# it could replace the normal function header
9493
if TYPE_CHECKING:
9594
# written as a class so you can say open_memory_channel[int](5)
96-
# Need to use Tuple instead of tuple due to CI check running on 3.8
97-
class open_memory_channel(Tuple["MemorySendChannel[T]", "MemoryReceiveChannel[T]"]):
95+
class open_memory_channel(tuple["MemorySendChannel[T]", "MemoryReceiveChannel[T]"]):
9896
def __new__( # type: ignore[misc] # "must return a subtype"
9997
cls,
10098
max_buffer_size: int | float, # noqa: PYI041

0 commit comments

Comments
 (0)