Skip to content

Commit

Permalink
respect --copies for app-data (#1575)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Feb 11, 2020
1 parent 00b7f92 commit 3846057
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit 3846057

Please sign in to comment.