Skip to content

Fix extract_messages dry-run behavior - #1313

Open
nightcityblade wants to merge 1 commit into
python-babel:masterfrom
nightcityblade:fix/issue-910
Open

Fix extract_messages dry-run behavior#1313
nightcityblade wants to merge 1 commit into
python-babel:masterfrom
nightcityblade:fix/issue-910

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #910

The setuptools extract_messages command now honors the distutils dry-run flag and returns before creating or overwriting its output catalog. A regression test verifies that an existing POT file remains unchanged.

Tests:

  • pytest -q tests/messages (353 passed)
  • uvx ruff==0.14.10 check babel/messages/setuptools_frontend.py tests/messages/test_setuptools_frontend.py

@akx akx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Erm. Doesn't this mean that passing --dry-run is equivalent to not calling the command at all? That's not the point.

@nightcityblade

Copy link
Copy Markdown
Author

Thanks — you're right. I reworked the implementation so dry-run now performs mapping, extraction, and serialization into an in-memory buffer while leaving the output catalog untouched. The regression test also asserts that extraction actually occurred. The full messages test suite passes (353 tests), and Ruff passes on all changed files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--dry-run does not work as expected

2 participants