|
15 | 15 |
|
16 | 16 |
|
17 | 17 | if TYPE_CHECKING: |
| 18 | + from poetry.core.packages.package import PackageFile |
| 19 | + |
18 | 20 | from poetry.repositories.repository_pool import RepositoryPool |
19 | 21 | from tests.conftest import Config |
20 | 22 | from tests.types import DistributionHashGetter |
@@ -211,7 +213,7 @@ def test_chooser_chooses_distributions_that_match_the_package_hashes( |
211 | 213 | chooser = Chooser(pool, env) |
212 | 214 |
|
213 | 215 | package = Package("isort", "4.3.4") |
214 | | - files = [ |
| 216 | + files: list[PackageFile] = [ |
215 | 217 | { |
216 | 218 | "file": filename, |
217 | 219 | "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), |
@@ -246,9 +248,9 @@ def test_chooser_chooses_yanked_if_no_others( |
246 | 248 | chooser = Chooser(pool, env) |
247 | 249 |
|
248 | 250 | package = Package("black", "21.11b0") |
249 | | - files = [ |
| 251 | + files: list[PackageFile] = [ |
250 | 252 | { |
251 | | - "filename": filename, |
| 253 | + "file": filename, |
252 | 254 | "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), |
253 | 255 | } |
254 | 256 | for filename in [f"{package.name}-{package.version}-py3-none-any.whl"] |
@@ -286,9 +288,9 @@ def test_chooser_does_not_choose_yanked_if_others( |
286 | 288 | ) |
287 | 289 |
|
288 | 290 | package = Package("futures", "3.2.0") |
289 | | - files = [ |
| 291 | + files: list[PackageFile] = [ |
290 | 292 | { |
291 | | - "filename": filename, |
| 293 | + "file": filename, |
292 | 294 | "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), |
293 | 295 | } |
294 | 296 | for filename in [ |
@@ -330,12 +332,12 @@ def test_chooser_throws_an_error_if_package_hashes_do_not_match( |
330 | 332 | chooser = Chooser(pool, env) |
331 | 333 |
|
332 | 334 | package = Package("isort", "4.3.4") |
333 | | - files = [ |
| 335 | + files: list[PackageFile] = [ |
334 | 336 | { |
335 | 337 | "hash": ( |
336 | 338 | "sha256:0000000000000000000000000000000000000000000000000000000000000000" |
337 | 339 | ), |
338 | | - "filename": "isort-4.3.4.tar.gz", |
| 340 | + "file": "isort-4.3.4.tar.gz", |
339 | 341 | } |
340 | 342 | ] |
341 | 343 | if source_type == "legacy": |
@@ -373,7 +375,7 @@ def test_chooser_md5_remote_fallback_to_sha256_inline_calculation( |
373 | 375 | ) |
374 | 376 | package.files = [ |
375 | 377 | { |
376 | | - "filename": filename, |
| 378 | + "file": filename, |
377 | 379 | "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), |
378 | 380 | } |
379 | 381 | for filename in [f"{package.name}-{package.version}.tar.gz"] |
|
0 commit comments