Skip to content

Replace scons checkPot with standalone runcheckpot.bat#19676

Merged
seanbudd merged 4 commits into
nvaccess:masterfrom
bramd:fix/remove-scons-checkpot
Mar 3, 2026
Merged

Replace scons checkPot with standalone runcheckpot.bat#19676
seanbudd merged 4 commits into
nvaccess:masterfrom
bramd:fix/remove-scons-checkpot

Conversation

@bramd

@bramd bramd commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Remove the checkPot target from sconstruct and provide a standalone
runcheckpot.bat script that calls scons pot then validates the output
with tests/checkPot.py. This follows up on PR #19606 review feedback
to stop using SCons for checkPot entirely.

Also fixes tests/checkPot.py main to call sys.exit() with the
error count so exit codes propagate correctly when run standalone.

Link to issue number:

N/A

Summary of the issue:

scons checkPot is more a utility and not really part of the build. Having a separate runcheckpot.bat is consistent with other utilities like rununittests or runlint. This has been suggested in a comment on PR #19606. Since that PR was already merged, this change is done in this new PR.

Description of user facing changes:

None

Description of developer facing changes:

The scons checkPot command has been replaced with runcheckpot.bat. This script generates the pot file via scons pot, then runs tests/checkPot.py directly on the output. Any arguments (e.g. --all-cores, -j 1) are forwarded to the scons pot invocation. Since we need an up-to-date pot file to run checks and generating that file is part of the SCons build, we still have the overhead of calling SCons when running runcheckpot.bat.

Description of development approach:

  • Created runcheckpot.bat following the naming and structure conventions of existing bat files (rununittests.bat, runlicensecheck.bat, etc.).
  • Removed the checkPot target, action, and alias from sconstruct (the pot target is unchanged).
  • Updated the pre-commit hook from language: system (invoking cmd.exe /c "scons checkPot") to language: script (invoking ./runcheckpot.bat), matching how other bat-based hooks are configured.
  • Updated ci/scripts/tests/translationCheck.ps1 to call runcheckpot.bat.
  • Fixed tests/checkPot.py __main__ block to call sys.exit() with the error count. Previously it only printed the count, which meant standalone invocation always exited 0 regardless of errors. This was not a problem when SCons used the return
    value directly, but is critical now that the script is invoked via bat file.
  • Updated developer documentationchangelog entry.

Testing strategy:

  • Verify runcheckpot.bat --all-cores generates pot and runs validation successfully.
  • Verify scons checkPot no longer exists as a target.
  • Verify scons pot still works independently.
  • Verify exit code propagation: python tests/checkPot.py with a bad/missing pot file returns non-zero.
  • Verify pre-commit hook: uv run pre-commit run checkPot --all-files.

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@bramd bramd force-pushed the fix/remove-scons-checkpot branch from 38464e8 to 2259cae Compare February 23, 2026 20:27
Remove the checkPot target from sconstruct and provide a standalone
runcheckpot.bat script that calls scons pot then validates the output
with tests/checkPot.py. This follows up on PR nvaccess#19606 review feedback
to stop using SCons for checkPot entirely.

Also fixes tests/checkPot.py __main__ to call sys.exit() with the
error count so exit codes propagate correctly when run standalone.
@bramd bramd force-pushed the fix/remove-scons-checkpot branch from 2259cae to de53c3d Compare February 23, 2026 21:12
@bramd bramd marked this pull request as ready for review February 23, 2026 21:13
@bramd bramd requested review from a team as code owners February 23, 2026 21:13
Comment thread tests/checkPot.py Outdated
@seanbudd seanbudd self-assigned this Feb 23, 2026
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Feb 26, 2026
@seanbudd seanbudd marked this pull request as draft February 26, 2026 23:21
bramd and others added 2 commits March 2, 2026 09:45
Properly return a 0 or 1 exit code (0=success, 1=failure). Bring back the print statement taht prints number of errors to stdout.

Co-authored-by: Sean Budd <seanbudd123@gmail.com>
The checkPot function already prints a detailed summary to stderr,
making the bare error count print to stdout redundant.
@bramd

bramd commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

@seanbudd Ah, I was considering moving the output outside of the function earlier and didn't properly revert that. Thanks for catching.

@seanbudd seanbudd marked this pull request as ready for review March 2, 2026 22:59
Copilot AI review requested due to automatic review settings March 2, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the checkPot SCons target and replaces it with a standalone runcheckpot.bat utility that generates nvda.pot via scons pot and then validates translator comments via tests/checkPot.py. It also updates CI, pre-commit, and documentation to reference the new entry point.

Changes:

  • Add runcheckpot.bat and switch CI / pre-commit hook to use it instead of scons checkPot.
  • Remove the checkPot target/action/alias from sconstruct.
  • Update tests/checkPot.py CLI behavior and update developer/user documentation references.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
runcheckpot.bat New wrapper to build the POT via SCons and run tests/checkPot.py validation.
sconstruct Removes the checkPot target wiring now that it’s a standalone script.
tests/checkPot.py Updates __main__ exit behavior for standalone execution.
.pre-commit-config.yaml Updates the checkPot hook to run runcheckpot.bat.
ci/scripts/tests/translationCheck.ps1 Switches translation check CI step to the new batch script.
projectDocs/testing/automated.md Documents the new command for translation string checks.
projectDocs/dev/contributing.md Updates contributor guidance to use runcheckpot.bat.
projectDocs/dev/buildingNVDA.md Updates the threading example commands.
user_docs/en/changes.md Notes the replacement of scons checkPot with runcheckpot.bat.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread runcheckpot.bat
Comment thread runcheckpot.bat
Comment thread user_docs/en/changes.md
Comment thread projectDocs/dev/buildingNVDA.md
Comment thread tests/checkPot.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seanbudd seanbudd merged commit d8bf309 into nvaccess:master Mar 3, 2026
6 checks passed
@github-actions github-actions Bot added this to the 2026.2 milestone Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants