-
Notifications
You must be signed in to change notification settings - Fork 278
Add pylock #900
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
Add pylock #900
Conversation
src/packaging/pylock.py
Outdated
| url: str | None # = None | ||
| path: str | None # = None | ||
| size: int | None # = None | ||
| upload_time: datetime | None # = 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.
In the spec, the upload_time field is not at the same position for archive and sdist / wheel.
Is that intended or something we want to tweak here and/or in the spec?
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.
That was intended as the idea (and expected value) comes from the index API and I don't think archives are supported there.
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.
But if people have uses for an upload time for archives then I suspect making it a 1.1 change wouldn't be controversial.
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.
Note my remark was only about the ordering of the fields, not about the presence of upload_time in archive.
f3fc4ad to
5ab8ae9
Compare
|
I consider this PR ready for review. I plan to add documentation after a first round of review, assuming the overall design is agreeable to packaging maintainers, of course. |
|
FYI I'm hoping to look at this post-EuroPython in hopes that it helps unblock pip so it can add installation support for |
brettcannon
left a comment
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.
Looks good overall! Some docstring tweaks-- since that will be documentation --and potential test tweaks. You can feel free to ignore the assignment expression suggestions if you want.
a59d102 to
bc61305
Compare
|
@brettcannon thanks for the review. I handled the comments and added a documentation page. This is ready for a second round. |
|
LGTM! Thanks for all the work on this, @sbidoul ! @pradyunsg @henryiii any opinions on this before we merge it? |
|
I'm heading out for a week, won't have time to review the code soon, excited by the idea though! :) Is the docs failure related? Looks like it might be due to a merge after #897? |
The error does look related, if I get a moment in the next few days I will try and checkout this branch and understand why this is happening in the docs build. |
This was not meant to be public
|
I added a few commits with some minor improvements, notably:
Let me know if there is something else I can do. |
|
My approval stands, so I think we just need @henryiii or @pradyunsg to also approve and then we can merge this! |
henryiii
left a comment
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.
I actually thought I had approved this.
|
Thanks to @sbidoul for the PR and everyone for their reviews! |
|
This is awesome, thanks a ton @sbidoul! |
|
I now selfishly hope this unblocks |
|
This is exciting news 🎉 |
Here is the proposal for
pylock.tomlsupport.Pylock.from_dictclass method to validate and create aPylockinstance from a toml dict (obtained fromtomllib.load)Pylock.to_dictmethod to convert to a spec-compliant toml dict (assuming types were respected when populating the dataclass), preserving the recommended field orderingis_valid_pylock_pathto validate pylock file namesvalidatemethod to check that a Pylock instance is spec compliant (one obtained fromfrom_dictis guaranteed to be, but one created manually may not be)Documentation is still TODO.closes #898