Skip to content

Commit

Permalink
Support Python 3.13, drop Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthagen committed Oct 14, 2024
1 parent 6a99b29 commit 4f57792
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 247 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
POETRY_VERSION: "1.8.4"
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"

jobs:
deploy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on: [push, pull_request]

env:
POETRY_VERSION: "1.8.4"
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"

jobs:
test:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v4
- name: Install poetry
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# subtle errors when using MUSL.
# - These Python packages usually only provide binary wheels for GLIBC, so the packages
# will need to be recompiled fully within the Docker images, increasing build times.
FROM python:3.10-slim-bookworm AS python_builder
FROM python:3.11-slim-bookworm AS python_builder

# Pin Poetry to a specific version to make Docker builds reproducible.
ENV POETRY_VERSION=1.8.4
Expand Down Expand Up @@ -60,7 +60,7 @@ RUN poetry build && \

## Final Image
# The image used in the final image MUST match exactly to the python_builder image.
FROM python:3.10-slim-bookworm
FROM python:3.11-slim-bookworm

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONBUFFERED=1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface (`fact.cli`).

# Requirements

Python 3.8+.
Python 3.9+.

# Package Management

Expand Down
8 changes: 3 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
nox.options.sessions = ["lint", "type_check", "test", "docs"]


@session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
@session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
def test(s: Session) -> None:
s.install(".", "pytest", "pytest-cov", "pytest-randomly")
s.run(
Expand Down Expand Up @@ -67,14 +67,12 @@ def docs(s: Session) -> None:

@session(venv_backend="none")
def docs_check_urls(s: Session) -> None:
# TODO: Replace dict merge with d1 | d2 when dropping support for Python 3.8.
s.run("mkdocs", "build", env={**doc_env, **{"HTMLPROOFER_VALIDATE_EXTERNAL_URLS": str(True)}})
s.run("mkdocs", "build", env=doc_env | {"HTMLPROOFER_VALIDATE_EXTERNAL_URLS": str(True)})


@session(venv_backend="none")
def docs_offline(s: Session) -> None:
# TODO: Replace dict merge with d1 | d2 when dropping support for Python 3.8.
s.run("mkdocs", "build", env={**doc_env, **{"MKDOCS_MATERIAL_OFFLINE": str(True)}})
s.run("mkdocs", "build", env=doc_env | {"MKDOCS_MATERIAL_OFFLINE": str(True)})


@session(venv_backend="none")
Expand Down
410 changes: 176 additions & 234 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Typing :: Typed",
# Include this classifier to prevent accidently publishing private code to PyPI.
# https://pypi.org/classifiers/
Expand All @@ -32,7 +32,7 @@ classifiers = [
# Some packages, such as scipy, constrain their upper bound of Python versions they support.
# Without also constraining the upper bound here, Poetry will not select those versions and will
# result in an old version being resolved/locked.
python = "^3.8, <3.13"
python = "^3.9, <3.14"
rich = "*"
typer-slim = { version = "*", extras = ["standard"] }

Expand Down

0 comments on commit 4f57792

Please sign in to comment.