Skip to content

Restore import argparse dropped in #4410 (fixes release-notes workflow on main) - #4411

Merged
mattleibow merged 1 commit into
mainfrom
dev/hotfix-restore-argparse-import
Jul 12, 2026
Merged

mattleibow merged 1 commit into
mainfrom
dev/hotfix-restore-argparse-import

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Regression

#4410 broke the Sync - Release Notes & API Diffs workflow on main. The Prepare step fails immediately:

Traceback (most recent call last):
  File ".../scripts/infra/docs/release-notes-data.py", line 2360, in <module>
    main()
  File ".../scripts/infra/docs/release-notes-data.py", line 2316, in main
    parser = argparse.ArgumentParser(
NameError: name 'argparse' is not defined. Did you forget to import 'argparse'?

(run 29204563881, Prepare step exit 1.)

Cause

#4410 added import fnmatch to release-notes-data.py, but the edit replaced import argparse rather than adding fnmatch alongside it. The script is only ever run as a program (via prepare.sh), so py_compile and any import-time smoke check still pass — the NameError only fires at runtime when main() constructs its ArgumentParser, which is why it wasn't caught pre-merge.

Fix

Re-add import argparse (alphabetical order, before fnmatch). One line.

Verified locally:

$ python3 scripts/infra/docs/release-notes-data.py --help   # exit 0 (was NameError)
$ # classifier still works: externals/skia -> product, docs -> mixed, externals/depot_tools -> internal

Co-authored-by: Copilot App [email protected]

PR #4410 added 'import fnmatch' to release-notes-data.py but the edit replaced
'import argparse' instead of adding alongside it, so main() crashes at startup:

    NameError: name 'argparse' is not defined

release-notes-data.py is only ever run as a script (via prepare.sh), so
py_compile and import-time checks pass — the NameError only fires when main()
builds its ArgumentParser. This broke the 'Sync - Release Notes & API Diffs'
workflow on main (run 29204563881: Prepare step exit code 1).

Re-add 'import argparse' in alphabetical order. Verified with
'python3 scripts/infra/docs/release-notes-data.py --help' (exit 0).

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4411

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4411"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4411/packages --name skiasharp-pr-4411
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4411

@mattleibow
mattleibow merged commit fc7fbe6 into main Jul 12, 2026
62 of 65 checks passed
@mattleibow
mattleibow deleted the dev/hotfix-restore-argparse-import branch July 12, 2026 19:08
@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

@mattleibow mattleibow added this to the 4.151.0-preview.2 milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant