conda-incubator / conda-project

Tool for encapsulating, running, and reproducing projects with Conda environments
https://conda-incubator.github.io/conda-project/
BSD 3-Clause "New" or "Revised" License
28 stars 11 forks source link

Environment is alway inconsistent: duplicate package #131

Closed AlbertDeFusco closed 1 year ago

AlbertDeFusco commented 1 year ago

Consider the following environment.yml file

dependencies:
  - urllib3>1.25
  - pip
  - pip:
    - botocore==1.15.32
channels:
  - defaults
platforms:
  - osx-arm64

This leads to two versions of urllib3 in the lockfile

❯ yq '.package[] | select(.name == "urllib3")' conda-lock.default.yml
{
  "name": "urllib3",
  "version": "2.0.3",
  "manager": "conda",
  "platform": "osx-arm64",
  "dependencies": {
    "brotli-python": ">=1.0.9",
    "pysocks": ">=1.5.6,<2.0,!=1.5.7",
    "python": ">=3.11,<3.12.0a0"
  },
  "url": "https://repo.anaconda.com/pkgs/main/osx-arm64/urllib3-2.0.3-py311hca03da5_0.conda",
  "hash": {
    "md5": "0d5982087bc909af0a793911cc31e772",
    "sha256": "afbd9db7f754fc530b84c40e30d5f159a55f21570159decb56c297ebd5003268"
  },
  "category": "main",
  "optional": false
}
{
  "name": "urllib3",
  "version": "1.25.11",
  "manager": "pip",
  "platform": "osx-arm64",
  "dependencies": {},
  "url": "https://files.pythonhosted.org/packages/56/aa/4ef5aa67a9a62505db124a5cb5262332d1d4153462eb8fd89c9fa41e5d92/urllib3-1.25.11-py2.py3-none-any.whl",
  "hash": {
    "sha256": "f5321fbe4bf3fefa0efd0bfe7fb14e90909eb62a48ccda331726b4319897dd5e"
  },
  "category": "main",
  "optional": false
}

But only one version of the package according to Conda, the pypi version

❯ conda list -p ./envs/default
# packages in environment at ./envs/default:
#
# Name                    Version                   Build  Channel
botocore                  1.15.32                  pypi_0    pypi
brotli-python             1.0.9           py311h313beb8_7  
bzip2                     1.0.8                h620ffc9_4  
ca-certificates           2023.05.30           hca03da5_0  
docutils                  0.15.2                   pypi_0    pypi
jmespath                  0.10.0                   pypi_0    pypi
libcxx                    14.0.6               h848a8c0_0  
libffi                    3.4.4                hca03da5_0  
ncurses                   6.4                  h313beb8_0  
openssl                   3.0.9                h1a28f6b_0  
pip                       23.1.2          py311hca03da5_0  
pysocks                   1.7.1           py311hca03da5_0  
python                    3.11.4               hb885b13_0  
python-dateutil           2.8.2                    pypi_0    pypi
readline                  8.2                  h1a28f6b_0  
setuptools                67.8.0          py311hca03da5_0  
six                       1.16.0                   pypi_0    pypi
sqlite                    3.41.2               h80987f9_0  
tk                        8.6.12               hb8d0fd4_0  
tzdata                    2023c                h04d1e81_0  
urllib3                   1.25.11                  pypi_0    pypi
wheel                     0.38.4          py311hca03da5_0  
xz                        5.4.2                h80987f9_0  
zlib                      1.2.13               h5a0b063_0