Skip to content
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

Make sure uv installs into the right virtualenv #116

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

davisagli
Copy link
Member

If a different virtualenv is active while running make install, then uv will detect it and install there instead of into .venv. (See https://docs.astral.sh/uv/pip/environments/#using-arbitrary-python-environments) Then other commands fail, such as in plone/cookieplone#38

To avoid this we can explicitly set the VIRTUAL_ENV environment variable. (See https://docs.astral.sh/uv/pip/environments/#using-arbitrary-python-environments)

I tested and this avoids the problem that happened in plone/cookieplone#38

Copy link

@yurj yurj left a comment

Choose a reason for hiding this comment

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

ok for me

Copy link
Member

@loechel loechel left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks for the fix

Copy link
Member

@petschki petschki left a comment

Choose a reason for hiding this comment

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

I can report, that this works with a python -m venv venv virtualenv. However my special case with pyenv virtualenv plugin still doesn't work (same error again), but I would say that's an edge case and blame it on this special environment likely not following the python virtualization standards. So generally approved from me ...

@petschki
Copy link
Member

petschki commented Nov 26, 2024

UPDATE: forget my comment about pyenv virtualenv ... I forgot to pick this changes before make install it in this environment 🙈

It also works for pyenv virtualenv environments like it should!

So thanks for this one!

@davisagli davisagli merged commit 2893d4c into main Nov 26, 2024
6 checks passed
@davisagli davisagli deleted the fix-with-active-venv branch November 26, 2024 19:14
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