conda / conda-lock

Lightweight lockfile for conda environments
https://conda.github.io/conda-lock/
Other
459 stars 102 forks source link

Create a preliminary internal v2 lockfile schema but enforce v1 #412

Closed maresb closed 1 year ago

maresb commented 1 year ago

As described in #411, the merge of #389 broke parsing of lockfiles for the conda-lock install command due to a schema change.

In this PR I create explicit v1 and v2 schema, the v2 being preliminary. The only difference between the two is that v2 omits the optional from packages. There is no loss of information thanks to the invariant optional = category != "main". Thus it's easy to convert between v1 and v2, and the corresponding functions are added here.

The combination of #389 and this PR should be a pure refactor, as input and output are done exclusively with the v1 schema.

This sets us up to make the schema modifiable, as there are some changes I'd like to make. (RFC coming soon...)

Before I consider this to be closing for #411, I want to add tests for conda-lock install. I merged #411 because the tests were green, despite the breakage, so I'd like to avoid this happening in the future.

netlify[bot] commented 1 year ago

Deploy Preview for conda-lock ready!

Name Link
Latest commit 7a9a707d0bfcb4d42849227e05e180300d73c2d0
Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/646a6d13b63c6d000839efd4
Deploy Preview https://deploy-preview-412--conda-lock.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

maresb commented 1 year ago

@srilman, I'd appreciate a review on this if you get the chance. Also, I'm going to try to rebase #390 on this soon.

maresb commented 1 year ago

I'm trying to update my #410 which rebases #390 so that the previous logic is reproduced. It it much trickier than I hoped. It's more of a logic puzzle than I can solve for tonight.

My goal would be to adjust #390 so that categories is not a set but a list. And that list should have the property that its first (or last) element should be the category selected previously.

This way, lockfile conversion would work as follows:

maresb commented 1 year ago

I don't like having a broken main, so I'm going to merge this. We can revert as needed.