-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix/setup #110
Fix/setup #110
Conversation
* importlib.metadata.entry_points changed signature across different Python versions. This commit uses importlib_metadata >= 5, which implements the same APIs as in Python 3.12 Co-authored-by: Tom Morrell <[email protected]>
idutils/ext.py
Outdated
@@ -51,6 +51,8 @@ def get_scheme_config_func(): | |||
from threading import Lock | |||
|
|||
from importlib_metadata import entry_points | |||
# when Python >=3.12, remove importlib_metadata and replace with: | |||
# from importlib.metadata import entry_points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: I guess we don't want a python check and already import the correct package there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am hesitating, because this will be copy/pasted around for sure.... not sure...
I am fixing the tests |
isbnlib>=3.10.8 | ||
|
||
[options.extras_require] | ||
tests = | ||
pytest-black-ng>=0.4.0 | ||
pytest-cache>=1.0 | ||
pytest-invenio>=1.4.0 # required for fixtures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmorrell I had to put it back, @zzacharo very wisely suggested that it was necessary for the entry_points fixtures (and there is a lot code there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, the thought was we could pull out the entry point code....but probably not worth the effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, Thanks!
isbnlib>=3.10.8 | ||
|
||
[options.extras_require] | ||
tests = | ||
pytest-black-ng>=0.4.0 | ||
pytest-cache>=1.0 | ||
pytest-invenio>=1.4.0 # required for fixtures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, the thought was we could pull out the entry point code....but probably not worth the effort.
@@ -54,6 +54,9 @@ def get_scheme_config_func(): | |||
|
|||
from .schemes import IDUTILS_PID_SCHEMES | |||
|
|||
# when Python >=3.12, remove importlib_metadata and replace with: | |||
# from importlib.metadata import entry_points |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried that in 3.12? I don't think it worked for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing, and it should work because importlib_metadata >= 5 has the same implementation as Python 3.12.
From: #109