-
Notifications
You must be signed in to change notification settings - Fork 39
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
DEP: refactored out runtime dependency on setuptools #258
DEP: refactored out runtime dependency on setuptools #258
Conversation
1417d5d
to
5c78f16
Compare
packaging>=17.0 | ||
|
||
[options.extras_require] | ||
test = | ||
numpy | ||
pytest-remotedata>=0.3.2 | ||
setuptools>=30.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it still needed in test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because some tests (e.g. tests/test_doctestplus.py::test_ufunc
) include an entire setup.py
script that requires setuptools
Just to make sure the failures are related, I reran a previously successful build from 3 days ago: https://github.com/scientific-python/pytest-doctestplus/actions/runs/9950476771 Update: |
Since this removes a required dependency, might need a change log as well. |
yup; failures are related, I'll have a look. |
Failures are specifically hit with pre-releases versions of pytest. I'm going to force push the fix. For ease of read, here it is diff --git a/pytest_doctestplus/utils.py b/pytest_doctestplus/utils.py
index f30e1f5..8a6df5c 100644
--- a/pytest_doctestplus/utils.py
+++ b/pytest_doctestplus/utils.py
@@ -20,7 +20,7 @@ class ModuleChecker:
except Exception:
return None
else:
- if reqs.specifier.contains(dist_meta.version):
+ if reqs.specifier.contains(dist_meta.version, prereleases=True):
return dist_meta
else:
return None |
5c78f16
to
ecd3ae4
Compare
ecd3ae4
to
dd104ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Looks like Squash & Merge not enabled here, so thanks for squashing! |
Yesterday we ran into some issues with the latest version of setuptools at astropy (see this issue for context).
In summary, what happened is that setuptools 71 brought in a couple runtime side effects, resulting in some confusing error messages.
My analysis showed that
setuptools
is only present in the runtime environment that astropy runs tests with because it's brought in by this package, which only requires it for a single line of code, so I refactored it using standard libimportlib.metadata
+packagaging
(which is already a runtime dependency here), eliminatingsetuptools
as a runtime dependency, which down the road eliminates a source of instabilitly for any package that relies on pytest-doctestplus.In case it's not clear (it wasn't to me), note that
pkg_resources
is really part ofsetuptools
and not included in the standard library.