conda / conda-lock

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

accept build strings in virtual package specs #429

Closed minrk closed 1 year ago

minrk commented 1 year ago

FakePackage didn't accept build strings, so one couldn't have e.g. __archspec=1=x86_64

Found while exploring #426

netlify[bot] commented 1 year ago

Deploy Preview for conda-lock ready!

Name Link
Latest commit 2fa493d92c3113be857868b040be3ae0f97093d7
Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/6482f5156bf785000805fd06
Deploy Preview https://deploy-preview-429--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

Without looking deeply into this or doing any testing, in order to avoid manipulating structured data as strings, could we do something like

from conda_lock._vendor.conda.models.match_spec import MatchSpec

...
ms = MatchSpec(version)
repodata.add_package(
    FakePackage(
        name=ms.name,
        version=ms.get("version", ""),
        build_string=ms.get("build", "")
    )
maresb commented 1 year ago

Thanks @minrk!