Skip to content

Commit

Permalink
Merge pull request #808 from sirosen/support-py312
Browse files Browse the repository at this point in the history
Add support for python3.12
  • Loading branch information
sirosen authored Aug 26, 2023
2 parents 9bf9ad0 + 554a104 commit 15b4b79
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
# we do not want a large number of windows and macos builds, so
# enumerate them explicitly
include:
Expand All @@ -46,6 +46,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: install tox
run: python -m pip install -U tox
- name: run tests
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/20230815_161655_sirosen_test_on_py3_12.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Python Support
~~~~~~~~~~~~~~

- Add support for Python 3.12. (:pr:`NUMBER`)
6 changes: 3 additions & 3 deletions requirements/py3.11/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ charset-normalizer==3.2.0
# via requests
docutils==0.20.1
# via sphinx
furo==2023.8.17
furo==2023.8.19
# via -r docs.in
idna==3.4
# via requests
Expand Down Expand Up @@ -44,7 +44,7 @@ snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4.1
# via beautifulsoup4
sphinx==7.2.2
sphinx==7.2.3
# via
# -r docs.in
# furo
Expand Down Expand Up @@ -75,7 +75,7 @@ sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.6
# via sphinx
sphinxcontrib-serializinghtml==1.1.8
sphinxcontrib-serializinghtml==1.1.9
# via sphinx
types-pyyaml==6.0.12.11
# via responses
Expand Down
40 changes: 40 additions & 0 deletions requirements/py3.12/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# tox p -m freezedeps
#
certifi==2023.7.22
# via requests
charset-normalizer==3.2.0
# via requests
coverage==7.3.0
# via -r test.in
execnet==2.0.2
# via pytest-xdist
idna==3.4
# via requests
iniconfig==2.0.0
# via pytest
packaging==23.1
# via pytest
pluggy==1.2.0
# via pytest
pytest==7.4.0
# via
# -r test.in
# pytest-xdist
pytest-xdist==3.3.1
# via -r test.in
pyyaml==6.0.1
# via responses
requests==2.31.0
# via responses
responses==0.23.3
# via -r test.in
types-pyyaml==6.0.12.11
# via responses
urllib3==2.0.4
# via
# requests
# responses
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12

[options]
python_requires = >=3.7
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/services/timer/test_jobs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
import json
from datetime import datetime, timedelta

import pytest

Expand Down Expand Up @@ -39,9 +39,9 @@ def test_get_job_errors(timer_client):
assert err.message == "Request failed terribly"


@pytest.mark.parametrize("start", [datetime.utcnow(), "2022-04-05T06:00:00"])
@pytest.mark.parametrize("start", [datetime.datetime.now(), "2022-04-05T06:00:00"])
@pytest.mark.parametrize(
"interval", [timedelta(days=1), timedelta(minutes=60), 600, None]
"interval", [datetime.timedelta(days=1), datetime.timedelta(minutes=60), 600, None]
)
def test_create_job(timer_client, start, interval):
meta = load_response(timer_client.create_job).metadata
Expand All @@ -57,11 +57,11 @@ def test_create_job(timer_client, start, interval):
assert response.http_status == 201
assert response.data["job_id"] == meta["job_id"]
req_body = json.loads(get_last_request().body)
if isinstance(start, datetime):
if isinstance(start, datetime.datetime):
assert req_body["start"] == start.isoformat()
else:
assert req_body["start"] == start
if isinstance(interval, timedelta):
if isinstance(interval, datetime.timedelta):
assert req_body["interval"] == interval.total_seconds()
else:
assert req_body["interval"] == interval
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ envlist =
mypy
test-lazy-imports
coverage_clean
py{311,310,39,38,37}
py{312,311,310,39,38,37}
py37-mindeps
coverage_report
docs
skip_missing_interpreters = true
minversion = 4.0.0
labels =
freezedeps = freezedeps-py{311,310,39,38,37}
freezedeps = freezedeps-py{312,311,310,39,38,37}

[testenv]
# build a wheel, not a tarball, and use a common env to do it (so that the wheel is shared)
Expand Down Expand Up @@ -95,7 +95,7 @@ commands_pre = rm -rf dist/
changedir = tests/non-pytest/poetry-lock-test
commands = poetry lock

[testenv:freezedeps-py{311,310,39,38,37}]
[testenv:freezedeps-py{312,311,310,39,38,37}]
description = freeze development dependencies using pip-compile
skip_install = true
setenv =
Expand Down

0 comments on commit 15b4b79

Please sign in to comment.