Skip to content

Commit

Permalink
Merge branch 'hotfix/3.2' into work/1845/no-parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Sep 13, 2024
2 parents b67bf09 + 358657b commit 538fa94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions charmcraft/charm_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def _install_dependencies(self, staging_venv_dir: pathlib.Path):
[
pip_cmd,
"install",
"--force-reinstall",
f"pip@{KNOWN_GOOD_PIP_URL}",
]
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_charm_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ def test_build_dependencies_virtualenv(

assert mock.mock_calls == [
call(["python3", "-m", "venv", str(tmp_path / const.STAGING_VENV_DIRNAME)]),
call([pip_cmd, "install", f"pip@{KNOWN_GOOD_PIP_URL}"]),
call([pip_cmd, "install", "--force-reinstall", f"pip@{KNOWN_GOOD_PIP_URL}"]),
*extra_pip_calls,
]

Expand Down Expand Up @@ -771,7 +771,7 @@ def test_build_dependencies_virtualenv_multiple(tmp_path, assert_output):
pip_cmd = str(charm_builder._find_venv_bin(tmp_path / const.STAGING_VENV_DIRNAME, "pip"))
assert mock.mock_calls == [
call(["python3", "-m", "venv", str(tmp_path / const.STAGING_VENV_DIRNAME)]),
call([pip_cmd, "install", f"pip@{KNOWN_GOOD_PIP_URL}"]),
call([pip_cmd, "install", "--force-reinstall", f"pip@{KNOWN_GOOD_PIP_URL}"]),
call(
[
pip_cmd,
Expand Down
9 changes: 8 additions & 1 deletion tests/unit/utils/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ def test_get_pip_command(

@pytest.mark.parametrize(
("pip_cmd", "stdout", "expected"),
[("pip", "pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)\n", (22, 0, 2))],
[
("pip", "pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)\n", (22, 0, 2)),
(
"venv/bin/pip",
"pip 20.0.2 from /root/venv/lib/python3.8/site-packages/pip (python 3.8)",
(20, 0, 2),
),
],
)
def test_get_pip_version_success(
fake_process,
Expand Down

0 comments on commit 538fa94

Please sign in to comment.