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

Fix/setup #110

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Fix/setup #110

merged 3 commits into from
Oct 31, 2024

Conversation

ntarocco
Copy link
Contributor

@ntarocco ntarocco commented Oct 31, 2024

From: #109

ntarocco and others added 2 commits October 31, 2024 15:07
* 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
Copy link
Member

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?

Copy link
Contributor Author

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...

@ntarocco
Copy link
Contributor Author

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
Copy link
Contributor Author

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).

Copy link
Contributor

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.

Copy link
Contributor

@tmorrell tmorrell left a 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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@ntarocco ntarocco merged commit 741ed41 into inveniosoftware:master Oct 31, 2024
2 checks passed
@ntarocco ntarocco deleted the fix/setup branch October 31, 2024 15:49
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.

3 participants