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

Add provisional stdlib venv support #29

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

kevinconway
Copy link
Owner

This patch modifies the way the bash activate script is handled to work with both virtualenv and the python3 bundled venv. The venv version had a recent change for windows support that caused it to diverge from how virtualenv solved the same cygwin related problems. So there are now two totally different bash activation scripts depending on which tool you use.

The venv style puts the literal path text in several location whereas every other script in both venv and virtualenv puts the literal text only once in a variable and then references the variable. To change multiple path strings I had to rewrite the path replacement mechanism for bash to bulk rewrite every line that contains the path rather than a targeted line replacement like before.

I'm not sure how much more venv will diverge from virtualenv in the future but this should enable it to work for now.

This patch modifies the way the bash activate script is handled to work
with both virtualenv and the python3 bundled venv. The venv version
had a recent change for windows support that caused it to diverge from
how virtualenv solved the same cygwin related problems. So there are now
two totally different bash activation scripts depending on which tool
you use.

The venv style puts the literal path text in several location whereas
every other script in both venv and virtualenv puts the literal text
only once in a variable and then references the variable. To change
multiple path strings I had to rewrite the path replacement mechanism
for bash to bulk rewrite every line that contains the path rather than a
targeted line replacement like before.

I'm not sure how much more venv will diverge from virtualenv in the
future but this should enable it to work for now.
Copy link

@mattthhh mattthhh left a comment

Choose a reason for hiding this comment

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

Ready to merge (better than mine...)

@kevinconway kevinconway merged commit c1dc019 into master Jun 14, 2024
7 checks passed
@kevinconway kevinconway deleted the provisional_venv_support branch June 14, 2024 13:23
@kevinconway
Copy link
Owner Author

Thanks for the code review!

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.

2 participants