-
Notifications
You must be signed in to change notification settings - Fork 295
Parse raw metadata #671
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
Merged
Merged
Parse raw metadata #671
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3a097a3
Implement RawMetadata
brettcannon 4be6034
Minor tweaks
brettcannon f5174f4
Add tests for field frequency handling
brettcannon 1a1dc80
Test `keywords`
brettcannon fe70df3
Add tests for `Project-URL` parsing
brettcannon 62cb64f
Test `str` and `bytes` input
brettcannon bd86a21
Test handling of `description`
brettcannon 25b320a
Don't worry about multi-part email bodies
brettcannon f0e5271
Test that keys are lower-cased
brettcannon 1670328
Support using `pathlib.Path` in `_manylinux`
brettcannon ac3190f
Add a complete test
brettcannon 28a9480
`abc.ABC` is not subscriptable until Python 3.9
brettcannon ae014d6
`TypedDict` was introduced in Python 3.8
brettcannon 4f9aa08
Linting touch-ups
brettcannon fb5db93
Remove code path that never seems to be exercised
brettcannon a81ede7
Linting touch-ups
brettcannon d466ddb
Make mypy happy
brettcannon d1bd707
Drop 3.7 support
brettcannon 8561ece
Add docs
brettcannon d86e436
Merge branch 'main' into raw-metadata
brettcannon 4d97abe
Apply suggestions from code review
brettcannon 76062f3
Update tests/metadata/everything.metadata
brettcannon 004f136
Update a test
brettcannon 2674e55
Make isort happy
brettcannon 4164911
Be compatible with Python 3.7
brettcannon 9366d3a
Merge branch 'main' into raw-metadata
brettcannon 31e1b22
More 3.7 support
brettcannon 492d678
Merge branch 'raw-metadata' of github.com:brettcannon/packaging into …
brettcannon f8ded2f
Poetry via pip via pep517 isn't happy
brettcannon 6ce6b97
Try to get around isort triggering a failure via Poetry
brettcannon f0c6c61
Try another suggestion on how to make `TypedDict` not error out in Py…
brettcannon ebe3e30
Merge branch 'main' into raw-metadata
brettcannon 092e153
Merge branch 'main' into raw-metadata
brettcannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ You can install packaging with ``pip``: | |
| specifiers | ||
| markers | ||
| requirements | ||
| metadata | ||
| tags | ||
| utils | ||
|
|
||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| Metadata | ||
| ======== | ||
|
|
||
| .. currentmodule:: packaging.markers | ||
|
|
||
|
|
||
| Both `source distributions`_ and `binary distributions` | ||
| (_sdists_ and _wheels_, respectively) contain files recording the | ||
| `core metadata`_ for the distribution. This information is used for | ||
| everything from recording the name of the distribution to the | ||
| installation dependencies. | ||
|
|
||
|
|
||
| Usage | ||
| ----- | ||
|
|
||
| .. doctest:: | ||
|
|
||
| >>> from packaging.metadata import parse_email | ||
| >>> metadata = "Metadata-Version: 2.3\nName: packaging\nVersion: 24.0" | ||
| >>> raw, unparsed = parse_email(metadata) | ||
| >>> raw["metadata_version"] | ||
| '2.3' | ||
| >>> raw["name"] | ||
| 'packaging' | ||
| >>> raw["version"] | ||
| '24.0' | ||
|
|
||
|
|
||
| Reference | ||
| --------- | ||
|
|
||
| Low Level Interface | ||
| ''''''''''''''''''' | ||
|
|
||
| .. automodule:: packaging.metadata | ||
| :members: | ||
|
|
||
|
|
||
| .. _source distributions: https://packaging.python.org/en/latest/specifications/source-distribution-format/ | ||
| .. _binary distributions: https://packaging.python.org/en/latest/specifications/binary-distribution-format/ | ||
| .. _core metadata: https://packaging.python.org/en/latest/specifications/core-metadata/ |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.