Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use importlib.metadata to define version, support Python 3.12
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/
- Loading branch information