Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: support build metadata #13

Merged
merged 5 commits into from
Sep 21, 2022
Merged

Feat: support build metadata #13

merged 5 commits into from
Sep 21, 2022

Conversation

agoose77
Copy link
Owner

PEP #440 specifies local version identifiers. There is a similar feature in NPM called the build metadata. This PR adds support for these versions, with some caveats:

  1. Python's local version is considered for version comparison, whereas NPM's build metadata is not. Therefore, although the two version segments are similar, they are not equal in behavior.
  2. Python's local version additionally requires that the leading and trailing characters must be ASCII letters or digits, therefore the NPM version is subject to the same constraints.

Originally this PR included an option to disable support for build metadata, but it is actually not needed, as build metadata does not break round-tripping.

feat: add `allow_local_segment` option

test: validate `allow_local_segment` option

refactor: change `allow_local_segment` to `allow_build_segment`

refactor: change `allow_build_segment` to `allow_build_metadata`

refactor: drop `allow_build_metadata` option
@agoose77
Copy link
Owner Author

agoose77 commented Sep 20, 2022

@ofek could you verify this PR fixes the mkdocs issue, please? :)

@ofek
Copy link
Contributor

ofek commented Sep 21, 2022

test

@agoose77
Copy link
Owner Author

That looks like success to me!

@agoose77 agoose77 merged commit 270d9db into master Sep 21, 2022
@agoose77 agoose77 deleted the feat-support-local branch September 21, 2022 08:40
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.

2 participants