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

respect --copies for app-data #1575

Merged
merged 1 commit into from
Feb 11, 2020
Merged
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/1575.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Respect the :option:`copies` flag inside the ``app-data`` :option:`seeder` by :user:`gaborbernat`.
8 changes: 3 additions & 5 deletions src/virtualenv/seed/via_app_data/via_app_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import six

from virtualenv.dirs import default_data_dir
from virtualenv.info import IS_WIN
from virtualenv.seed.embed.base_embed import BaseEmbed
from virtualenv.seed.embed.wheels.acquire import get_wheels

Expand All @@ -22,6 +21,7 @@ def __init__(self, options):
super(FromAppData, self).__init__(options)
self.clear = options.clear_app_data
self.app_data_dir = default_data_dir() / "seed-v1"
self.symlinks = getattr(options, "copies", False) is False

@classmethod
def add_parser_arguments(cls, parser, interpreter):
Expand Down Expand Up @@ -86,10 +86,8 @@ def _get(package, version):

yield name_to_whl

@staticmethod
def installer_class(pip_version):
# tbd: on Windows symlinks are unreliable, we have junctions for folders, however pip does not work well with it
if not IS_WIN:
def installer_class(self, pip_version):
if self.symlinks:
# symlink support requires pip 19.3+
pip_version_int = tuple(int(i) for i in pip_version.split(".")[0:2])
if pip_version_int >= (19, 3):
Expand Down