Skip to content

Commit

Permalink
Support Python 3.12 (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored Aug 15, 2023
1 parent 1075c2d commit 2a35eb0
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ jobs:
- 3.9
- '3.10'
- '3.11'
- '3.12'

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: 'requirements/*.txt'

Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ repos:
- id: setup-cfg-fmt
args:
- --include-version-classifiers
- --max-py-version
- '3.12'
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Changelog
=========

* Support Python 3.12.

3.14.0 (2023-08-15)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Install with:
python -m pip install pytest-randomly
Python 3.8 to 3.11 supported.
Python 3.8 to 3.12 supported.

----

Expand Down
5 changes: 5 additions & 0 deletions requirements/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@
check=True,
capture_output=True,
)
subprocess.run(
["python3.12", *common_args, "-o", "py312.txt"],
check=True,
capture_output=True,
)
2 changes: 1 addition & 1 deletion requirements/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ model-bakery==1.13.0 \
--hash=sha256:0f54a4548722ecee0183d82eabe1adf8f74303e6ce08705cfe228a96ef3bb7d9 \
--hash=sha256:dba7444c9593261b12dcb21f8f9e1ba668fafc70804f15dfd6aa208b9e3f558f
# via -r requirements.in
numpy==1.25.2 \
numpy==1.25.2 ; python_version < "3.12" \
--hash=sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2 \
--hash=sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55 \
--hash=sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf \
Expand Down
2 changes: 1 addition & 1 deletion requirements/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ model-bakery==1.13.0 \
--hash=sha256:0f54a4548722ecee0183d82eabe1adf8f74303e6ce08705cfe228a96ef3bb7d9 \
--hash=sha256:dba7444c9593261b12dcb21f8f9e1ba668fafc70804f15dfd6aa208b9e3f558f
# via -r requirements.in
numpy==1.25.2 \
numpy==1.25.2 ; python_version < "3.12" \
--hash=sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2 \
--hash=sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55 \
--hash=sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf \
Expand Down
150 changes: 150 additions & 0 deletions requirements/py312.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# requirements/compile.py
#
asgiref==3.7.2 \
--hash=sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e \
--hash=sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed
# via django
coverage==7.3.0 \
--hash=sha256:07ea61bcb179f8f05ffd804d2732b09d23a1238642bf7e51dad62082b5019b34 \
--hash=sha256:1084393c6bda8875c05e04fce5cfe1301a425f758eb012f010eab586f1f3905e \
--hash=sha256:13c6cbbd5f31211d8fdb477f0f7b03438591bdd077054076eec362cf2207b4a7 \
--hash=sha256:211a4576e984f96d9fce61766ffaed0115d5dab1419e4f63d6992b480c2bd60b \
--hash=sha256:2d22172f938455c156e9af2612650f26cceea47dc86ca048fa4e0b2d21646ad3 \
--hash=sha256:34f9f0763d5fa3035a315b69b428fe9c34d4fc2f615262d6be3d3bf3882fb985 \
--hash=sha256:3558e5b574d62f9c46b76120a5c7c16c4612dc2644c3d48a9f4064a705eaee95 \
--hash=sha256:36ce5d43a072a036f287029a55b5c6a0e9bd73db58961a273b6dc11a2c6eb9c2 \
--hash=sha256:37d5576d35fcb765fca05654f66aa71e2808d4237d026e64ac8b397ffa66a56a \
--hash=sha256:3c9834d5e3df9d2aba0275c9f67989c590e05732439b3318fa37a725dff51e74 \
--hash=sha256:438856d3f8f1e27f8e79b5410ae56650732a0dcfa94e756df88c7e2d24851fcd \
--hash=sha256:477c9430ad5d1b80b07f3c12f7120eef40bfbf849e9e7859e53b9c93b922d2af \
--hash=sha256:49ab200acf891e3dde19e5aa4b0f35d12d8b4bd805dc0be8792270c71bd56c54 \
--hash=sha256:49dbb19cdcafc130f597d9e04a29d0a032ceedf729e41b181f51cd170e6ee865 \
--hash=sha256:4c8e31cf29b60859876474034a83f59a14381af50cbe8a9dbaadbf70adc4b214 \
--hash=sha256:4eddd3153d02204f22aef0825409091a91bf2a20bce06fe0f638f5c19a85de54 \
--hash=sha256:5247bab12f84a1d608213b96b8af0cbb30d090d705b6663ad794c2f2a5e5b9fe \
--hash=sha256:5492a6ce3bdb15c6ad66cb68a0244854d9917478877a25671d70378bdc8562d0 \
--hash=sha256:56afbf41fa4a7b27f6635bc4289050ac3ab7951b8a821bca46f5b024500e6321 \
--hash=sha256:59777652e245bb1e300e620ce2bef0d341945842e4eb888c23a7f1d9e143c446 \
--hash=sha256:60f64e2007c9144375dd0f480a54d6070f00bb1a28f65c408370544091c9bc9e \
--hash=sha256:63c5b8ecbc3b3d5eb3a9d873dec60afc0cd5ff9d9f1c75981d8c31cfe4df8527 \
--hash=sha256:68d8a0426b49c053013e631c0cdc09b952d857efa8f68121746b339912d27a12 \
--hash=sha256:74c160285f2dfe0acf0f72d425f3e970b21b6de04157fc65adc9fd07ee44177f \
--hash=sha256:7a9baf8e230f9621f8e1d00c580394a0aa328fdac0df2b3f8384387c44083c0f \
--hash=sha256:7df91fb24c2edaabec4e0eee512ff3bc6ec20eb8dccac2e77001c1fe516c0c84 \
--hash=sha256:7f297e0c1ae55300ff688568b04ff26b01c13dfbf4c9d2b7d0cb688ac60df479 \
--hash=sha256:80501d1b2270d7e8daf1b64b895745c3e234289e00d5f0e30923e706f110334e \
--hash=sha256:85b7335c22455ec12444cec0d600533a238d6439d8d709d545158c1208483873 \
--hash=sha256:887665f00ea4e488501ba755a0e3c2cfd6278e846ada3185f42d391ef95e7e70 \
--hash=sha256:8f39c49faf5344af36042b293ce05c0d9004270d811c7080610b3e713251c9b0 \
--hash=sha256:90b6e2f0f66750c5a1178ffa9370dec6c508a8ca5265c42fbad3ccac210a7977 \
--hash=sha256:96d7d761aea65b291a98c84e1250cd57b5b51726821a6f2f8df65db89363be51 \
--hash=sha256:97af9554a799bd7c58c0179cc8dbf14aa7ab50e1fd5fa73f90b9b7215874ba28 \
--hash=sha256:97c44f4ee13bce914272589b6b41165bbb650e48fdb7bd5493a38bde8de730a1 \
--hash=sha256:a67e6bbe756ed458646e1ef2b0778591ed4d1fcd4b146fc3ba2feb1a7afd4254 \
--hash=sha256:ac0dec90e7de0087d3d95fa0533e1d2d722dcc008bc7b60e1143402a04c117c1 \
--hash=sha256:ad0f87826c4ebd3ef484502e79b39614e9c03a5d1510cfb623f4a4a051edc6fd \
--hash=sha256:b3eb0c93e2ea6445b2173da48cb548364f8f65bf68f3d090404080d338e3a689 \
--hash=sha256:b543302a3707245d454fc49b8ecd2c2d5982b50eb63f3535244fd79a4be0c99d \
--hash=sha256:b859128a093f135b556b4765658d5d2e758e1fae3e7cc2f8c10f26fe7005e543 \
--hash=sha256:bac329371d4c0d456e8d5f38a9b0816b446581b5f278474e416ea0c68c47dcd9 \
--hash=sha256:c02cfa6c36144ab334d556989406837336c1d05215a9bdf44c0bc1d1ac1cb637 \
--hash=sha256:c9737bc49a9255d78da085fa04f628a310c2332b187cd49b958b0e494c125071 \
--hash=sha256:ccc51713b5581e12f93ccb9c5e39e8b5d4b16776d584c0f5e9e4e63381356482 \
--hash=sha256:ce2ee86ca75f9f96072295c5ebb4ef2a43cecf2870b0ca5e7a1cbdd929cf67e1 \
--hash=sha256:d000a739f9feed900381605a12a61f7aaced6beae832719ae0d15058a1e81c1b \
--hash=sha256:db76a1bcb51f02b2007adacbed4c88b6dee75342c37b05d1822815eed19edee5 \
--hash=sha256:e2ac9a1de294773b9fa77447ab7e529cf4fe3910f6a0832816e5f3d538cfea9a \
--hash=sha256:e61260ec93f99f2c2d93d264b564ba912bec502f679793c56f678ba5251f0393 \
--hash=sha256:fac440c43e9b479d1241fe9d768645e7ccec3fb65dc3a5f6e90675e75c3f3e3a \
--hash=sha256:fc0ed8d310afe013db1eedd37176d0839dc66c96bcfcce8f6607a73ffea2d6ba
# via -r requirements.in
django==4.2.4 \
--hash=sha256:7e4225ec065e0f354ccf7349a22d209de09cc1c074832be9eb84c51c1799c432 \
--hash=sha256:860ae6a138a238fc4f22c99b52f3ead982bb4b1aad8c0122bcd8c8a3a02e409d
# via model-bakery
execnet==2.0.2 \
--hash=sha256:88256416ae766bc9e8895c76a87928c0012183da3cc4fc18016e6f050e025f41 \
--hash=sha256:cc59bc4423742fd71ad227122eb0dd44db51efb3dc4095b45ac9a08c770096af
# via pytest-xdist
factory-boy==3.3.0 \
--hash=sha256:a2cdbdb63228177aa4f1c52f4b6d83fab2b8623bf602c7dedd7eb83c0f69c04c \
--hash=sha256:bc76d97d1a65bbd9842a6d722882098eb549ec8ee1081f9fb2e8ff29f0c300f1
# via -r requirements.in
faker==19.3.0 \
--hash=sha256:7d6ed00de3eef9bd57504500c67ee034cab959e4248f9c24aca33e08af82ca93 \
--hash=sha256:bee54278d6e1289573317604ab6f4782acca724396bf261eaf1890de228e553d
# via
# -r requirements.in
# factory-boy
iniconfig==2.0.0 \
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
# via pytest
model-bakery==1.13.0 \
--hash=sha256:0f54a4548722ecee0183d82eabe1adf8f74303e6ce08705cfe228a96ef3bb7d9 \
--hash=sha256:dba7444c9593261b12dcb21f8f9e1ba668fafc70804f15dfd6aa208b9e3f558f
# via -r requirements.in
numpy==1.26.0b1 ; python_version >= "3.12" \
--hash=sha256:02af7482f34aeb9658ece615c922942f1a3908c449a9a6cd9f33fa233ce486d4 \
--hash=sha256:16313a28cf703ae722b3ac139809360ffef81a45e758f196e538be3bcbee85c9 \
--hash=sha256:18e29ab806ec5e0b05df900d44b3b257a5901c32fc3ddaeb818c520cd9279b4e \
--hash=sha256:1f88e6fe42b0d6418e53332e525b299762dbd9e33055d2e0398e6298da5b0cc9 \
--hash=sha256:216b47882877ea5272f279c08bf7e42935728f35c6db2e4843b37db7b29ce016 \
--hash=sha256:22584a41b1be30543dd8c030affc90d8cb7ec19a56fda7f27fc33f64f8b0fbaa \
--hash=sha256:2b258f67ca4a8245c74470da66a87684ddb3f06dde98760efc7ca792a44ee254 \
--hash=sha256:321a063fabc302931029f831f284cf43c301fdeead1b15df2f8aa87673294d4d \
--hash=sha256:3aa806da215e9c10ba89e9037a69c7a56367e059615679ef1a5cf937eedfbf61 \
--hash=sha256:3c6c5804671fa1697e3d0cbc608a65c55794fb6682f4e04e9f6d65d0ddfc47c7 \
--hash=sha256:4a6d4c99396c57e02b0181f01ba42b482f327774057e51fb7fb390a130c95cff \
--hash=sha256:5a8f04e957259ef93a1e4a29da0b64d49ee842af456257bbb7253925cfe2f7bd \
--hash=sha256:87f2799f475e9e7aee69254dfe357975b163d409550d4641a0bca4cb4f64b725 \
--hash=sha256:8aefe8ab1228e00146e5ae88290c7fdb8221aef45b357aed7f3dff6ac3b3b25a \
--hash=sha256:94d5572fea8dca0fa929da9d17fa49e525ceee1e59b04372dfa5bd8a5f688f5f \
--hash=sha256:9a74361204dc604ba53916ed55aef0ca73e7aa3d0b7e47e1c28aece8c2ad4f59 \
--hash=sha256:a31d9109ffed9fc5566e73346a076fffbc7db00e626579ae4d5dfec933b29bfc \
--hash=sha256:ab9e86bb7c9d3e009945b24a92318ff5d8c245e0e0aaaa765825c4561c292d53 \
--hash=sha256:b0b73599c80b29dfa7f812cb2e8738ce3f058b413e9f2f478e3cc4e038bb8f8e \
--hash=sha256:b66135c02ee55f9113dce3c8c5130b5feaead8767cd2c7ad36547a3d5e264230 \
--hash=sha256:c466707e5ce5a44caadb85fd672a5ce0bfc060012df465771e7b10506e1e5dad \
--hash=sha256:c67eea90827e1e9aa220a3fc380ce8776428deba8ac9e7c931ce7b69e8dce115 \
--hash=sha256:db698c9008217c54a8005ea58bd5836241d7b519c8bb16a698a1b4ec4ca296a8 \
--hash=sha256:dc36a9e8df48b72dad668d6f4036ed477d8bc2cb1f7a23b688e8e8057afdfee3 \
--hash=sha256:ea85e8e297af49d30830177ecb0c54d1cbca051e4306161f3ceabfa66560b17c \
--hash=sha256:eea337d6d5ab2b6eb657b3f18e8b57a280f16fb5f94df484d9c1a8d3450d9ae9 \
--hash=sha256:f250b3099649137f1021f8f95a9404273bcb7539f0bef6d6cf2c91260285edc4 \
--hash=sha256:f71e10402e705aaa5908464e489d38e6583c48e40a4721f83195772178c7da9f
# via -r requirements.in
packaging==23.1 \
--hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \
--hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f
# via pytest
pluggy==1.2.0 \
--hash=sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849 \
--hash=sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3
# via pytest
pytest==7.4.0 \
--hash=sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32 \
--hash=sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a
# via
# -r requirements.in
# pytest-xdist
pytest-xdist==3.3.1 \
--hash=sha256:d5ee0520eb1b7bcca50a60a518ab7a7707992812c578198f8b44fdfac78e8c93 \
--hash=sha256:ff9daa7793569e6a68544850fd3927cd257cc03a7ef76c95e86915355e82b5f2
# via -r requirements.in
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
# via faker
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
# via python-dateutil
sqlparse==0.4.4 \
--hash=sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3 \
--hash=sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c
# via django
2 changes: 1 addition & 1 deletion requirements/py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ model-bakery==1.13.0 \
--hash=sha256:0f54a4548722ecee0183d82eabe1adf8f74303e6ce08705cfe228a96ef3bb7d9 \
--hash=sha256:dba7444c9593261b12dcb21f8f9e1ba668fafc70804f15dfd6aa208b9e3f558f
# via -r requirements.in
numpy==1.24.4 \
numpy==1.24.4 ; python_version < "3.12" \
--hash=sha256:04640dab83f7c6c85abf9cd729c5b65f1ebd0ccf9de90b270cd61935eef0197f \
--hash=sha256:1452241c290f3e2a312c137a9999cdbf63f78864d63c79039bda65ee86943f61 \
--hash=sha256:222e40d0e2548690405b0b3c7b21d1169117391c2e82c378467ef9ab4c8f0da7 \
Expand Down
2 changes: 1 addition & 1 deletion requirements/py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ model-bakery==1.13.0 \
--hash=sha256:0f54a4548722ecee0183d82eabe1adf8f74303e6ce08705cfe228a96ef3bb7d9 \
--hash=sha256:dba7444c9593261b12dcb21f8f9e1ba668fafc70804f15dfd6aa208b9e3f558f
# via -r requirements.in
numpy==1.25.2 \
numpy==1.25.2 ; python_version < "3.12" \
--hash=sha256:0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2 \
--hash=sha256:1a1329e26f46230bf77b02cc19e900db9b52f398d6722ca853349a782d4cff55 \
--hash=sha256:1b9735c27cea5d995496f46a8b1cd7b408b3f34b6d50459d9ac8fe3a20cc17bf \
Expand Down
3 changes: 2 additions & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ factory_boy
faker
importlib-metadata >= 3.6.0 ; python_version < "3.10"
model_bakery>=1.13.0
numpy
numpy; python_version < "3.12"
numpy>=1.26.0b1; python_version >= "3.12"
pytest
pytest-xdist
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Typing :: Typed
keywords = pytest, random, randomize, randomise, randomly
project_urls =
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
requires =
tox>=4.2
env_list =
py{311, 310, 39, 38}
py{312, 311, 310, 39, 38}

[testenv]
package = wheel
deps =
-r requirements/{envname}.txt
set_env =
Expand All @@ -15,5 +16,6 @@ commands =
-W error::DeprecationWarning \
-W error::PendingDeprecationWarning \
-W ignore:'pkg_resources is deprecated as an API':DeprecationWarning \
-W ignore:'datetime.utcfromtimestamp() is deprecated':DeprecationWarning \
-m coverage run \
-m pytest -p no:randomly {posargs:tests}

0 comments on commit 2a35eb0

Please sign in to comment.