|
19 | 19 | from packaging.requirements import Requirement |
20 | 20 | from packaging.version import Version |
21 | 21 |
|
22 | | -from fromager import context, packagesettings, resolver, sources, wheels |
23 | | -from fromager.context import Cooldown |
| 22 | +from fromager import candidate, context, packagesettings, resolver, sources, wheels |
24 | 23 |
|
25 | 24 | _BOOTSTRAP_TIME = datetime.datetime(2026, 3, 26, 0, 0, 0, tzinfo=datetime.UTC) |
26 | 25 | _COOLDOWN_7_DAYS = datetime.timedelta(days=7) |
|
77 | 76 | ], |
78 | 77 | } |
79 | 78 |
|
80 | | -_COOLDOWN = Cooldown( |
| 79 | +_COOLDOWN = candidate.Cooldown( |
81 | 80 | min_age=_COOLDOWN_7_DAYS, |
82 | 81 | bootstrap_time=_BOOTSTRAP_TIME, |
83 | 82 | ) |
@@ -327,7 +326,7 @@ def test_non_pypi_index_allows_without_upload_time( |
327 | 326 | def _make_ctx( |
328 | 327 | tmp_path: pathlib.Path, |
329 | 328 | *, |
330 | | - cooldown: Cooldown | None, |
| 329 | + cooldown: candidate.Cooldown | None, |
331 | 330 | min_release_age: int | None = None, |
332 | 331 | ) -> context.WorkContext: |
333 | 332 | """Build a WorkContext with an optional per-package min_release_age setting.""" |
@@ -457,7 +456,7 @@ def test_per_package_cooldown_disable_via_ctx(tmp_path: pathlib.Path) -> None: |
457 | 456 | # --------------------------------------------------------------------------- |
458 | 457 |
|
459 | 458 | _GITLAB_BOOTSTRAP_TIME = datetime.datetime(2025, 5, 20, 0, 0, 0, tzinfo=datetime.UTC) |
460 | | -_GITLAB_COOLDOWN = Cooldown( |
| 459 | +_GITLAB_COOLDOWN = candidate.Cooldown( |
461 | 460 | min_age=datetime.timedelta(days=7), |
462 | 461 | bootstrap_time=_GITLAB_BOOTSTRAP_TIME, |
463 | 462 | ) |
@@ -507,7 +506,9 @@ def test_per_package_cooldown_disable_via_ctx(tmp_path: pathlib.Path) -> None: |
507 | 506 | """ |
508 | 507 |
|
509 | 508 |
|
510 | | -def _make_gitlab_provider(cooldown: Cooldown | None) -> resolver.GitLabTagProvider: |
| 509 | +def _make_gitlab_provider( |
| 510 | + cooldown: candidate.Cooldown | None, |
| 511 | +) -> resolver.GitLabTagProvider: |
511 | 512 | return resolver.GitLabTagProvider( |
512 | 513 | project_path="test/pkg", |
513 | 514 | server_url="https://gitlab.com", |
@@ -832,7 +833,7 @@ def test_compute_max_age_cutoff_with_cooldown( |
832 | 833 | tmp_context: context.WorkContext, |
833 | 834 | ) -> None: |
834 | 835 | """_compute_max_age_cutoff uses cooldown's bootstrap_time when available.""" |
835 | | - tmp_context.cooldown = Cooldown( |
| 836 | + tmp_context.cooldown = candidate.Cooldown( |
836 | 837 | min_age=datetime.timedelta(days=7), |
837 | 838 | bootstrap_time=_BOOTSTRAP_TIME, |
838 | 839 | ) |
|
0 commit comments