-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handling of conflicting --copies and --symlinks
Introduce priority of where the option is set to follow the order: cli, env var, file, hard coded. If both set at same level prefer copy over symlink. Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
- Loading branch information
1 parent
01b09f6
commit 7ac943d
Showing
10 changed files
with
123 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Better handling of optionlicting :option:`copies` and :option:`symlinks`. Introduce priority of where the option is set | ||
to follow the order: CLI, env var, file, hardcoded. If both set at same level prefers copy over symlink. - by | ||
user:`gaborbernat`. |
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
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
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,28 @@ | ||
from __future__ import unicode_literals | ||
|
||
from textwrap import dedent | ||
|
||
import pytest | ||
|
||
from virtualenv.info import fs_supports_symlink | ||
from virtualenv.run import session_via_cli | ||
from virtualenv.util.six import ensure_str | ||
|
||
|
||
@pytest.mark.skipif(not fs_supports_symlink(), reason="symlink is not supported") | ||
def test_ini_can_be_overwritten_by_flag(tmp_path, monkeypatch): | ||
custom_ini = tmp_path / "conf.ini" | ||
custom_ini.write_text( | ||
dedent( | ||
""" | ||
[virtualenv] | ||
copies = True | ||
""" | ||
) | ||
) | ||
monkeypatch.setenv(ensure_str("VIRTUALENV_CONFIG_FILE"), str(custom_ini)) | ||
|
||
result = session_via_cli(["venv", "--symlinks"]) | ||
|
||
symlinks = result.creator.symlinks | ||
assert symlinks is True |
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