Skip to content

Conversation

@graingert
Copy link
Member

@graingert graingert commented Mar 10, 2022

re: https://setuptools.pypa.io/en/latest/pkg_resources.html

Use of pkg_resources is discouraged in favor of importlib.resources, importlib.metadata, and their backports (resources, metadata). Please consider using those libraries instead of pkg_resources.

  • Closes #xxxx
  • Tests added / passed
  • Passes pre-commit run --all-files

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2022

Unit Test Results

       12 files  ±0         12 suites  ±0   6h 4m 15s ⏱️ + 11m 58s
  2 653 tests ±0    2 571 ✔️ +1    80 💤 ±0  2  - 1 
13 021 runs  ±0  12 380 ✔️ ±0  638 💤 +1  3  - 1 

For more details on these failures, see this check.

Results for commit 266c14e. ± Comparison against base commit 7a69b5e.

♻️ This comment has been updated with latest results.

@graingert graingert force-pushed the drop-pkg-resources-dep branch 2 times, most recently from 7f66f83 to 7c5e8f7 Compare March 15, 2022 09:57
@graingert graingert marked this pull request as ready for review March 15, 2022 09:57
Comment on lines -1317 to -1318
# Code adapted from pandas backend entry point testing
# https://github.com/pandas-dev/pandas/blob/2470690b9f0826a8feb426927694fa3500c3e8d2/pandas/tests/plotting/test_backend.py#L50-L76
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pandas test_register_entrypoint now looks like this: https://github.com/pandas-dev/pandas/blob/48d515958d5805f0e62e34b7424097e5575089a8/pandas/tests/plotting/test_backend.py#L47-L62

I used:

    monkeypatch.syspath_prepend(tmp_path)
    monkeypatch.setitem(sys.modules, "pandas_dummy_backend", dummy_backend)

in the pandas version of this PR because they already do a lot of mutating of sys.modules so figured a sys.path mutation wasn't so bad. Here I use a multiprocessing.Pool(1) to isolate sys.modules and sys.path changes

@graingert graingert force-pushed the drop-pkg-resources-dep branch from 7c5e8f7 to 266c14e Compare March 15, 2022 13:51
@graingert graingert requested a review from crusaderky March 15, 2022 15:56
@graingert graingert self-assigned this Mar 15, 2022
Copy link
Collaborator

@crusaderky crusaderky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

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