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

Use importlib instead of pkg_resources #643

Merged
merged 4 commits into from
Jun 29, 2023

Conversation

ndevenish
Copy link
Collaborator

pkg_resources is now deprecated, as importlib has covered most use-cases since python 3.8. We are also starting to see warnings appearing for this, in certain scenarios.

ndevenish and others added 3 commits June 29, 2023 20:54
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@6c6d665). Click here to learn what that means.
The diff coverage is 66.66%.

❗ Current head 42299db differs from pull request most recent head 78b70d5. Consider uploading reports for the commit 78b70d5 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #643   +/-   ##
=======================================
  Coverage        ?   39.39%           
=======================================
  Files           ?      178           
  Lines           ?    15496           
  Branches        ?     2613           
=======================================
  Hits            ?     6104           
  Misses          ?     8832           
  Partials        ?      560           

rjgildea added a commit to dials/dials that referenced this pull request Jun 29, 2023
rjgildea added a commit to dials/dials that referenced this pull request Jun 29, 2023
@ndevenish ndevenish enabled auto-merge (squash) June 29, 2023 21:13
@ndevenish ndevenish merged commit 71d4ec0 into cctbx:main Jun 29, 2023
rjgildea added a commit to dials/dials that referenced this pull request Jun 30, 2023
* Drop Python 3.8 support

Upstream dependencies (e.g. numpy, scipy) have now dropped Python 3.8
support in latest releases.

See also https://dials.github.io/kb/proposals/dc3

* Rename newsfragments/XXX.misc to newsfragments/2445.misc

* Filter out np.product deprecation warning

This comes from h5py, but should be fixed in h5py 3.9.0.
See also h5py/h5py#2242

* Print stderr from failing test

* Also ignore pkg_resources DeprecationWarning

See also cctbx/dxtbx#643

* Also ignore pkg_resources DeprecationWarning

See also cctbx/dxtbx#643

* Missing ,

* More than one pkg_resources DeprecationWarning to catch

* More than one pkg_resources DeprecationWarning to catch

* Try alternative approach based on setting PYTHONWARNINGS

* Update conftest.py

* Update pytest.ini

* Fix check for builtin exceptions

---------

Co-authored-by: DiamondLightSource-build-server <DiamondLightSource-build-server@users.noreply.github.com>
Co-authored-by: Nicholas Devenish <ndevenish@gmail.com>
toastisme pushed a commit to toastisme/dxtbx that referenced this pull request Jul 18, 2024
pkg_resources is now deprecated, as importlib has covered
most use-cases since python 3.8. This removes the code
causing warnings in downstream tests.

Also suppress numpy 'product' warnings when running pytest.
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.

2 participants