|
11 | 11 | import pytest |
12 | 12 | from pip._internal.utils.hashes import FAVORITE_HASH |
13 | 13 | from pip._internal.utils.urls import path_to_url |
| 14 | +from pip._vendor.packaging.version import Version |
14 | 15 |
|
15 | 16 | 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 | +) |
17 | 21 |
|
18 | 22 | from .constants import MINIMAL_WHEELS_PATH, PACKAGES_PATH |
19 | 23 |
|
@@ -3058,7 +3062,14 @@ def test_pass_pip_cache_to_pip_args(tmpdir, runner, current_resolver): |
3058 | 3062 | cli, ["--cache-dir", str(cache_dir), "--resolver", current_resolver] |
3059 | 3063 | ) |
3060 | 3064 | assert out.exit_code == 0 |
3061 | | - assert os.listdir(os.path.join(str(cache_dir), "http")) |
| 3065 | + # TODO: Remove hack once testing only on v23.3+ |
| 3066 | + pip_current_version = get_pip_version_for_python_executable(sys.executable) |
| 3067 | + pip_breaking_version = Version("23.3.dev0") |
| 3068 | + if pip_current_version >= pip_breaking_version: |
| 3069 | + pip_http_cache_dir = "http-v2" |
| 3070 | + else: |
| 3071 | + pip_http_cache_dir = "http" |
| 3072 | + assert os.listdir(os.path.join(str(cache_dir), pip_http_cache_dir)) |
3062 | 3073 |
|
3063 | 3074 |
|
3064 | 3075 | @backtracking_resolver_only |
|
0 commit comments