Skip to content

Commit 148ea33

Browse files
committed
more prints
1 parent 7276193 commit 148ea33

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

scripts/populate_tox/populate_tox.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -507,18 +507,25 @@ def main(fail_on_changes: bool = False) -> None:
507507
Generate tox.ini from the tox.jinja template.
508508
509509
The script has two modes of operation:
510-
- check mode (if `fail_on_changes` is True)
510+
- fail on changes mode (if `fail_on_changes` is True)
511511
- normal mode (if `fail_on_changes` is False)
512512
513-
Check mode is run on every PR to make sure that `tox.ini`, `tox.jinja` and
514-
this script don't go out of sync because of manual changes in one place but
515-
not the other.
513+
Fail on changes mode is run on every PR to make sure that `tox.ini`,
514+
`tox.jinja` and this script don't go out of sync because of manual changes
515+
in one place but not the other.
516516
517517
Normal mode is meant to be run as a cron job, regenerating tox.ini and
518518
proposing the changes via a PR.
519519
"""
520-
mode = "check" if fail_on_changes else "normal"
521-
print(f"Running in {mode} mode.")
520+
print(f"Running in {'fail_on_changes' if fail_on_changes else 'normal'} mode.")
521+
last_updated = get_last_updated()
522+
if fail_on_changes:
523+
# We need to make the script ignore any new releases after the `last_updated`
524+
# timestamp so that we don't fail CI on a PR just because a new package
525+
# version was released, leading to unrelated changes in tox.ini.
526+
print(
527+
f"Since we're in fail_on_changes mode, we're only considering releases before the last tox.ini update at {last_updated.isoformat()}."
528+
)
522529

523530
global MIN_PYTHON_VERSION, MAX_PYTHON_VERSION
524531
sdk_python_versions = _parse_python_versions_from_classifiers(
@@ -530,12 +537,6 @@ def main(fail_on_changes: bool = False) -> None:
530537
f"The SDK supports Python versions {MIN_PYTHON_VERSION} - {MAX_PYTHON_VERSION}."
531538
)
532539

533-
# If this script is run in check mode (fail_on_changes is True), we need to
534-
# make the script ignore any new releases after the `last_updated` timestamp
535-
# so that we don't fail CI on a PR just because a new package version was
536-
# released, leading to unrelated changes in tox.ini.
537-
last_updated = get_last_updated()
538-
539540
packages = defaultdict(list)
540541

541542
for group, integrations in GROUPS.items():

0 commit comments

Comments
 (0)