Repository: pypa/virtualenv

Issue:
--download flag doesn't work
**Issue**

The virtualenv user guide suggests to pass `--download` flag to create a virtual environment with the latest pip and setuptools from PyPi:

> If neither of the locations contain the requested wheel version or `--download` option is set will use pip download to load the latest version available from the index server. 

However, after typing `python3 ./virtualenv.pyz --download dest` in terminal I end up with pip==21.1.1, setuptools==56.0.0, wheel==0.36.2, while there's setuptools==56.2.0 available on PyPi.

**Environment**

- OS: MacOS 10.15.7, also reproducible on Ubuntu 20.04
- I'm using the zipapp version of virtualenv==20.4.6
 

**Output of the virtual environment creation**

On MacOS:

```
1049 setup logging to NOTSET [DEBUG report:43]
1203 find interpreter for spec PythonSpec(path=/Library/Developer/CommandLineTools/usr/bin/python3) [INFO builtin:62]
1203 proposed PythonInfo(spec=CPython3.7.3.final.0-64, exe=/Library/Developer/CommandLineTools/usr/bin/python3, platform=darwin, version='3.7.3 (default, Sep  5 2019, 17:14:41) \n[Clang 11.0.0 (clang-1100.0.33.8)]', encoding_fs_io=utf-8-UTF-8) [INFO builtin:69]
1203 accepted PythonInfo(spec=CPython3.7.3.final.0-64, exe=/Library/Developer/CommandLineTools/usr/bin/python3, platform=darwin, version='3.7.3 (default, Sep  5 2019, 17:14:41) \n[Clang 11.0.0 (clang-1100.0.33.8)]', encoding_fs_io=utf-8-UTF-8) [DEBUG builtin:71]
1213 filesystem is not case-sensitive [DEBUG info:28]
1248 create virtual environment via CPython3macOsFramework(dest=/Users/lada.gagina/Downloads/venv-test8, clear=False, no_vcs_ignore=False, global=False) [INFO session:52]
1248 create folder /Users/lada.gagina/Downloads/venv-test8/bin [DEBUG _sync:25]
1249 create folder /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages [DEBUG _sync:25]
1250 write /Users/lada.gagina/Downloads/venv-test8/pyvenv.cfg [DEBUG pyenv_cfg:34]
1250  home = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7 [DEBUG pyenv_cfg:38]
1250  implementation = CPython [DEBUG pyenv_cfg:38]
1250  version_info = 3.7.3.final.0 [DEBUG pyenv_cfg:38]
1250  virtualenv = 20.4.6 [DEBUG pyenv_cfg:38]
1250  include-system-site-packages = false [DEBUG pyenv_cfg:38]
1250  base-prefix = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7 [DEBUG pyenv_cfg:38]
1250  base-exec-prefix = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7 [DEBUG pyenv_cfg:38]
1250  base-executable = /Library/Developer/CommandLineTools/usr/bin/python3 [DEBUG pyenv_cfg:38]
1251 symlink /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python to /Users/lada.gagina/Downloads/venv-test8/bin/python [DEBUG _sync:44]
1251 symlink /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/Python3 to /Users/lada.gagina/Downloads/venv-test8/.Python [DEBUG _sync:44]
1252 Attempting to acquire lock 4369875688 on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/_virtualenv.py.lock [DEBUG filelock:270]
1252 Lock 4369875688 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/_virtualenv.py.lock [INFO filelock:274]
1253 Attempting to release lock 4369875688 on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/_virtualenv.py.lock [DEBUG filelock:315]
1253 Lock 4369875688 released on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/_virtualenv.py.lock [INFO filelock:318]
1254 create virtualenv import hook file /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/_virtualenv.pth [DEBUG api:95]
1254 create /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/_virtualenv.py [DEBUG api:98]
1255 ============================== target debug ============================== [DEBUG session:54]
1255 Attempting to acquire lock 4381066688 on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/debug.py.lock [DEBUG filelock:270]
1256 Lock 4381066688 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/debug.py.lock [INFO filelock:274]
1256 debug via /Users/lada.gagina/Downloads/venv-test8/bin/python '/Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/debug.py' [DEBUG creator:224]
1320 Attempting to release lock 4381066688 on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/debug.py.lock [DEBUG filelock:315]
1321 Lock 4381066688 released on /Users/lada.gagina/Library/Application Support/virtualenv/unzip/20.4.6/debug.py.lock [INFO filelock:318]
1255 {
  "sys": {
    "executable": "/Library/Developer/CommandLineTools/usr/bin/python3",
    "_base_executable": "/Library/Developer/CommandLineTools/usr/bin/python3",
    "prefix": "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7",
    "base_prefix": "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7",
    "real_prefix": null,
    "exec_prefix": "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7",
    "base_exec_prefix": "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7",
    "path": [
      "/Users/lada.gagina/Downloads",
      "/usr/local/lib/python2.7/site-packages",
      "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python37.zip",
      "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7",
      "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/lib-dynload",
      "/Users/lada.gagina/Library/Python/3.7/lib/python/site-packages",
      "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages",
      "/Library/Python/3.7/site-packages"
    ],
    "meta_path": [
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "UTF-8"
  },
  "version": "3.7.3 (default, Sep  5 2019, 17:14:41) \n[Clang 11.0.0 (clang-1100.0.33.8)]",
  "makefile_filename": "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin/Makefile",
  "os": "<module 'os' from '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/os.py'>",
  "site": "<module 'site' from '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site.py'>",
  "datetime": "<module 'datetime' from '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/datetime.py'>",
  "math": "<module 'math' from '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/lib-dynload/math.cpython-37m-darwin.so'>",
  "json": "<module 'json' from '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/json/__init__.py'>"
} [DEBUG session:55]
1321 add seed packages via FromAppData(download=True, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/lada.gagina/Library/Application Support/virtualenv) [INFO session:59]
1322 Attempting to acquire lock 4381067640 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [DEBUG filelock:270]
1323 Lock 4381067640 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [INFO filelock:274]
1323 Attempting to acquire lock 4381067192 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [DEBUG filelock:270]
1323 Lock 4381067192 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [INFO filelock:274]
1323 Attempting to release lock 4381067192 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [DEBUG filelock:315]
1323 Lock 4381067192 released on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [INFO filelock:318]
1323 Attempting to release lock 4381067640 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [DEBUG filelock:315]
1324 Attempting to acquire lock 4381067360 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [DEBUG filelock:270]
1324 Lock 4381067640 released on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [INFO filelock:318]
1324 Lock 4381067360 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [INFO filelock:274]
1324 Attempting to release lock 4381067360 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [DEBUG filelock:315]
1325 Lock 4381067360 released on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [INFO filelock:318]
1326 got embed update of distribution pip from /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/embed/1/pip.json [DEBUG via_disk_folder:135]
1326 got embed update of distribution setuptools from /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/embed/1/setuptools.json [DEBUG via_disk_folder:135]
1326 got embed update of distribution wheel from /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/embed/1/wheel.json [DEBUG via_disk_folder:135]
1335 got embed update of distribution pip from /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/embed/1/pip.json [DEBUG via_disk_folder:135]
1335 got embed update of distribution wheel from /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/embed/1/wheel.json [DEBUG via_disk_folder:135]
1335 got embed update of distribution setuptools from /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/embed/1/setuptools.json [DEBUG via_disk_folder:135]
1336 install pip from wheel /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
1336 install wheel from wheel /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
1336 install setuptools from wheel /Users/lada.gagina/Library/Application Support/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
1337 Attempting to acquire lock 4381065736 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [DEBUG filelock:270]
1337 Attempting to acquire lock 4386028288 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [DEBUG filelock:270]
1337 Attempting to acquire lock 4381067752 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [DEBUG filelock:270]
1338 Lock 4381067752 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [INFO filelock:274]
1338 Lock 4381065736 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [INFO filelock:274]
1338 Lock 4386028288 acquired on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [INFO filelock:274]
1338 Attempting to release lock 4381067752 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [DEBUG filelock:315]
1338 Attempting to release lock 4381065736 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [DEBUG filelock:315]
1338 Lock 4381067752 released on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [INFO filelock:318]
1338 Lock 4381065736 released on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [INFO filelock:318]
1338 Attempting to release lock 4386028288 on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [DEBUG filelock:315]
1339 Lock 4386028288 released on /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [INFO filelock:318]
1339 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any/wheel-0.36.2.dist-info to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/wheel-0.36.2.dist-info [DEBUG _sync:52]
1339 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/setuptools-56.0.0.dist-info to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/setuptools-56.0.0.dist-info [DEBUG _sync:52]
1340 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any/pip-21.1.1.dist-info to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/pip-21.1.1.dist-info [DEBUG _sync:52]
1346 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any/wheel to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/wheel [DEBUG _sync:52]
1347 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any/pip to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/pip [DEBUG _sync:52]
1349 copy /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/setuptools-56.0.0.virtualenv to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/setuptools-56.0.0.virtualenv [DEBUG _sync:52]
1349 copy /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/distutils-precedence.pth to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/distutils-precedence.pth [DEBUG _sync:52]
1351 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/setuptools to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/setuptools [DEBUG _sync:52]
1362 copy /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any/wheel-0.36.2.virtualenv to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/wheel-0.36.2.virtualenv [DEBUG _sync:52]
1364 generated console scripts wheel wheel-3.7 wheel3.7 wheel3 [DEBUG base:48]
1444 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/pkg_resources to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/pkg_resources [DEBUG _sync:52]
1458 copy directory /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/_distutils_hack to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/_distutils_hack [DEBUG _sync:52]
1460 generated console scripts  [DEBUG base:48]
1664 copy /Users/lada.gagina/Library/Application Support/virtualenv/wheel/3.7/image/1/CopyPipInstall/pip-21.1.1-py3-none-any/pip-21.1.1.virtualenv to /Users/lada.gagina/Downloads/venv-test8/lib/python3.7/site-packages/pip-21.1.1.virtualenv [DEBUG _sync:52]
1666 generated console scripts pip-3.7 pip3.7 pip pip3 [DEBUG base:48]
1666 add activators for Bash, CShell, Fish, PowerShell, Python, Xonsh [INFO session:66]
1668 write /Users/lada.gagina/Downloads/venv-test8/pyvenv.cfg [DEBUG pyenv_cfg:34]
1668  home = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7 [DEBUG pyenv_cfg:38]
1668  implementation = CPython [DEBUG pyenv_cfg:38]
1668  version_info = 3.7.3.final.0 [DEBUG pyenv_cfg:38]
1668  virtualenv = 20.4.6 [DEBUG pyenv_cfg:38]
1668  include-system-site-packages = false [DEBUG pyenv_cfg:38]
1668  base-prefix = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7 [DEBUG pyenv_cfg:38]
1668  base-exec-prefix = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7 [DEBUG pyenv_cfg:38]
1668  base-executable = /Library/Developer/CommandLineTools/usr/bin/python3 [DEBUG pyenv_cfg:38]
1668 created virtual environment CPython3.7.3.final.0-64 in 621ms
  creator CPython3macOsFramework(dest=/Users/lada.gagina/Downloads/venv-test8, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=True, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/lada.gagina/Library/Application Support/virtualenv)
    added seed packages: pip==21.1.1, setuptools==56.0.0, wheel==0.36.2
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator [WARNING __main__:19]
```

On Ubuntu:

```
133 setup logging to NOTSET [DEBUG report:43]
175 find interpreter for spec PythonSpec(path=/usr/bin/python3) [INFO builtin:62]
175 proposed PythonInfo(spec=CPython3.8.5.final.0-64, exe=/usr/bin/python3, platform=linux, version='3.8.5 (default, Jan 27 2021, 15:41:15) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) [INFO builtin:69]
176 accepted PythonInfo(spec=CPython3.8.5.final.0-64, exe=/usr/bin/python3, platform=linux, version='3.8.5 (default, Jan 27 2021, 15:41:15) \n[GCC 9.3.0]', encoding_fs_io=utf-8-utf-8) [DEBUG builtin:71]
184 filesystem is case-sensitive [DEBUG info:28]
230 create virtual environment via CPython3Posix(dest=/home/parallels/Documents/venv-test, clear=False, no_vcs_ignore=False, global=False) [INFO session:52]
231 create folder /home/parallels/Documents/venv-test/bin [DEBUG _sync:25]
231 create folder /home/parallels/Documents/venv-test/lib/python3.8/site-packages [DEBUG _sync:25]
231 write /home/parallels/Documents/venv-test/pyvenv.cfg [DEBUG pyenv_cfg:34]
231 	home = /usr [DEBUG pyenv_cfg:38]
231 	implementation = CPython [DEBUG pyenv_cfg:38]
231 	version_info = 3.8.5.final.0 [DEBUG pyenv_cfg:38]
231 	virtualenv = 20.4.6 [DEBUG pyenv_cfg:38]
231 	include-system-site-packages = false [DEBUG pyenv_cfg:38]
231 	base-prefix = /usr [DEBUG pyenv_cfg:38]
231 	base-exec-prefix = /usr [DEBUG pyenv_cfg:38]
231 	base-executable = /usr/bin/python3 [DEBUG pyenv_cfg:38]
231 symlink /usr/bin/python3 to /home/parallels/Documents/venv-test/bin/python [DEBUG _sync:44]
232 Attempting to acquire lock 139626831533008 on /home/parallels/.local/share/virtualenv/unzip/20.4.6/_virtualenv.py.lock [DEBUG filelock:270]
232 Lock 139626831533008 acquired on /home/parallels/.local/share/virtualenv/unzip/20.4.6/_virtualenv.py.lock [INFO filelock:274]
233 Attempting to release lock 139626831533008 on /home/parallels/.local/share/virtualenv/unzip/20.4.6/_virtualenv.py.lock [DEBUG filelock:315]
233 Lock 139626831533008 released on /home/parallels/.local/share/virtualenv/unzip/20.4.6/_virtualenv.py.lock [INFO filelock:318]
234 create virtualenv import hook file /home/parallels/Documents/venv-test/lib/python3.8/site-packages/_virtualenv.pth [DEBUG api:95]
234 create /home/parallels/Documents/venv-test/lib/python3.8/site-packages/_virtualenv.py [DEBUG api:98]
234 ============================== target debug ============================== [DEBUG session:54]
235 Attempting to acquire lock 139626831533392 on /home/parallels/.local/share/virtualenv/unzip/20.4.6/debug.py.lock [DEBUG filelock:270]
235 Lock 139626831533392 acquired on /home/parallels/.local/share/virtualenv/unzip/20.4.6/debug.py.lock [INFO filelock:274]
235 extract /home/parallels/Documents/virtualenv.pyz/virtualenv/create/debug.py to /home/parallels/.local/share/virtualenv/unzip/20.4.6/debug.py [DEBUG zipapp:19]
238 debug via /home/parallels/Documents/venv-test/bin/python /home/parallels/.local/share/virtualenv/unzip/20.4.6/debug.py [DEBUG creator:224]
279 Attempting to release lock 139626831533392 on /home/parallels/.local/share/virtualenv/unzip/20.4.6/debug.py.lock [DEBUG filelock:315]
279 Lock 139626831533392 released on /home/parallels/.local/share/virtualenv/unzip/20.4.6/debug.py.lock [INFO filelock:318]
234 {
  "sys": {
    "executable": "/home/parallels/Documents/venv-test/bin/python",
    "_base_executable": "/home/parallels/Documents/venv-test/bin/python",
    "prefix": "/home/parallels/Documents/venv-test",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/home/parallels/Documents/venv-test",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python38.zip",
      "/usr/lib/python3.8",
      "/usr/lib/python3.8/lib-dynload",
      "/home/parallels/Documents/venv-test/lib/python3.8/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.8.5 (default, Jan 27 2021, 15:41:15) \n[GCC 9.3.0]",
  "makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [DEBUG session:55]
280 add seed packages via FromAppData(download=True, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/parallels/.local/share/virtualenv) [INFO session:59]
282 Attempting to acquire lock 139626830885168 on /home/parallels/.local/share/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [DEBUG filelock:270]
283 Attempting to acquire lock 139626830886080 on /home/parallels/.local/share/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [DEBUG filelock:270]
283 Lock 139626830885168 acquired on /home/parallels/.local/share/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [INFO filelock:274]
283 Attempting to release lock 139626830885168 on /home/parallels/.local/share/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [DEBUG filelock:315]
283 Lock 139626830885168 released on /home/parallels/.local/share/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl.lock [INFO filelock:318]
283 Lock 139626830886080 acquired on /home/parallels/.local/share/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [INFO filelock:274]
284 Attempting to release lock 139626830886080 on /home/parallels/.local/share/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [DEBUG filelock:315]
284 Lock 139626830886080 released on /home/parallels/.local/share/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl.lock [INFO filelock:318]
285 got embed update of distribution pip from /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/pip.json [DEBUG via_disk_folder:135]
286 Attempting to acquire lock 139626830887952 on /home/parallels/.local/share/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [DEBUG filelock:270]
289 got embed update of distribution setuptools from /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/setuptools.json [DEBUG via_disk_folder:135]
290 wrote embed update of distribution setuptools at /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/setuptools.json [DEBUG via_disk_folder:161]
292 Lock 139626830887952 acquired on /home/parallels/.local/share/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [INFO filelock:274]
293 Attempting to release lock 139626830887952 on /home/parallels/.local/share/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [DEBUG filelock:315]
293 wrote embed update of distribution pip at /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/pip.json [DEBUG via_disk_folder:161]
296 triggered periodic upgrade of setuptools==56.0.0 (for python 3.8) via background process having PID 170486 [INFO periodic_update:194]
293 Lock 139626830887952 released on /home/parallels/.local/share/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl.lock [INFO filelock:318]
299 got embed update of distribution wheel from /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/wheel.json [DEBUG via_disk_folder:135]
300 wrote embed update of distribution wheel at /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/wheel.json [DEBUG via_disk_folder:161]
303 got embed update of distribution setuptools from /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/setuptools.json [DEBUG via_disk_folder:135]
304 triggered periodic upgrade of pip==21.1.1 (for python 3.8) via background process having PID 170487 [INFO periodic_update:194]
305 got embed update of distribution pip from /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/pip.json [DEBUG via_disk_folder:135]
307 triggered periodic upgrade of wheel==0.36.2 (for python 3.8) via background process having PID 170488 [INFO periodic_update:194]
308 got embed update of distribution wheel from /home/parallels/.local/share/virtualenv/wheel/3.8/embed/1/wheel.json [DEBUG via_disk_folder:135]
314 install setuptools from wheel /home/parallels/.local/share/virtualenv/wheel/house/setuptools-56.0.0-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
315 Attempting to acquire lock 139626830997056 on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [DEBUG filelock:270]
315 Lock 139626830997056 acquired on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [INFO filelock:274]
315 Attempting to release lock 139626830997056 on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [DEBUG filelock:315]
315 Lock 139626830997056 released on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any.lock [INFO filelock:318]
316 copy /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/distutils-precedence.pth to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/distutils-precedence.pth [DEBUG _sync:52]
316 copy /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/setuptools-56.0.0.virtualenv to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/setuptools-56.0.0.virtualenv [DEBUG _sync:52]
318 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/setuptools-56.0.0.dist-info to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/setuptools-56.0.0.dist-info [DEBUG _sync:52]
324 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/pkg_resources to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/pkg_resources [DEBUG _sync:52]
343 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/setuptools to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/setuptools [DEBUG _sync:52]
351 install pip from wheel /home/parallels/.local/share/virtualenv/wheel/house/pip-21.1.1-py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
352 Attempting to acquire lock 139626830997104 on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [DEBUG filelock:270]
352 Lock 139626830997104 acquired on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [INFO filelock:274]
352 Attempting to release lock 139626830997104 on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [DEBUG filelock:315]
352 Lock 139626830997104 released on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any.lock [INFO filelock:318]
352 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any/pip-21.1.1.dist-info to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/pip-21.1.1.dist-info [DEBUG _sync:52]
365 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any/pip to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/pip [DEBUG _sync:52]
369 install wheel from wheel /home/parallels/.local/share/virtualenv/wheel/house/wheel-0.36.2-py2.py3-none-any.whl via CopyPipInstall [DEBUG via_app_data:49]
369 Attempting to acquire lock 139626830997632 on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [DEBUG filelock:270]
369 Lock 139626830997632 acquired on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [INFO filelock:274]
369 Attempting to release lock 139626830997632 on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [DEBUG filelock:315]
369 Lock 139626830997632 released on /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any.lock [INFO filelock:318]
370 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any/wheel-0.36.2.dist-info to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/wheel-0.36.2.dist-info [DEBUG _sync:52]
375 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any/wheel to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/wheel [DEBUG _sync:52]
396 copy /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.36.2-py2.py3-none-any/wheel-0.36.2.virtualenv to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/wheel-0.36.2.virtualenv [DEBUG _sync:52]
424 generated console scripts wheel3 wheel wheel-3.8 wheel3.8 [DEBUG base:48]
455 copy directory /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-56.0.0-py3-none-any/_distutils_hack to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/_distutils_hack [DEBUG _sync:52]
456 generated console scripts  [DEBUG base:48]
589 copy /home/parallels/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-21.1.1-py3-none-any/pip-21.1.1.virtualenv to /home/parallels/Documents/venv-test/lib/python3.8/site-packages/pip-21.1.1.virtualenv [DEBUG _sync:52]
624 generated console scripts pip3 pip pip-3.8 pip3.8 [DEBUG base:48]
624 add activators for Bash, CShell, Fish, PowerShell, Python, Xonsh [INFO session:64]
626 write /home/parallels/Documents/venv-test/pyvenv.cfg [DEBUG pyenv_cfg:34]
626 	home = /usr [DEBUG pyenv_cfg:38]
626 	implementation = CPython [DEBUG pyenv_cfg:38]
626 	version_info = 3.8.5.final.0 [DEBUG pyenv_cfg:38]
626 	virtualenv = 20.4.6 [DEBUG pyenv_cfg:38]
626 	include-system-site-packages = false [DEBUG pyenv_cfg:38]
626 	base-prefix = /usr [DEBUG pyenv_cfg:38]
626 	base-exec-prefix = /usr [DEBUG pyenv_cfg:38]
626 	base-executable = /usr/bin/python3 [DEBUG pyenv_cfg:38]
627 created virtual environment CPython3.8.5.final.0-64 in 496ms
  creator CPython3Posix(dest=/home/parallels/Documents/venv-test, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=True, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/parallels/.local/share/virtualenv)
    added seed packages: pip==21.1.1, setuptools==56.0.0, wheel==0.36.2
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator [WARNING __main__:19]
```



Discussion:

Resolving patch:
diff --git a/src/virtualenv/seed/wheels/acquire.py b/src/virtualenv/seed/wheels/acquire.py
--- a/src/virtualenv/seed/wheels/acquire.py
+++ b/src/virtualenv/seed/wheels/acquire.py
@@ -18,11 +18,14 @@ def get_wheel(distribution, version, for_py_version, search_dirs, download, app_
     Get a wheel with the given distribution-version-for_py_version trio, by using the extra search dir + download
     """
     # not all wheels are compatible with all python versions, so we need to py version qualify it
-    # 1. acquire from bundle
-    wheel = from_bundle(distribution, version, for_py_version, search_dirs, app_data, do_periodic_update, env)
+    wheel = None
 
-    # 2. download from the internet
-    if version not in Version.non_version and download:
+    if not download or version != Version.bundle:
+        # 1. acquire from bundle
+        wheel = from_bundle(distribution, version, for_py_version, search_dirs, app_data, do_periodic_update, env)
+
+    if download and wheel is None and version != Version.embed:
+        # 2. download from the internet
         wheel = download_wheel(
             distribution=distribution,
             version_spec=Version.as_version_spec(version),
@@ -32,6 +35,7 @@ def get_wheel(distribution, version, for_py_version, search_dirs, download, app_
             to_folder=app_data.house,
             env=env,
         )
+
     return wheel
 
 


Test patch:
diff --git a/tests/unit/seed/wheels/test_acquire.py b/tests/unit/seed/wheels/test_acquire.py
--- a/tests/unit/seed/wheels/test_acquire.py
+++ b/tests/unit/seed/wheels/test_acquire.py
@@ -6,9 +6,10 @@
 
 import pytest
 
-from virtualenv.seed.wheels.acquire import download_wheel, pip_wheel_env_run
+from virtualenv.seed.wheels.acquire import download_wheel, get_wheel, pip_wheel_env_run
 from virtualenv.seed.wheels.embed import BUNDLE_FOLDER, get_embed_wheel
-from virtualenv.seed.wheels.util import discover_wheels
+from virtualenv.seed.wheels.util import Wheel, discover_wheels
+from virtualenv.util.path import Path
 
 
 def test_pip_wheel_env_run_could_not_find(session_app_data, mocker):
@@ -68,3 +69,29 @@ def test_download_fails(mocker, for_py_version, session_app_data):
         str(as_path),
         "pip==1",
     ] == exc.cmd
+
+
+@pytest.fixture
+def downloaded_wheel(mocker):
+    wheel = Wheel.from_path(Path("setuptools-0.0.0-py2.py3-none-any.whl"))
+    mocker.patch("virtualenv.seed.wheels.acquire.download_wheel", return_value=wheel)
+    yield wheel
+
+
+@pytest.mark.parametrize("version", ["bundle", "0.0.0"])
+def test_get_wheel_download_called(for_py_version, session_app_data, downloaded_wheel, version):
+    distribution = "setuptools"
+    wheel = get_wheel(distribution, version, for_py_version, [], True, session_app_data, False, os.environ)
+    assert wheel is not None
+    assert wheel.name == downloaded_wheel.name
+
+
+@pytest.mark.parametrize("version", ["embed", "pinned"])
+def test_get_wheel_download_not_called(for_py_version, session_app_data, downloaded_wheel, version):
+    distribution = "setuptools"
+    expected = get_embed_wheel(distribution, for_py_version)
+    if version == "pinned":
+        version = expected.version
+    wheel = get_wheel(distribution, version, for_py_version, [], True, session_app_data, False, os.environ)
+    assert wheel is not None
+    assert wheel.name == expected.name