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

Fix download is True by default #1813

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/1813.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix download is ``True`` by default - by :user:`gaborbernat`.
14 changes: 7 additions & 7 deletions src/virtualenv/seed/embed/base_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ def package_version(self):
@classmethod
def add_parser_arguments(cls, parser, interpreter, app_data):
group = parser.add_mutually_exclusive_group()
group.add_argument(
"--download",
dest="download",
action="store_true",
help="pass to enable download of the latest {} from PyPI".format("/".join(cls.packages)),
default=False,
)
group.add_argument(
"--no-download",
"--never-download",
Expand All @@ -60,6 +53,13 @@ def add_parser_arguments(cls, parser, interpreter, app_data):
help="pass to disable download of the latest {} from PyPI".format("/".join(cls.packages)),
default=True,
)
group.add_argument(
"--download",
dest="download",
action="store_true",
help="pass to enable download of the latest {} from PyPI".format("/".join(cls.packages)),
default=False,
)
parser.add_argument(
"--extra-search-dir",
metavar="d",
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/seed/test_base_embed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest

from virtualenv.run import session_via_cli


@pytest.mark.parametrize(
"args, download", [([], False), (["--no-download"], False), (["--never-download"], False), (["--download"], True)]
)
def test_download_cli_flag(args, download, tmp_path):
session = session_via_cli(args + [str(tmp_path)])
assert session.seeder.download is download