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 always inconsistent: pypi package name #132

Closed AlbertDeFusco closed 1 year ago

AlbertDeFusco commented 1 year ago

Consider the following

dependencies:
  - python=3.10
  - pip
  - pip:
    - pyrfc3339==1.1
channels:
  - defaults
platforms:
  - osx-arm64

the lockfile contains the pypi hash

> conda-project lock
> yq '.package[] | select(.name == "pyrfc3339")' conda-lock.default.yml
{
  "name": "pyrfc3339",
  "version": "1.1",
  "manager": "pip",
  "platform": "osx-arm64",
  "dependencies": {
    "pytz": "*"
  },
  "url": "https://files.pythonhosted.org/packages/c1/7a/725f5c16756ec6211b1e7eeac09f469084595513917ea069bc023c40a5e2/pyRFC3339-1.1-py2.py3-none-any.whl",
  "hash": {
    "sha256": "67196cb83b470709c580bb4738b83165e67c6cc60e1f2e4f286cfcb402a926f4"
  },
  "category": "main",
  "optional": false
}

But the package name according to pip freeze has a different capitalization

❯ conda run -p ./envs/default pip freeze
pyRFC3339 @ https://files.pythonhosted.org/packages/c1/7a/725f5c16756ec6211b1e7eeac09f469084595513917ea069bc023c40a5e2/pyRFC3339-1.1-py2.py3-none-any.whl#sha256=67196cb83b470709c580bb4738b83165e67c6cc60e1f2e4f286cfcb402a926f4
pytz @ https://files.pythonhosted.org/packages/7f/99/ad6bd37e748257dd70d6f85d916cafe79c0b0f5e2e95b11f7fbc82bf3110/pytz-2023.3-py2.py3-none-any.whl#sha256=a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb

so conda-project thinks pyRFC3339 and pyrfc3339 are different packages.