-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support Python 3.12 #471
Support Python 3.12 #471
Conversation
The macOS Python 3.8 build has a weird error. Snippet below: c-blosc/blosc/bitshuffle-avx2.c:22:4: error: AVX2 is not supported by the target architecture/platform and/or this compiler.
#error AVX2 is not supported by the target architecture/platform and/or this compiler.
^
1 error generated. Wonder if we should just drop Python 3.8 based on NEP 29. Raising issue ( zarr-developers/community#65 ) to discuss |
Builds work. Nearly all tests pass However there is one CI error from the tests. It pertains to entrypoints. Snippet of the error below from CI: __________________ ERROR at setup of test_entrypoint_codec ____________________
@pytest.fixture()
def set_path():
sys.path.append(here)
> numcodecs.registry.run_entrypoints()
numcodecs/tests/test_entrypoints.py:15:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def run_entrypoints():
entries.clear()
eps = entry_points()
if hasattr(eps, 'select'):
# If entry_points() has a select method, use that. Python 3.10+
> entries.update(eps.select(group="numcodecs.codecs"))
E ValueError: dictionary update sequence element #0 has length 3; 2 is required
numcodecs/registry.py:16: ValueError |
On Python 3.12, the existing code did not produce a `dict` that could be used to update `entries` whereas previous Python versions had. To workaround this issue, manually create a `dict` that can be used to update `entries` with a format consistent to what had been seen in Python versions before 3.12.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #471 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 2242 2242
=========================================
Hits 2242 2242
|
if hasattr(eps, 'select'): | ||
# If entry_points() has a select method, use that. Python 3.10+ | ||
entries.update(eps.select(group="numcodecs.codecs")) | ||
entries.update({e.name: e for e in eps.select(group="numcodecs.codecs")}) |
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.
@martindurant could you please take a look at this change?
cc @joshmoore @MSanKeys963 @rabernat (in case any of you have time to review) |
Going to go ahead and merge to get the release out. Hope that is ok Happy to discuss further as needed |
* Support Python 3.12 * Ensure `entries.update(...)` recieves a `dict` On Python 3.12, the existing code did not produce a `dict` that could be used to update `entries` whereas previous Python versions had. To workaround this issue, manually create a `dict` that can be used to update `entries` with a format consistent to what had been seen in Python versions before 3.12.
Add support for Python 3.12.
TODO: