-
Notifications
You must be signed in to change notification settings - Fork 1
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
Parse metadata fields from sdist artifacts #7
Conversation
@@ -90,11 +93,29 @@ def test_basic_metadata_absl_py_09(self) -> None: | |||
) | |||
self.assertEqual({"test"}, bm.provides_extra) | |||
|
|||
def test_basic_metadata_fields(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you include a couple more words about who does this -- is this from modern setuptools, or something else like flit/poetry/hatchling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update test to have Description.
Move the contents of the PKG-INFO to a module const.
metadata_please/sdist.py
Outdated
data = zf.read(requires[0]) | ||
assert data is not None | ||
return BasicMetadata.from_sdist_pkg_info_and_requires(b"", data) | ||
pkg_info = next(f for f in zf.namelist() if f.endswith("/PKG-INFO")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider sorting this by length and taking the shortest; these might exist in test data and these archives are generally alphabetic order. I'll try to find you a real-world artifact that needs this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nose 1.3.1 (test data)
ucxdsa 2024.4.23 (project rename, didn't clean)
relaxed-poetry 0.2.2 (test data)
wish 1.0.1 (.lib
dir)
additionally looks like rust projects don't have a top level dir
orjson 3.5.0
rfernet 0.1.3
metadata_please/sdist.py
Outdated
requires_fo = tf.extractfile(requires[0]) | ||
assert requires_fo is not None | ||
else: | ||
requires_fo = b"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a copypaste error from the zip one, I like requires_DATA = b""
and doing the read a couple lines above rather than in the last line of this func.
No description provided.