-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
vendoring: remove dependency on setuptools from vendored pytest #15612
Conversation
@adamjstewart: can you try this out and see if it allows you to test within your spack environment successfully? |
299d1ba
to
71edbca
Compare
I'm able to get tests working in a bare python (no |
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.
This looks like it will work but IMO should be edited for clarity. Right now I think it's not clear from reading the code why turning these functions into noops is "OK" (i.e. why they don't cause the rest of the code to break).
71edbca
to
4fccede
Compare
@scheibelp: ready for re-review. |
4fccede
to
3e7c07f
Compare
I made some changes based on @scheibelp's comments that simplify this quite a bit. |
Previously, `spack test` would fail within a new spack environment, because it could not import `pkg_resources` (part of `setuptools`) Parts of `pytest` use `setuptools`, but we do not need them for Spack, so it's an unnecessary dependency. - [x] Remove calls to parts of `pytest` that need setuptools
3e7c07f
to
441e4ad
Compare
@scheibelp: I removed both functions -- I suppose that does make it much less likely someone will reintroduce this bug. |
Thanks! |
Closes #15369.
Closes #9034.
Follow-up of #9261.
Previously,
spack test
would fail within a new spack environment, because it could not importpkg_resources
(part ofsetuptools
) Parts ofpytest
usesetuptools
, but we do not need them for Spack, so it's an unnecessary dependency.Patching
pytest
is nasty but it's a lot simpler than vendoring yet another mess of packages. Also, recent versions ofpytest
do not depend onsetuptools
(see pytest-dev/pytest#5063). We're just stuck with an old version ofpytest
because we still support Python 2.6.Astute readers may note that
jinja2
also usespkg_resources
, but we don't use any parts of it that actually importpkg_resources
. So we do not need to remove these imports fromjinja2
.pytest
that need setuptools