CondaPkg.jl icon indicating copy to clipboard operation
CondaPkg.jl copied to clipboard

Make `--override-channels` optional?

Open hwpang opened this issue 1 year ago • 1 comments

Thanks for the fantastic package! I am developing a Python package that depends on a Julia package. I use ENV["JULIA_CONDAPKG_BACKEND"] = "Current" to have CondaPkg uses the pre-exisintg conda environment.

However, when CondaPkg finds dependencies by some other julia packages, it overrides the channels. Some packages within the pre-existing conda environment fail because they are not available through those channels. Please see the snippet from our CI below.

Are there ways to disable --override-channels?

I tried adding using Pkg; Pkg.add("CondaPkg"); using CondaPkg; CondaPkg.add_channel("defaults"); CondaPkg.add_channel("rmg"); CondaPkg.add_channel("conda-forge"); CondaPkg.add_channel("cantera"); but that doesn't work.

ERROR: Error building `ReactionMechanismSimulator`: 
    CondaPkg Found dependencies: /usr/share/miniconda3/envs/rmg_env/share/julia/packages/PythonCall/bb3ax/CondaPkg.toml
    CondaPkg Found dependencies: /usr/share/miniconda3/envs/rmg_env/share/julia/packages/PythonPlot/KcWMF/CondaPkg.toml
    CondaPkg Resolving changes
             + libstdcxx-ng
             + matplotlib
             + python
    CondaPkg Installing packages
             │ /usr/share/miniconda3/condabin/conda
             │ install
             │ -y
             │ -p /usr/share/miniconda3/envs/rmg_env
             │ --override-channels
             │ --no-channel-priority
             │ libstdcxx-ng[version='>=3.4,<13.0']
             │ matplotlib[version='>=1']
             │ python[version='>=3.7,<4',channel='conda-forge',build='*cpython*']
             └ -c conda-forge
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... WARNING conda.models.version:get_matcher(562): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
failed

PackagesNotFoundError: The following packages are not available from current channels:

  - cclib[version='>=1.6.3,<1.8.0.*']
  - cantera=2.6.*
  - conda-forge::python[version='>=3.7,<4',build=*cpython*]

hwpang avatar Apr 01 '24 15:04 hwpang

The real issue here seems to be that your CondaPkg.add_channel calls did not have the desired effect - if they did, there would be more channels than just conda-forge in the micromamba command. Are you sure you did those calls in the same project that you then loaded ReactionMechanismSimulator from? Can you post some code that will reproduce the error you are seeing?

cjdoris avatar Apr 03 '24 18:04 cjdoris