Rename format_full_version to _format_full_version to make it visibly private#1125
Merged
henryiii merged 3 commits intoApr 9, 2026
pypa:mainpypa/packaging:mainfrom
r266-tech:rename-format-full-version-privater266-tech/packaging:rename-format-full-version-privateCopy head branch name to clipboard
Merged
Rename format_full_version to _format_full_version to make it visibly private#1125henryiii merged 3 commits intopypa:mainpypa/packaging:mainfrom r266-tech:rename-format-full-version-privater266-tech/packaging:rename-format-full-version-privateCopy head branch name to clipboard
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
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. ( |
brettcannon
previously requested changes
Mar 23, 2026
brettcannon
left a comment
Member
There was a problem hiding this comment.
Please fix the linting issue.
henryiii
force-pushed
the
rename-format-full-version-private
branch
from
March 27, 2026 13:55
daba1d9 to
4cc648b
Compare
henryiii
force-pushed
the
rename-format-full-version-private
branch
from
April 5, 2026 18:15
4cc648b to
fddbc95
Compare
Contributor
Author
|
The linting issue has been fixed (manually sorted imports). All CI checks are now passing — ready for re-review. |
henryiii
force-pushed
the
rename-format-full-version-private
branch
from
April 7, 2026 05:13
fddbc95 to
c50336a
Compare
Closed
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
force-pushed
the
rename-format-full-version-private
branch
from
April 8, 2026 19:11
c50336a to
0b09416
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #504
Summary
The
format_full_version()function inpackaging/markers.pyis 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
format_full_version→_format_full_versioninsrc/packaging/markers.pytests/test_markers.pyTesting
All 2252 marker tests pass.