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

Update pkginfo library to support newer python packages #683

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dralley
Copy link
Contributor

@dralley dralley commented Jun 25, 2024

closes #682

@dralley dralley marked this pull request as draft June 25, 2024 14:20
@dralley
Copy link
Contributor Author

dralley commented Jun 25, 2024

Might need some fields added as well

@github-actions github-actions bot added the multi-commit Add to bypass single commit lint check label Jun 25, 2024
@github-actions github-actions bot removed the multi-commit Add to bypass single commit lint check label Jun 28, 2024
@dralley dralley force-pushed the dep-bump branch 3 times, most recently from 6a473a1 to 2c7bd88 Compare June 28, 2024 04:23
@dralley
Copy link
Contributor Author

dralley commented Jun 28, 2024

I need to find a package that uses metadata version 2.3 and also uses this dynamic field, so that we can properly test it.

edit: or maybe we need to make one. Is there anything in pulp_python currently like the test I added to pulp_rpm that uses a package constructed specifically to exercise every field available, and then checks the API response once uploaded / synced to verify that they match?

@dralley
Copy link
Contributor Author

dralley commented Jun 28, 2024

Looks like the twine package happens to have dynamic set.

@gerrod3
Copy link
Contributor

gerrod3 commented Jun 28, 2024

No we don't have any dynamic fixtures to create packages with specified fields.

@dralley
Copy link
Contributor Author

dralley commented Jun 28, 2024

I don't mean dynamic fixtures necessarily, even a pre-generated package in the fixtures would be fine

But I assume the answer there is also probably no. That's fine, I can make do

@@ -178,6 +182,7 @@ class PythonPackageContent(Content):
classifiers = models.JSONField(default=list)
project_urls = models.JSONField(default=dict)
description_content_type = models.TextField()
dynamic = models.TextField()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing provides_extra. Added in 2.1. Also, can we reformat the list to be like pkginfo? https://github.com/jwilk-mirrors/python-pkginfo/blob/master/pkginfo/distribution.py#L124

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. For provides_extra, are we going to be missing metadata for existing packages? I don't think we ever had a problem with rejection of metadata 2.1 packages as we did with 2.3

How do you want to deal with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I filed pypi/warehouse#16190 because I'm having difficulty figuring out exactly what these fields are meant to look like. The core metadata specification describes how they're represented in the metadata files within a package, not how they're represented on PyPI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. For provides_extra, are we going to be missing metadata for existing packages? I don't think we ever had a problem with rejection of metadata 2.1 packages as we did with 2.3

How do you want to deal with that?

We might need to create a new endpoint that runs a task to fix bad metadata. Unless you are uploading every package most python content will have incorrect metadata because syncing doesn't individually check the metadata for each package. Currently we take the latest's package metadata and re-use it for every version of that package.

@dralley dralley force-pushed the dep-bump branch 6 times, most recently from f0f7867 to c490361 Compare July 8, 2024 02:38
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.

Support Metadata 2.3 | update version of pkginfo
2 participants