Remove deprecated pkg_resources and dead version-compat code for Python 3.12#308
Draft
Copilot wants to merge 2 commits into
Draft
Remove deprecated pkg_resources and dead version-compat code for Python 3.12#308Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix deprecation warning for Python 3.12 in postpic
Remove deprecated pkg_resources and dead version-compat code for Python 3.12
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing
postpicon Python 3.12 triggered aDeprecationWarningfrompkg_resources(already replaced withpackagingin #302). This PR removes the remaining dead version-compatibility branches that accumulated across the codebase, which were the original source of these legacy imports.Dead code removed
io/npy.py: Drop numpy < 1.11np.load()branch; always useallow_pickle=True. Remove now-unusedpackagingimport._field_calc.py: Drop numpy < 1.11 fallback paths in_divE2d/_divE3d(including deprecation warnings targeting those old versions). Removepackagingandwarningsimports.datahandling.py: Drop numpy < 1.9 and < 1.13 branches in_derivative(); drop numpy < 1.10norm='ortho'workaround in FFT code. Removepackagingimport.helper.py: Drop scipy < 1.6.0 branch inmap_coordinates_chunk; drop numpy < 1.13 branch inapprox_jacobian. Removepackagingimport._compat/__init__.py: Drop numpy < 1.13 conditional forNDArrayOperatorsMixin; always import fromnumpy.lib.mixins.All removed branches were unreachable given the declared minimums (
numpy>=1.8,scipy>=1.6) and are certainly dead on Python 3.12.