Skip to content

Commit 9a5b56b

Browse files
Support Python 3.14, drop 3.9 (#552)
1 parent 3f603fa commit 9a5b56b

File tree

19 files changed

+63
-68
lines changed

19 files changed

+63
-68
lines changed

.github/workflows/publish-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
- uses: astral-sh/setup-uv@v6
1717
- run: |
1818
uv build --all-packages
@@ -30,7 +30,10 @@ jobs:
3030
id-token: write
3131
steps:
3232
- name: Retrieve packages
33-
uses: actions/download-artifact@v4
33+
uses: actions/download-artifact@v5
34+
with:
35+
name: dist
36+
path: dist
3437
- name: Upload packages
3538
uses: pypa/gh-action-pypi-publish@release/v1
3639

@@ -41,7 +44,7 @@ jobs:
4144
permissions:
4245
contents: write
4346
steps:
44-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v5
4548
- id: changelog
4649
uses: agronholm/release-notes@v1
4750
with:

.github/workflows/test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
22-
- uses: actions/setup-python@v5
21+
uses: actions/checkout@v5
22+
- uses: actions/setup-python@v6
2323
with:
24-
python-version: '3.13'
24+
python-version: '3.14'
2525
cache: 'pip'
2626
- name: Install hatch
2727
run: |
28-
python3 -m pip install --upgrade pip
29-
python3 -m pip install hatch "click <8.3.0"
28+
python -m pip install --upgrade pip
29+
python -m pip install hatch
3030
- name: Check types
3131
run: |
3232
hatch run dev:typecheck
3333
3434
test:
3535
name: Tests
36-
runs-on: ${{ matrix.os }}
36+
runs-on: ${{ matrix.os }}-latest
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
os: [ubuntu-latest, macos-latest, windows-latest]
41-
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
40+
os: [ubuntu, macos, windows]
41+
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]
4242

4343
steps:
4444
- name: Checkout
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@v5
4646

47-
- uses: actions/setup-python@v5
47+
- uses: actions/setup-python@v6
4848
with:
4949
python-version: ${{ matrix.python-version }}
5050
cache: 'pip'
5151

5252
- name: Install hatch
5353
run: |
54-
python3 -m pip install --upgrade pip
55-
python3 -m pip install hatch "click <8.3.0"
54+
python -m pip install --upgrade pip
55+
python -m pip install hatch
5656
5757
- name: Run tests
5858
run: hatch run dev:test

jupyverse_api/jupyverse_api/asgi_websocket_transport.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ async def __aenter__(
6868
self._exit_stack = stack.pop_all()
6969
return retval
7070

71-
async def __aexit__(self, exc_type, exc_val, exc_tb) -> typing.Union[bool, None]:
71+
async def __aexit__(self, exc_type, exc_val, exc_tb) -> bool | None:
7272
return await self._exit_stack.__aexit__(exc_type, exc_val, exc_tb)
7373

7474
async def read(
75-
self, max_bytes: int, timeout: typing.Optional[float] = None
75+
self, max_bytes: int, timeout: float | None = None
7676
) -> bytes:
7777
message: Message = await self.receive(timeout=timeout)
7878
type = message["type"]
@@ -82,10 +82,10 @@ async def read(
8282

8383
event: wsproto.events.Event
8484
if type == "websocket.send":
85-
data_str: typing.Optional[str] = message.get("text")
85+
data_str: str | None = message.get("text")
8686
if data_str is not None:
8787
event = wsproto.events.TextMessage(data_str)
88-
data_bytes: typing.Optional[bytes] = message.get("bytes")
88+
data_bytes: bytes | None = message.get("bytes")
8989
if data_bytes is not None:
9090
event = wsproto.events.BytesMessage(data_bytes)
9191
elif type == "websocket.close":
@@ -94,7 +94,7 @@ async def read(
9494
return self.connection.send(event)
9595

9696
async def write(
97-
self, buffer: bytes, timeout: typing.Optional[float] = None
97+
self, buffer: bytes, timeout: float | None = None
9898
) -> None:
9999
self.connection.receive_data(buffer)
100100
for event in self.connection.events():
@@ -121,7 +121,7 @@ async def aclose(self) -> None:
121121
async def send(self, message: Message) -> None:
122122
self._receive_queue.put(message)
123123

124-
async def receive(self, timeout: typing.Optional[float] = None) -> Message:
124+
async def receive(self, timeout: float | None = None) -> Message:
125125
while self._send_queue.empty():
126126
await anyio.sleep(0)
127127
return self._send_queue.get(timeout=timeout)
@@ -178,9 +178,9 @@ async def __aenter__(self) -> "ASGIWebSocketTransport":
178178

179179
async def __aexit__(
180180
self,
181-
exc_type: typing.Optional[type[BaseException]] = None,
182-
exc_val: typing.Optional[BaseException] = None,
183-
exc_tb: typing.Optional[TracebackType] = None,
181+
exc_type: type[BaseException] | None = None,
182+
exc_val: BaseException | None = None,
183+
exc_tb: TracebackType | None = None,
184184
) -> None:
185185
await super().__aexit__(exc_type, exc_val, exc_tb)
186186
await self.exit_stack.__aexit__(exc_type, exc_val, exc_tb)

jupyverse_api/jupyverse_api/auth/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
from abc import ABC, abstractmethod
4-
from collections.abc import Awaitable
5-
from typing import Any, Callable
4+
from collections.abc import Awaitable, Callable
5+
from typing import Any
66

77
from jupyverse_api import Config
88

jupyverse_api/jupyverse_api/cli.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22

33
import io
44
import json
5-
import sys
5+
from importlib.metadata import entry_points
66
from typing import Any
77

88
import rich_click as click
99
from fps.cli._cli import main as fps_main
1010

11-
if sys.version_info < (3, 10):
12-
from importlib_metadata import entry_points
13-
else:
14-
from importlib.metadata import entry_points
15-
1611

1712
@click.command() # type: ignore
1813
@click.option(

jupyverse_api/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ classifiers = [
2626
"Programming Language :: Python :: Implementation :: PyPy",
2727
]
2828
dependencies = [
29-
"importlib_metadata >=3.6; python_version<'3.10'",
3029
"pydantic >=2,<3",
3130
"fastapi >=0.95.0,<1",
3231
"fps >=0.5.2,<0.6.0",

plugins/auth/fps_auth/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import contextlib
44
import json
55
import random
6-
from collections.abc import Awaitable
7-
from typing import Any, Callable
6+
from collections.abc import Awaitable, Callable
7+
from typing import Any
88

99
from fastapi import APIRouter, Depends
1010
from jupyverse_api.app import App

plugins/auth_fief/fps_auth_fief/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
import json
4-
from collections.abc import Awaitable
5-
from typing import Any, Callable
4+
from collections.abc import Awaitable, Callable
5+
from typing import Any
66

77
import httpx
88
from fastapi import APIRouter, Depends, Query, Request, Response

plugins/auth_jupyterhub/fps_auth_jupyterhub/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import json
44
import os
5-
from collections.abc import Awaitable
5+
from collections.abc import Awaitable, Callable
66
from datetime import datetime
77
from functools import partial
8-
from typing import Annotated, Any, Callable
8+
from typing import Annotated, Any
99

1010
from anyio import TASK_STATUS_IGNORED, Lock, create_task_group, sleep
1111
from anyio.abc import TaskStatus

plugins/kernel_subprocess/fps_kernel_subprocess/connect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import socket
66
import tempfile
77
import uuid
8-
from typing import Union
98

109
import zmq
1110
from zmq_anyio import Socket
@@ -20,7 +19,7 @@
2019

2120
context = zmq.Context()
2221

23-
cfg_t = dict[str, Union[str, int]]
22+
cfg_t = dict[str, str | int]
2423

2524

2625
def get_port(ip: str) -> int:

0 commit comments

Comments
 (0)