-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the build-venv auto-activate fully instead of changing how zap-c…
…li is located
- Loading branch information
1 parent
38575f2
commit b8edd5c
Showing
4 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import venvactivate |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Activates the current venv as if the activate script had been sourced | ||
import collections | ||
import os | ||
import sys | ||
|
||
# Prepend the venv bin to PATH (without introducing duplicate entries) | ||
path = [os.path.join(sys.prefix, 'bin')] + os.environ['PATH'].split(':') | ||
os.environ['PATH'] = ':'.join(collections.OrderedDict.fromkeys(path).keys()) | ||
|
||
# Set VIRTUAL_ENV to the venv directory | ||
os.environ['VIRTUAL_ENV'] = sys.prefix |
This file contains 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