-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
e3167ac
commit 2d2a275
Showing
6 changed files
with
126 additions
and
24 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
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,35 @@ | ||
"""Test fixtures and configuration.""" | ||
|
||
from __future__ import division | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import uuid | ||
|
||
import pytest | ||
|
||
from venvctrl import api | ||
|
||
|
||
def pytest_generate_tests(metafunc): | ||
if "use_stdlib_venv" in metafunc.fixturenames: | ||
metafunc.parametrize("use_stdlib_venv", (True, False)) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def random(): | ||
"""Get a random UUID.""" | ||
return str(uuid.uuid4()) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def venv(random, tmpdir, use_stdlib_venv): | ||
"""Get an initialized venv.""" | ||
path = str(tmpdir.join(random)) | ||
v = api.VirtualEnvironment(path) | ||
if not use_stdlib_venv: | ||
v.create() | ||
else: | ||
v._execute("python -m venv {0}".format(path)) | ||
return v |
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
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