|
46 | 46 |
|
47 | 47 | POLICY_MONTHS_DELTA = 6 |
48 | 48 |
|
49 | | -DEFAULT_STUBTEST_FILE = Path("/tmp/stubs.txt") # Sync with `stubsabot` github job |
50 | | - |
51 | 49 |
|
52 | 50 | class ActionLevel(enum.IntEnum): |
53 | 51 | def __new__(cls, value: int, doc: str) -> Self: |
@@ -631,17 +629,6 @@ def is_new_release(upload_datetime: datetime.datetime) -> bool: |
631 | 629 | return upload_datetime > yesterday |
632 | 630 |
|
633 | 631 |
|
634 | | -def append_stub_to_stubtest_list(distribution: str, *, file_path: Path = DEFAULT_STUBTEST_FILE) -> None: |
635 | | - if Path.exists(file_path): |
636 | | - with Path.open(file_path, "r") as f: |
637 | | - stubs = f.read().strip() |
638 | | - else: |
639 | | - stubs = "" |
640 | | - stubs = f"{stubs} {distribution}" if stubs else distribution |
641 | | - with Path.open(file_path, "w") as f: |
642 | | - f.write(stubs) |
643 | | - |
644 | | - |
645 | 632 | async def determine_action(distribution: str, session: aiohttp.ClientSession) -> Update | NoUpdate | Obsolete | Remove | Error: |
646 | 633 | try: |
647 | 634 | return await determine_action_no_error_handling(distribution, session) |
@@ -686,7 +673,8 @@ async def determine_action_no_error_handling( |
686 | 673 | obsolete_since = await find_first_release_with_py_typed(pypi_info, session=session) |
687 | 674 | if obsolete_since is None and latest_version in stub_info.version_spec: |
688 | 675 | if is_new_release(latest_release.upload_date): |
689 | | - append_stub_to_stubtest_list(latest_release.distribution) |
| 676 | + # Next print should be parsed by github action, see `stubsabot.yml` |
| 677 | + print(colored(f"{stub_info.distribution} should be tested by stubsabot", "blue")) |
690 | 678 | return NoUpdate(stub_info.distribution, "up to date") |
691 | 679 |
|
692 | 680 | relevant_version = obsolete_since.version if obsolete_since else latest_version |
|
0 commit comments