Skip to content

Remove deprecated pkg_resources and dead version-compat code for Python 3.12#308

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-python-3-12-deprecation-warning
Draft

Remove deprecated pkg_resources and dead version-compat code for Python 3.12#308
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-python-3-12-deprecation-warning

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Importing postpic on Python 3.12 triggered a DeprecationWarning from pkg_resources (already replaced with packaging in #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.11 np.load() branch; always use allow_pickle=True. Remove now-unused packaging import.
  • _field_calc.py: Drop numpy < 1.11 fallback paths in _divE2d/_divE3d (including deprecation warnings targeting those old versions). Remove packaging and warnings imports.
  • datahandling.py: Drop numpy < 1.9 and < 1.13 branches in _derivative(); drop numpy < 1.10 norm='ortho' workaround in FFT code. Remove packaging import.
  • helper.py: Drop scipy < 1.6.0 branch in map_coordinates_chunk; drop numpy < 1.13 branch in approx_jacobian. Remove packaging import.
  • _compat/__init__.py: Drop numpy < 1.13 conditional for NDArrayOperatorsMixin; always import from numpy.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.

Copilot AI linked an issue Jun 8, 2026 that may be closed by this pull request
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
Copilot AI requested a review from skuschel June 8, 2026 13:42
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.

python 3.12 deprecation warning

2 participants