-
Notifications
You must be signed in to change notification settings - Fork 88
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 python 3.12 support #2045
Add python 3.12 support #2045
Conversation
I somehow overlooked this in my first commit, where I was supposed to add testing
Python 3.12 tests currently fail due to use of pkg_resources in
https://docs.python.org/3/whatsnew/3.12.html importlib.metadata seems like a viable alternative, starting in Python 3.10. There's a backport, called importlib_metadata, but I don't want to add a dependency, so I think we'll wind up with an if/else and conditional import, for a while. |
Are you sure you need The new Cc: @mshafer-NI |
@bkeryan I'm not going to use it. As I said, I don't want to a new install dependency. I'm going to use pkg_resources for Python 3.8 and 3.9 and importlib.metadata (built-in) for Python 3.10 and later. |
Hmm ... looks like we might still be blocked. travis-ci failed.
I'll have to look into this. |
Looks like grpcio-tools 1.49.1 wheels are restricted to Python 3.10 and Python 3.11. |
nidaqmx already added Python 3.12 support and used grpcio-tools 1.59.0 for Python 3.12. They used grpcio-tools 1.49.1 for Python 3.8 - Python 3.11 and grpcio-tools 1.59.0 for Python 3.12. Here are the compatibility requirements for grpcio-tools:
|
I've added tests applicable for this pull requestWhat does this Pull Request accomplish?
There are 3 major changes made to add Python 3.12 support.
Based on:
I considered updating the version of Python used in the
.readthedocs.yaml
, but I'd rather be intentional about changes to documentation.pkg_resources
in__init__.py
withimportlib.metadata
for Python 3.10 and later.Tests failed on Python 3.12 because we tried to import a non-built-in module (pkg_resources) that we don't declare a dependency on. Full explanation below.
https://docs.python.org/3/whatsnew/3.12.html
Why the if/else implementation?
setuptools
dependency or aimportlib_metadata
dependency (backport ofimportlib.metadata
)importlib.metadata
offers functionality equivalent to what we were doing withpkg_resources
pkg_resources
,importlib.metadata
is built-in.I created #2047 to track the work to drop pkg_resources usage with Python 3.9.
grpcio-tools compatibility for version 1.59.0 (earliest version with Python 3.12 support):
List issues fixed by this Pull Request below, if any.
What testing has been done?
Did a before and after prettyprint of
nise.get_diagnostic_information()
on a local test machine.Using Python 3.12 before:
Using Python 3.12 after:
I also checked the output with Python 3.10.