Skip to content

Commit 1974580

Browse files
authored
Merge pull request #1992 from chrysle/fix-ci
Fix CI for `pip` v23.3+
2 parents b3fd30e + 0d99b9f commit 1974580

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/test_cli_compile.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
import pytest
1212
from pip._internal.utils.hashes import FAVORITE_HASH
1313
from pip._internal.utils.urls import path_to_url
14+
from pip._vendor.packaging.version import Version
1415

1516
from piptools.scripts.compile import cli
16-
from piptools.utils import COMPILE_EXCLUDE_OPTIONS
17+
from piptools.utils import (
18+
COMPILE_EXCLUDE_OPTIONS,
19+
get_pip_version_for_python_executable,
20+
)
1721

1822
from .constants import MINIMAL_WHEELS_PATH, PACKAGES_PATH
1923

@@ -2925,7 +2929,14 @@ def test_pass_pip_cache_to_pip_args(tmpdir, runner, current_resolver):
29252929
cli, ["--cache-dir", str(cache_dir), "--resolver", current_resolver]
29262930
)
29272931
assert out.exit_code == 0
2928-
assert os.listdir(os.path.join(str(cache_dir), "http"))
2932+
# TODO: Remove hack once testing only on v23.3+
2933+
pip_current_version = get_pip_version_for_python_executable(sys.executable)
2934+
pip_breaking_version = Version("23.3.dev0")
2935+
if pip_current_version >= pip_breaking_version:
2936+
pip_http_cache_dir = "http-v2"
2937+
else:
2938+
pip_http_cache_dir = "http"
2939+
assert os.listdir(os.path.join(str(cache_dir), pip_http_cache_dir))
29292940

29302941

29312942
@backtracking_resolver_only

0 commit comments

Comments
 (0)