Skip to content

Commit

Permalink
fix: pinned version are not working once periodic / manual updates ki…
Browse files Browse the repository at this point in the history
…ck-in

Fixes pypa#2203
  • Loading branch information
mayeut committed Dec 27, 2021
1 parent ba3541c commit b817ffa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/virtualenv/seed/wheels/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def from_bundle(distribution, version, for_py_version, search_dirs, app_data, do

if version != Version.embed:
# 2. check if we have upgraded embed
if app_data.can_update:
if of_version is None and app_data.can_update:
wheel = periodic_update(distribution, for_py_version, wheel, search_dirs, app_data, do_periodic_update, env)

# 3. acquire from extra search dir
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/test_run_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

import sys

import pytest

from virtualenv import cli_run
from virtualenv.util.six import ensure_text
from virtualenv.util.subprocess import run_cmd


def test_app_data_pinning(tmp_path):
version = "19.1.1" if sys.version_info[0:2] == (3, 4) else "19.3.1"
result = cli_run([ensure_text(str(tmp_path)), "--pip", version, "--activators", "", "--seeder", "app-data"])
with pytest.raises(SystemExit):
cli_run(["--upgrade-embed-wheels"])
result = cli_run(
[ensure_text(str(tmp_path)), "--pip", version, "--activators", "", "--seeder", "app-data", "--never-download"]
)
code, out, err = run_cmd([str(result.creator.script("pip")), "list", "--disable-pip-version-check"])
assert not code
assert not err
Expand Down

0 comments on commit b817ffa

Please sign in to comment.