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

feat: add Python 3.12 support #477

Merged
merged 4 commits into from
May 30, 2024
Merged

feat: add Python 3.12 support #477

merged 4 commits into from
May 30, 2024

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented May 28, 2024

Resolves #446

* docs: Add Python 3.12 PyPI trove classifier
* ci: Add Python 3.12 to CI
* ci: Add workflow dispatch trigger to CI
* ci: List installed Python packages

* Add Python 3.12 to CI test matrix.
* Default to Python 3.12 in GitHub Actions based workflows.
* Use Python 3.12 in pre-commit.
@matthewfeickert matthewfeickert added the enhancement New feature or request label May 28, 2024
@matthewfeickert matthewfeickert self-assigned this May 28, 2024
@matthewfeickert matthewfeickert marked this pull request as draft May 28, 2024 23:07
Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (891fdb0) to head (15104b7).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #477   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         2093      2093           
  Branches       346       346           
=========================================
  Hits          2093      2093           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matthewfeickert
Copy link
Member Author

matthewfeickert commented May 29, 2024

The Python 3.12-only error that is currently being seen from iminuit

Error:
$ python utils/create_ntuples.py
  File "/home/runner/work/cabinetry/cabinetry/example.py", line 3, in <module>
    import cabinetry
  File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/cabinetry/__init__.py", line 7, in <module>
    import cabinetry.fit as fit  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/cabinetry/fit/__init__.py", line 6, in <module>
    import iminuit
  File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/iminuit/__init__.py", line 24, in <module>
    from iminuit.minuit import Minuit
  File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/iminuit/minuit.py", line 6, in <module>
    from iminuit import util as mutil
  File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/iminuit/util.py", line 11, in <module>
    from iminuit import _repr_html, _repr_text, _deprecated
  File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/iminuit/_deprecated.py", line 2, in <module>
    from numpy import VisibleDeprecationWarning
ImportError: cannot import name 'VisibleDeprecationWarning' from 'numpy' (/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/numpy/__init__.py)

is due to scikit-hep/iminuit#977 (comment), but is getting caused by the pre-release of numpy being picked up from scikit-hep/hist#570. So this is a compound issue that would be fixed by a new hist release, but also shows that a new iminuit release would be nice.

* List installed packages during CI.
@matthewfeickert matthewfeickert marked this pull request as ready for review May 29, 2024 14:03
@matthewfeickert
Copy link
Member Author

@alexander-held this should be ready for review now given that hist v2.7.3 is released now.

Copy link
Member

@alexander-held alexander-held left a comment

Choose a reason for hiding this comment

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

Thanks, this all looks good to me!

related previous PR for 3.11 was #400

* add Python 3.12 PyPI trove classifier
* add Python 3.12 to CI
* add workflow dispatch trigger to CI
* list installed Python packages in CI

@alexander-held alexander-held changed the title ci: Add Python 3.12 support feat: add Python 3.12 support May 30, 2024
@alexander-held alexander-held merged commit 7167074 into master May 30, 2024
8 checks passed
@alexander-held alexander-held deleted the ci/add-python-3-12 branch May 30, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Python 3.12
2 participants