Skip to content

Make tests work when not using virtualenv - #77

Merged
pombredanne merged 1 commit into
aboutcode-org:mainfrom
ngi-nix:test-no-venv
Jul 22, 2022
Merged

Make tests work when not using virtualenv#77
pombredanne merged 1 commit into
aboutcode-org:mainfrom
ngi-nix:test-no-venv

Conversation

@sbruder

@sbruder sbruder commented Jul 22, 2022

Copy link
Copy Markdown
Contributor

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.

@sbruder
sbruder force-pushed the test-no-venv branch 2 times, most recently from f2cedd0 to 2be30b3 Compare July 22, 2022 10:26
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>

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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

@pombredanne
pombredanne merged commit 2282b61 into aboutcode-org:main Jul 22, 2022
@pombredanne

Copy link
Copy Markdown
Member

@sbruder PS: I am always interested on how this library is used. If you care to share that would be great!

@armijnhemel

armijnhemel commented Jul 22, 2022

Copy link
Copy Markdown

@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.

@pombredanne

Copy link
Copy Markdown
Member

@armijnhemel Thanks!

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.

4 participants