Skip to content

Commit e510eb4

Browse files
authored
feat(toxgen): Forward args from generate-test-files script (getsentry#7008)
- Forward any args provided to `generate-test-files.sh` to toxgen, so you can do e.g. `./scripts/generate-test-files.sh --only django` and only django test matrix entries will be updated. - Rename the two existing options from `--skip-version-update` and `--only-update` to `--skip` and `--only`, respectively, to simplify. - Print an info message if either is set.
1 parent c817251 commit e510eb4

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

‎scripts/generate-test-files.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ cd "$(dirname "$0")"
88

99
export UV_PROJECT_ENVIRONMENT=toxgen.venv
1010

11-
uv run --python 3.14t --group toxgen --with-editable .. python populate_tox/populate_tox.py
11+
uv run --python 3.14t --group toxgen --with-editable .. python populate_tox/populate_tox.py "$@"
1212
uv run --python 3.14t --group toxgen --with-editable .. python split_tox_gh_actions/split_tox_gh_actions.py

‎scripts/populate_tox/populate_tox.py‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,13 +1210,13 @@ def get_releases_to_test(integration, package) -> list[Version] | None:
12101210
def parse_args() -> argparse.Namespace:
12111211
parser = argparse.ArgumentParser()
12121212
parser.add_argument(
1213-
"--skip-version-update",
1213+
"--skip",
12141214
nargs="*",
12151215
default=[],
12161216
help="Integrations to skip version updates for.",
12171217
)
12181218
parser.add_argument(
1219-
"--only-update",
1219+
"--only",
12201220
nargs="*",
12211221
default=[],
12221222
help="Only update versions for these integrations (all others will be skipped).",
@@ -1283,12 +1283,17 @@ def main() -> dict[str, list]:
12831283
}
12841284

12851285
args = parse_args()
1286-
if args.skip_version_update and args.only_update:
1287-
print("--skip-version-update and --only-update are mutually exclusive.")
1286+
if args.skip and args.only:
1287+
print("--skip and --only are mutually exclusive.")
12881288
sys.exit(1)
12891289

1290-
only_update = set(args.only_update)
1291-
skip_version_updates = set(args.skip_version_update)
1290+
only_update = set(args.only)
1291+
if only_update:
1292+
print(f"Only updating {' '.join(only_update)}.")
1293+
1294+
skip_update = set(args.skip)
1295+
if skip_update:
1296+
print(f"Skipping updates for {' '.join(skip_update)}.")
12921297

12931298
# Process packages
12941299
packages = defaultdict(list)
@@ -1303,7 +1308,7 @@ def main() -> dict[str, list]:
13031308
package, extra = _get_package_name(integration)
13041309

13051310
test_releases = None
1306-
skip = integration in skip_version_updates or (
1311+
skip = integration in skip_update or (
13071312
only_update and integration not in only_update
13081313
)
13091314
if skip:

0 commit comments

Comments
 (0)