Skip to content

Commit

Permalink
Update to Python 3.13
Browse files Browse the repository at this point in the history
Remove the update-deps-no-hashes target since it is no longer
required with uv. Update Python and pre-commit dependencies, and
update the test mock for the new rubin-nublado-client.
  • Loading branch information
rra committed Feb 17, 2025
1 parent d30d7fc commit e202c3e
Show file tree
Hide file tree
Showing 9 changed files with 687 additions and 609 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"

- name: Run pre-commit
uses: pre-commit/[email protected]
Expand All @@ -38,7 +38,7 @@ jobs:
strategy:
matrix:
python:
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
if: steps.filter.outputs.docs == 'true' || github.event_name == 'workflow_dispatch'
uses: lsst-sqre/run-tox@v1
with:
python-version: "3.12"
python-version: "3.13"
tox-envs: docs
tox-plugins: tox-uv
cache-key-prefix: docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/periodic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python:
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
rev: v0.9.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# - Runs a non-root user.
# - Sets up the entrypoint and port.

FROM python:3.12.7-slim-bookworm AS base-image
FROM python:3.13.2-slim-bookworm AS base-image

# Update system packages
COPY scripts/install-base-packages.sh .
Expand Down
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ help:
@echo "make run - Run development instance of server"
@echo "make update - Update pinned dependencies and run make init"
@echo "make update-deps - Update pinned dependencies"
@echo "make update-deps-no-hashes - Pin dependencies without hashes"

.PHONY: init
init:
Expand All @@ -28,16 +27,7 @@ update-deps:
pip install --upgrade uv
uv pip install pre-commit
pre-commit autoupdate
uv pip compile --upgrade --generate-hashes \
uv pip compile --upgrade --universal --generate-hashes \
--output-file requirements/main.txt requirements/main.in
uv pip compile --upgrade --generate-hashes \
--output-file requirements/dev.txt requirements/dev.in

# Useful for testing against a Git version of a dependency.
.PHONY: update-deps-no-hashes
update-deps-no-hashes:
pip install --upgrade uv
uv pip compile --upgrade \
--output-file requirements/main.txt requirements/main.in
uv pip compile --upgrade \
uv pip compile --upgrade --universal --generate-hashes \
--output-file requirements/dev.txt requirements/dev.in
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
"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 Down
793 changes: 445 additions & 348 deletions requirements/dev.txt

Large diffs are not rendered by default.

472 changes: 231 additions & 241 deletions requirements/main.txt

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import respx
import safir.logging
import structlog
import websockets
from asgi_lifespan import LifespanManager
from fastapi import FastAPI
from httpx import ASGITransport, AsyncClient
Expand Down Expand Up @@ -237,7 +238,7 @@ async def mock_connect(
) -> AsyncGenerator[MockJupyterWebSocket]:
yield mock_jupyter_websocket(url, extra_headers, jupyter_mock)

with patch("rubin.nublado.client.nubladoclient.websocket_connect") as mock:
with patch.object(websockets, "connect") as mock:
mock.side_effect = mock_connect
# Register some code we call over and over and over...
jupyter_mock.register_python_result(_GET_NODE, "Node1")
Expand Down

0 comments on commit e202c3e

Please sign in to comment.