-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: added experimental fields to conda lock #221
Conversation
So that it is possible to re-create a package record from a locked package
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 to me! But could you also implement From<RepoDataRecord>
and vice versa for LockedPackage
? Then we are sure it will work!
@@ -263,6 +264,52 @@ pub struct LockedDependency { | |||
pub source: Option<Url>, | |||
/// Build string | |||
pub build: Option<String>, | |||
|
|||
/// Experimental: architecture field | |||
#[serde(skip_serializing_if = "Option::is_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.
You can use:
https://docs.rs/serde_with/3.0.0/serde_with/attr.skip_serializing_none.html
To avoid having to repeat this everywhere.
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.
Nice!
I think I'm unable to implement From directly seeing as some fields can be |
You could also implement TryFrom where the conversion could fail |
Did all that please check it again :) @baszalmstra |
So that it is possible to re-create a package record from a locked package