Skip to content

bugfix: stopit import causes exception#1394

Open
reevesc7 wants to merge 4 commits intoEpistasisLab:devfrom
reevesc7:fix-stopit
Open

bugfix: stopit import causes exception#1394
reevesc7 wants to merge 4 commits intoEpistasisLab:devfrom
reevesc7:fix-stopit

Conversation

@reevesc7
Copy link

What does this PR do?

This PR fixes importing stopit by adding a fake pkg_resources module with a get_distribution() function.

Where should the reviewer start?

tpot.utils.eval_utils.py is the only changed file.

How should this PR be tested?

The PR passed local tests and CI tests.

Any background context you want to provide?

This PR serves as an alternative to #1391, and only one of the two should be merged.

stopit is the only TPOT dependency which depends on pkg_resources.
pkg_resources has been removed from setuptools, so importing stopit raises and exception.

This PR creates a faux pkg_resources module which contains a get_distribution() function (the only call stopit makes).
Under the hood, the faux module uses the modern dynamic package versioning solution importlib.metadata.version().

Because my branch was originally created from EpistatisLab:main, this PR also merges those commits into EpistasisLab:dev.

What are the relevant issues?

#1391 is an alternative solution, which removes stopit dependency entirely.

Questions:

  • Do the docs need to be updated? No
  • Does this PR add new (Python) dependencies? No

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