Skip to content

Commit

Permalink
Switch to Python 3.12
Browse files Browse the repository at this point in the history
Require Python 3.12 as the minimum version, update GitHub Actions
accordingly, and remove an old workaround for Python 3.10.
  • Loading branch information
rra committed Jan 3, 2024
1 parent 9c63415 commit ce576f1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

# This has to happen after installing Node modules because we run
# eslint and it wants react to be already installed. We therefore
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
strategy:
matrix:
python:
- "3.11"
- "3.12"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:

- uses: lsst-sqre/run-tox@v1
with:
python-version: "3.11"
python-version: "3.12"
tox-envs: "docs"
cache-key-prefix: "docs"

Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
- name: Check links
uses: lsst-sqre/run-tox@v1
with:
python-version: "3.11"
python-version: "3.12"
tox-envs: "docs-linkcheck"

build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- uses: lsst-sqre/run-neophile@v1
with:
python-version: "3.11"
python-version: "3.12"
mode: pr
types: pre-commit
app-id: ${{ secrets.NEOPHILE_APP_ID }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/periodic-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python:
- "3.11"
- "3.12"

steps:
- uses: actions/checkout@v4
Expand All @@ -27,7 +27,7 @@ jobs:
# how dependencies should later be updated.
- uses: lsst-sqre/run-neophile@v1
with:
python-version: "3.11"
python-version: "3.12"
mode: update

- name: Set up Node
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Natural Language :: English",
"Operating System :: POSIX",
"Typing :: Typed",
]
requires-python = ">=3.11"
requires-python = ">=3.12"
dependencies = []
dynamic = ["version"]

Expand Down Expand Up @@ -114,6 +114,10 @@ filterwarnings = [
# Google modules call a deprecated pkg_resources API.
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
"ignore:.*pkg_resources\\.declare_namespace:DeprecationWarning",
# Google modules use PyType_Spec in a deprecated way.
"ignore:Type google\\..*metaclass.* custom tp_new:DeprecationWarning",
# dateutil uses a deprecated datetime function.
"ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil.*",
# Bug in kopf
"ignore:.*require all values to be sortable:DeprecationWarning:kopf.*",
]
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements/dev.txt requirements/dev.in
Expand Down
6 changes: 1 addition & 5 deletions requirements/main.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements/main.txt requirements/main.in
Expand Down Expand Up @@ -99,10 +99,6 @@ anyio==4.2.0 \
# httpx
# starlette
# watchfiles
async-timeout==4.0.3 \
--hash=sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f \
--hash=sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028
# via asyncpg
asyncpg==0.29.0 \
--hash=sha256:0009a300cae37b8c525e5b449233d59cd9868fd35431abc470a3e364d2b85cb9 \
--hash=sha256:000c996c53c04770798053e1730d34e30cb645ad95a63265aec82da9093d88e7 \
Expand Down
6 changes: 1 addition & 5 deletions tests/support/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,7 @@ async def assert_custom_resource_status_is(
}
transition_str = seen["status"]["create"]["lastTransitionTime"]
assert transition_str.endswith("Z")

# Python 3.11 can parse the string as-is, but Python 3.10 and earlier
# doesn't like the Z.
transition = datetime.fromisoformat(transition_str.replace("Z", "+00:00"))

transition = datetime.fromisoformat(transition_str)
now = current_datetime()
assert now - timedelta(seconds=30) <= transition <= now

Expand Down

0 comments on commit ce576f1

Please sign in to comment.