Skip to content

Commit

Permalink
Add support for Python 3.13
Browse files Browse the repository at this point in the history
Switch the controller and inithome containers to Python 3.13. Add
Python 3.13 to the test matrix for the JupyterHub plugins. Break
client testing into a separate GitHub Action job and also test it
against a matrix of Python 3.12 and 3.13. Update the periodic CI
check for various things that were added to the main CI but not
updated there.

Update Python dependencies.
  • Loading branch information
rra committed Dec 19, 2024
1 parent 1793bdc commit d7dcbd2
Show file tree
Hide file tree
Showing 16 changed files with 898 additions and 869 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ env:
# actions are run with this version. Quote the version to avoid
# interpretation as a floating point number.
#
# The client may eventually need to span multiple versions, but
# initially a single one is fine.
#
# The JupyterHub plugins use a separate matrix of versions because they have
# to work with the version of Python that is included in the JupyterHub
# images.
PYTHON_VERSION: "3.12"
PYTHON_VERSION: "3.13"

"on":
merge_group: {}
Expand Down Expand Up @@ -60,12 +57,37 @@ jobs:
with:
cache-dependency: "controller/requirements/*.txt"
cache-key-prefix: test
nox-sessions: "typing typing-inithome typing-client test test-inithome test-client"
nox-sessions: "typing typing-inithome test test-inithome"
python-version: ${{ env.PYTHON_VERSION }}

# The Hub image may not always track the Python version we use. Use a
# separate matrix for it. Note that our modules have to work with
# whatever-that-is.
# The Nublado client must support the Python versions of all of the packages
# that use it, so its minimum Python version can only be raised once all of
# the services that depend on it have moved to a newer version. Use a matrix
# to test all supported versions.
test-client:
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
python:
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v4

- uses: lsst-sqre/run-nox@v1
with:
cache-dependency: "hub/requirements/*.txt"
cache-key-prefix: test-client
nox-sessions: "typing-client test-client"
python-version: ${{ matrix.python }}

# The JupyterHub Docker image may not always track the Python version we use
# and the modules must support that version of Python. Use a matrix to test
# every version of Python from that version to the most recent so that we
# can safely upgrade when the JupyterHub Python upgrades.
test-hub:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand All @@ -74,6 +96,7 @@ jobs:
matrix:
python:
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -235,9 +258,7 @@ jobs:
run: |
echo Pushed ghcr.io/${{ github.repository }}-jupyterlab-base:${{ steps.build-jupyterlab-base.outputs.tag }}
pypi:

name: Upload release to PyPI
runs-on: ubuntu-latest

Expand Down
50 changes: 42 additions & 8 deletions .github/workflows/periodic-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
# The JupyterHub plugins use a separate matrix of versions because they have
# to work with the version of Python that is included in the JupyterHub
# images.
PYTHON_VERSION: "3.12"
PYTHON_VERSION: "3.13"

"on":
schedule:
Expand All @@ -30,7 +30,7 @@ jobs:

- uses: lsst-sqre/run-nox@v1
with:
nox-sessions: "update-deps typing test"
nox-sessions: "update-deps typing typing-inithome test test-inithome"
python-version: ${{ env.PYTHON_VERSION }}
use-cache: false

Expand All @@ -44,9 +44,44 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

# The controller requires Python 3.12, but the modules we add to the Hub
# have to run with Python 3.10 since that's what the JupyterHub image uses.
# Run a separate matrix to test those modules.
# The Nublado client must support the Python versions of all of the packages
# that use it, so its minimum Python version can only be raised once all of
# the services that depend on it have moved to a newer version. Use a matrix
# to test all supported versions.
test-client:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [test]

strategy:
matrix:
python:
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v4

- uses: lsst-sqre/run-nox@v1
with:
nox-sessions: "typing-client test-client"
python-version: ${{ matrix.python }}
use-cache: false

- name: Report status
if: failure()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Periodic client test for {repo} failed"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

# The JupyterHub Docker image may not always track the Python version we use
# and the modules must support that version of Python. Use a matrix to test
# every version of Python from that version to the most recent so that we
# can safely upgrade when the JupyterHub Python upgrades.
test-hub:
runs-on: ubuntu-latest
timeout-minutes: 15
Expand All @@ -55,9 +90,8 @@ jobs:
strategy:
matrix:
python:
- "3.10"
- "3.11"
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v4
Expand All @@ -74,7 +108,7 @@ jobs:
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Periodic test for {repo} failed"
notification_title: "Periodic hub test for {repo} failed"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.controller
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# - Runs a non-root user.
# - Sets up the entrypoint and port.

FROM python:3.12.8-slim-bookworm AS base-image
FROM python:3.13.1-slim-bookworm AS base-image

# Update system packages
COPY controller/scripts/install-base-packages.sh .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.inithome
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# - Sets up the entrypoint.

# This is just an alias to avoid repeating the base image.
FROM python:3.12.8-slim-bookworm AS base-image
FROM python:3.13.1-slim-bookworm AS base-image

FROM base-image AS install-image

Expand Down
14 changes: 6 additions & 8 deletions authenticator/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Natural Language :: English",
"Operating System :: POSIX",
"Typing :: Typed",
]
requires-python = ">=3.10"
requires-python = ">=3.12"
dependencies = [
"jupyterhub<6",
"tornado<7",
Expand All @@ -27,7 +26,6 @@ dynamic = ["version"]

[project.optional-dependencies]
dev = [
# Testing
"pytest",
"pytest-asyncio",
"pytest-sugar",
Expand All @@ -38,7 +36,7 @@ Homepage = "https://nublado.lsst.io"
Source = "https://github.com/lsst-sqre/nublado"

[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2"]
build-backend = 'setuptools.build_meta'

[project.entry-points."jupyterhub.authenticators"]
Expand All @@ -47,9 +45,6 @@ gafaelfawr = "rubin.nublado.authenticator:GafaelfawrAuthenticator"
[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools_scm]
root = ".."

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "strict"
Expand All @@ -66,3 +61,6 @@ filterwarnings = [
# with complex data structures rather than only the assert message) in files
# listed in python_files.
python_files = ["tests/*.py", "tests/*/*.py"]

[tool.setuptools_scm]
root = ".."
1 change: 1 addition & 0 deletions client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX",
Expand Down
12 changes: 6 additions & 6 deletions controller/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Natural Language :: English",
"Operating System :: POSIX",
"Typing :: Typed",
]
requires-python = ">=3.12"
requires-python = ">=3.13"
# Use requirements/main.in for runtime dependencies instead.
dependencies = []
dynamic = ["version"]
Expand All @@ -29,12 +29,9 @@ Homepage = "https://nublado.lsst.io"
Source = "https://github.com/lsst-sqre/nublado"

[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
root = ".."

[tool.coverage.run]
parallel = true
branch = true
Expand Down Expand Up @@ -78,3 +75,6 @@ filterwarnings = [
# with complex data structures rather than only the assert message) in files
# listed in python_files.
python_files = ["tests/*.py", "tests/*/*.py"]

[tool.setuptools_scm]
root = ".."
Loading

0 comments on commit d7dcbd2

Please sign in to comment.