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

refactor: Use importlib.metadata to define version, support Python 3.12 #68

Closed
wants to merge 2 commits into from

Conversation

fghaas
Copy link
Contributor

@fghaas fghaas commented Dec 20, 2023

We previously made use of the pkg_resources module to determine the package version (as defined by setuptools-scm) in __about__.py. This module is included in setuptools, which as of Python 3.12 has been removed from the standard library and is now its own third-party package.

There are multiple ways to address this, one being to include setuptools in the install_requires list for Python 3.12 and later. Another, also listed in the Python Packaging User Guide, is to instead use importlib.metadata.version. Since this approach works for all Python versions we intend to support (that is, from 3.8 forward), this is the better solution.

Thus, refactor __about__.py to use importlib, and add Python 3.12 to the test matrix.

Reference:
https://packaging.python.org/en/latest/guides/single-sourcing-package-version/

We previously made use of the pkg_resources module to determine the
package version (as defined by setuptools-scm) in __about__.py. This
module is included in setuptools, which as of Python 3.12 has been
removed from the standard library and is now its own third-party
package.

There are multiple ways to address this, one being to include
setuptools in the install_requires list for Python 3.12 and
later. Another, also listed in the Python Packaging User Guide, is to
instead use importlib.metadata.version. Since this approach works for
all Python versions we intend to support (that is, from 3.8 forward),
this is the better solution.

Thus, refactor __about__.py to use importlib, and add Python 3.12 to
the test matrix.

Note that Tutor itself does not support Python 3.12 prior to version
17, so we cannot support the combination of Python 3.12 and Tutor
version 16 or earlier.

Reference:
https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
@gabor-boros
Copy link
Contributor

@fghaas are you planning to merge this PR?

@fghaas
Copy link
Contributor Author

fghaas commented Jul 31, 2024

@fghaas are you planning to merge this PR?

Nope, sorry for not closing this one. #66 covered support for Quince, and we added Python 3.12 support in #73 — so everything that this PR covers should already be included in the codebase. :)

@fghaas fghaas closed this Jul 31, 2024
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.

2 participants