Skip to content

Commit

Permalink
Add Python 3.12 support & fix CI (#350)
Browse files Browse the repository at this point in the history
* Add py3.12 support

- CI
- tox
- requisite ignore for dateutil (at time of writing)
- changelog item

* Move pytest config into setup.cfg

* Fix datetime deprecation warning pattern

In pytest config -- using `datetime.datetime.utcfromtimestamp` is
important for matching correctly.

For some reason, the previous pattern (as well as the fixed one) works
under a local dev environment with 3.12.
  • Loading branch information
sirosen authored Nov 22, 2023
1 parent 3922665 commit 5bf9c56
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
py: ['3.8', '3.9', '3.10', '3.11']
py: ['3.8', '3.9', '3.10', '3.11', '3.12']
name: "Run tests on ${{ matrix.os }}, py${{ matrix.py }}"
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Unreleased

.. vendor-insert-here
- Add official support for Python 3.12

0.27.1
------

Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ disallow_untyped_defs = true
ignore_missing_imports = true
warn_unreachable = true
warn_no_return = true

[tool:pytest]
filterwarnings =
error
# dateutil has a Python 3.12 compatibility issue.
ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated:DeprecationWarning
8 changes: 2 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ envlist =
mypy
cov_clean
py38-mindeps
py{311,310,39,38}
py{312,311,310,39,38}
py310-{notoml,tomli-format}
py{38,311}-{json5,pyjson5}
py{38,312}-{json5,pyjson5}
cov
skip_missing_interpreters = true
minversion = 4.0.0
Expand Down Expand Up @@ -90,7 +90,3 @@ commands = python ./scripts/vendor-schemas.py
[testenv:generate-hooks-config]
description = "update autogenerated pre-commit hooks"
commands = python ./scripts/generate-hooks-config.py

[pytest]
filterwarnings =
error

0 comments on commit 5bf9c56

Please sign in to comment.