Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.12 #956

Merged
merged 3 commits into from Oct 24, 2023
Merged

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Sep 17, 2023

The second Python 3.12 release candidate is out! πŸš€

Call to action

We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.12 compatibilities during this phase, and where necessary publish Python 3.12 wheels on PyPI to be ready for the final release of 3.12.0.

Python 3.12.0 final is due out in two weeks: 2023-10-02.


Tested locally via tox:

❯ tox -e py312
py312: install_deps> python -I -m pip install attrs coverage pytest
.pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel
.pkg: _optional_hooks> python /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_wheel> python /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: install_requires_for_build_wheel> python -I -m pip install wheel
.pkg: prepare_metadata_for_build_wheel> python /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py312: install_package> python -I -m pip install --force-reinstall --no-deps /private/tmp/client_python/.tox/.tmp/package/1/prometheus_client-0.17.1.tar.gz
py312: commands[0]> coverage run --parallel -m pytest
======================================================================================= test session starts ========================================================================================
platform darwin -- Python 3.12.0rc2, pytest-7.4.2, pluggy-1.3.0
cachedir: .tox/py312/.pytest_cache
rootdir: /private/tmp/client_python
collected 303 items

tests/test_asgi.py ssssssss                                                                                                                                                                  [  2%]
tests/test_core.py ...................................................................................................                                                                       [ 35%]
tests/test_exposition.py ..........................................................                                                                                                          [ 54%]
tests/test_gc_collector.py ..                                                                                                                                                                [ 55%]
tests/test_graphite_bridge.py .......                                                                                                                                                        [ 57%]
tests/test_multiprocess.py ..........................                                                                                                                                        [ 66%]
tests/test_parser.py ........................                                                                                                                                                [ 73%]
tests/test_platform_collector.py ..                                                                                                                                                          [ 74%]
tests/test_process_collector.py ....                                                                                                                                                         [ 75%]
tests/test_twisted.py s                                                                                                                                                                      [ 76%]
tests/test_wsgi.py .......                                                                                                                                                                   [ 78%]
tests/openmetrics/test_exposition.py ....................                                                                                                                                    [ 85%]
tests/openmetrics/test_parser.py .............................................                                                                                                               [100%]

================================================================================== 294 passed, 9 skipped in 5.26s ==================================================================================
.pkg: _exit> python /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
  py312: OK (11.09=setup[4.66]+cmd[6.43] seconds)
  congratulations :) (11.17 seconds)

Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Similar to what you did for python 3.10, would you be willing to update setup.py and .circleci/config.yml as well? If not I can do that in a separate PR.

Signed-off-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Signed-off-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Signed-off-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@hugovk
Copy link
Contributor Author

hugovk commented Sep 19, 2023

Done, but it looks like CircleCI doesn't support Python 3.12 yet?


Starting container cimg/python:3.12
Warning: No authentication provided, using CircleCI credentials for pulls from Docker Hub.
  image cache not found on this host, downloading cimg/python:3.12

Error response from daemon: manifest for cimg/python:3.12 not found: manifest unknown: manifest unknown

@csmarchbanks
Copy link
Member

Ah bummer, it does look that way. If it is ok I will leave this for a couple weeks until there is a 3.12 image and I can re-run the test then?

Since the tests all pass for you locally we shouldn't need to update anything at least!

@hugovk
Copy link
Contributor Author

hugovk commented Sep 19, 2023

Fine by me to wait for the image :)

Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reran the 3.12 test now that there is an image. Thanks!

@csmarchbanks csmarchbanks merged commit 2f6bd47 into prometheus:master Oct 24, 2023
11 checks passed
@hugovk hugovk deleted the add-3.12 branch October 24, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants