Split virtual-package repo from LockSpecification #663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In preparation for exporting
LockSpecification
s in #664This is a refactor so I don't expect it to be controversial.
The goal here is simply to remove
virtual_package_repo
fromconda_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 timevirtual_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:
virtual_package_repo
fromLockSpecification
Already we can see that the
make_lock_spec
doesn't needvirtual_package_repo
so I can simplify some of the tests by removing the unusedvirtual_package_repo
context manager.