conda / conda-lock

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

Add test for GH #408 PackageRecord error #409

Closed maresb closed 9 months ago

maresb commented 1 year ago

I'm not sure what's causing #408 but I want to write a test so we can check when it's solved.

netlify[bot] commented 1 year ago

Deploy Preview for conda-lock ready!

Name Link
Latest commit 896157376076f88ad1725702c0b156cb43a2783e
Latest deploy log https://app.netlify.com/sites/conda-lock/deploys/65318d93a7004d000867d6f5
Deploy Preview https://deploy-preview-409--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.

ogrisel commented 9 months ago

I recently observed the KeyError for the __osx package when running a conda-lock with recent mamba & conda installed on my system.

I contributed a fix to the upstream repo that works for me:

I am not sure if this is related to this or not.

/cc @lesteve.

maresb commented 9 months ago

Ah, bad news, but thanks for letting us know. Also thanks for submitting the upstream fix! And also for raising visibility on this PR which I meant to merge.

maresb commented 9 months ago

@ogrisel, can you share your environment.yml file which led to the error?

ogrisel commented 9 months ago

@maresb here is the command I used:

conda-lock lock --mamba --kind explicit --platform osx-64 --file build_tools/azure/pylatest_conda_forge_mkl_osx-64_environment.yml --filename-template build_tools/azure/pylatest_conda_forge_mkl_osx-64_conda.lock

and here is the content of pylatest_conda_forge_mkl_osx-64_environment.yml:

channels:
  - conda-forge
dependencies:
  - python
  - numpy
  - blas[build=mkl]
  - scipy
  - cython
  - joblib
  - threadpoolctl
  - matplotlib
  - pandas
  - pyamg
  - pytest
  - pytest-xdist=2.5.0
  - pillow
  - setuptools
  - pytest-cov
  - coverage
  - ccache
  - compilers
  - llvm-openmp
lesteve commented 9 months ago

For the record this command runs fine for me on a Linux machine (conda 23.9.0 mamba 1.5.2 which are the latest releases at the time of writing), so maybe the issue only happens when running the command on an OSX machine?

ogrisel commented 9 months ago

Yes I believe that this might be because the __osx virtual package does not show up on a Linux host.

This is probably a bug of mamba or conda that ignores the --platform osx-64 argument when defining the system specific virtual packages.