-
Notifications
You must be signed in to change notification settings - Fork 266
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
base: main
Are you sure you want to change the base?
Add pylock #900
Conversation
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
.
My idea was to have from_dict independent of the class to cope for future evolution, but if a new version of the standard can't be implemented as a subclass of Pylock, return type of from_dict would change, so it would be a breaking change. If/when a new version of the spec arrive, it will still be time to design the API evolution, depending of the actual changes.
Here is the proposal for
pylock.toml
support.from_dict
function to validate and create aPylock
instance from a toml dict (obtained fromtomllib.load
)Pylock.to_dict
method to convert to a spec-compliant toml dict (assuming types were respected when populating the dataclass), preserving the recommended field orderingis_valid_pylock_path
to validate pylock file namesDocumentation is still TODO.
closes #898