Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rename format_full_version to _format_full_version to make it visibly private#1125

Merged
henryiii merged 3 commits into
pypa:mainpypa/packaging:mainfrom
r266-tech:rename-format-full-version-privater266-tech/packaging:rename-format-full-version-privateCopy head branch name to clipboard
Apr 9, 2026
Merged

Rename format_full_version to _format_full_version to make it visibly private#1125
henryiii merged 3 commits into
pypa:mainpypa/packaging:mainfrom
r266-tech:rename-format-full-version-privater266-tech/packaging:rename-format-full-version-privateCopy head branch name to clipboard

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Fixes #504

Summary

The format_full_version() function in packaging/markers.py is not exposed via __all__, but its name doesn't indicate it's private. This PR renames it to _format_full_version() to make its internal nature explicit, as suggested by @brettcannon in the original issue.

Changes

  • Renamed format_full_version_format_full_version in src/packaging/markers.py
  • Updated import and test calls in tests/test_markers.py

Testing

All 2252 marker tests pass.

@henryiii

Copy link
Copy Markdown
Contributor

I can't quickly find any users of this, so I think it's safe to rename. We can always reintroduce with a deprecation warning if it breaks anything.

Linters expect the all list to be sorted, otherwise is fine, I think. (prek -a or nox -s lint locally should do it)

@brettcannon brettcannon 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.

Please fix the linting issue.

@henryiii
henryiii force-pushed the rename-format-full-version-private branch from daba1d9 to 4cc648b Compare March 27, 2026 13:55
@henryiii
henryiii requested a review from brettcannon April 5, 2026 18:15
@henryiii
henryiii force-pushed the rename-format-full-version-private branch from 4cc648b to fddbc95 Compare April 5, 2026 18:15
@r266-tech

Copy link
Copy Markdown
Contributor Author

The linting issue has been fixed (manually sorted imports). All CI checks are now passing — ready for re-review.

@henryiii
henryiii force-pushed the rename-format-full-version-private branch from fddbc95 to c50336a Compare April 7, 2026 05:13
@henryiii henryiii mentioned this pull request Apr 7, 2026
OSC Contributor and others added 2 commits April 8, 2026 15:11
The function is not exposed in __all__ and is only used internally
by default_environment(). Renaming it with a leading underscore makes
its private nature explicit, addressing the ambiguity noted in pypa#504.
@henryiii
henryiii force-pushed the rename-format-full-version-private branch from c50336a to 0b09416 Compare April 8, 2026 19:11
@henryiii
henryiii merged commit 668da86 into pypa:main Apr 9, 2026
57 checks passed
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.

Document or rename markers.format_full_version()

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.