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

Split virtual-package repo from LockSpecification #663

Merged
merged 2 commits into from
Sep 7, 2024

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Aug 29, 2024

Description

In preparation for exporting LockSpecifications in #664

This is a refactor so I don't expect it to be controversial.

The goal here is simply to remove virtual_package_repo from conda_lock.models.lock_spec.LockSpecification. The reason is that the virtual packages are only really used when computing the content hash. So while I think one could make a principled argument either way that the virtual packages are or are not part of the lock specification, there seems to me like a very practical split of the functionality. Most of the time virtual_package_repo is simply tagging along for the ride. It's nice to not need to pass around extra data when it's unneeded, and especially to make it clearer when it's needed.

So all I do here is:

  1. Remove virtual_package_repo from LockSpecification
  2. Add it as a function argument in the locations where it needs to be passed around.
  3. Switch to a more logical ordering of operations when generating the lockfile so that the virtual package repo is only created on disk when the dependencies are actually locked.

Already we can see that the make_lock_spec doesn't need virtual_package_repo so I can simplify some of the tests by removing the unused virtual_package_repo context manager.

@maresb maresb requested a review from a team as a code owner August 29, 2024 12:41
Copy link

netlify bot commented Aug 29, 2024

Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit 2d86747
🔍 Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/66dc24cf8312ff0008bfe158
😎 Deploy Preview https://deploy-preview-663--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 configuration.

@maresb maresb force-pushed the split-virtual-package-from-lockspec branch from 140bd32 to 2d86747 Compare September 7, 2024 10:02
@maresb maresb merged commit 1d33e10 into conda:main Sep 7, 2024
10 checks passed
@maresb maresb deleted the split-virtual-package-from-lockspec branch September 7, 2024 10:47
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.

1 participant