Make tests work when not using virtualenv - #77
Merged
Conversation
sbruder
force-pushed
the
test-no-venv
branch
2 times, most recently
from
July 22, 2022 10:26
f2cedd0 to
2be30b3
Compare
Currently, some of them explicitly reference black via its path inside the virtual environment. In an environment where the venv is not used, but rather the distribution’s packages are used for making the dependencies like black available, this does not work. This changes it to use the black binary from the PATH. Since the official development guidelines document activating the virtualenv before running pytest, which will make the black binary available, it will still work when using the virtual environment. The CI systems (Travis and Azure Pipelines) didn’t activate the virtualenv but rather called pytest directly from the venv. This also changes this so CI also works. Signed-off-by: Simon Bruder <simon@sbruder.de>
gytis-ivaskevicius
approved these changes
Jul 22, 2022
pombredanne
approved these changes
Jul 22, 2022
pombredanne
left a comment
Member
There was a problem hiding this comment.
@sbruder Thank you ++
This makes sense alright. The activation of the virtualenv in the CI is not essential but is harmless so I am merging this now
Member
|
@sbruder PS: I am always interested on how this library is used. If you care to share that would be great! |
This was packaged as part of NGI0 work. I am planning on using it in BANG. |
Member
|
@armijnhemel Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, some of them explicitly reference black via its path inside
the virtual environment. In an environment where the venv is not used,
but rather the distribution’s packages are used for making the
dependencies like black available, this does not work. This changes it
to use the black binary from the PATH.
Since the official development guidelines document activating the
virtualenv before running pytest, which will make the black binary
available, it will still work when using the virtual environment.
The CI systems (Travis and Azure Pipelines) didn’t activate the
virtualenv but rather called pytest directly from the venv. This also
changes this so CI also works.