From dbc1376ba79de346b4df8dc920e2d670c9886d04 Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Tue, 11 Feb 2020 13:46:20 +0000 Subject: [PATCH] respect --copies for app-data Signed-off-by: Bernat Gabor --- src/virtualenv/seed/via_app_data/via_app_data.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/virtualenv/seed/via_app_data/via_app_data.py b/src/virtualenv/seed/via_app_data/via_app_data.py index 069a9c1c5..9bfd9d123 100644 --- a/src/virtualenv/seed/via_app_data/via_app_data.py +++ b/src/virtualenv/seed/via_app_data/via_app_data.py @@ -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 @@ -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): @@ -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):