conda / conda-lock

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

New Source File and Lock Specification Approach #316

Open srilman opened 1 year ago

srilman commented 1 year ago

This PR implements the new method of parsing source files, combining them, and representing lock specifications discussed in https://github.com/conda-incubator/conda-lock/issues/278#issuecomment-1371407231. The new approach is as follows:

A SourceFile object is defined as containing:

class SourceFile(StrictModel):
    file: pathlib.Path
    dependencies: List[SourceDependency]
    # TODO: Should we store the auth info in here?
    channels: List[Channel]
    platforms: Set[str]
class LockSpecification(BaseModel):
    dependencies: Dict[str, List[Dependency]]  # Dict mapping platform to deps
    # TODO: Should we store the auth info in here?
    channels: List[Channel]
    sources: List[pathlib.Path]
    virtual_package_repo: Optional[FakeRepoData] = None
netlify[bot] commented 1 year ago

Deploy Preview for conda-lock ready!

Name Link
Latest commit 3fd71064a36560f921eb42ace04bea1203a6354c
Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/63d58efacacd190009b709d8
Deploy Preview https://deploy-preview-316--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.

mariusvniekerk commented 1 year ago

Can you break this into a few smaller prs doing the model class moves first. The way this is now is very hard to review

srilman commented 1 year ago

320 contains some of the refactoring I did in this PR. Its about 500 lines of changes, but most of it is moving classes and functions around with no content changes.

maresb commented 1 year ago

Wonderful. Now we need a rebase here, whenever you get the chance, and then we can review.

srilman commented 1 year ago

I rewrote #300 to work on top of this PR. So we would need this PR in first.