Closed Firionus closed 9 months ago
Hi!
I never tested the plugin behavior when using --global
flag, if you want to alter some packages from the base
environment just activate it and run pdm
inside, if you initialized pdm-conda
configs on pyproject.toml
then it should work correctly. If you invoke pdm add --conda cowsay --runner micromamba --channel conda-forge
or use the following configuration
[tool.pdm.conda]
runner = "micromamba"
channels = ["conda-forge"]
as-default-manager = true
Then pdm
should modify the active conda environment using micromamba
correctly.
I might fix --global
flag compatibility in the future but it's not a priority right now.
Steps to reproduce
Dockerfile
```Dockerfile FROM continuumio/miniconda3:23.9.0-0 RUN apt-get update RUN apt-get install -y curl RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 - ENV PATH="/root/.local/bin:${PATH}" RUN pdm self add pdm-conda ```Console Dump from Docker Container
``` (base) root@67adafac36ce:/# pdm add -gv cowsay Changes are written to pyproject.toml. Adding packages to default dependencies: cowsay STATUS: Resolving dependencies pdm.termui: ======== Start resolving requirements ======== pdm.termui: pip pdm.termui: setuptools pdm.termui: wheel pdm.termui: cowsay pdm.termui: python>=3.11.5,<3.11.6 pdm.termui: Adding requirement pip pdm.termui: Adding requirement setuptools pdm.termui: Adding requirement wheel pdm.termui: Adding requirement cowsay pdm.termui: Adding requirement python>=3.11.5,<3.11.6 pdm.termui: ======== Starting round 0 ======== STATUS: Resolving: new pin python>=3.11.5,<3.11.6 pdm.termui: Pinning: python None pdm.termui: ======== Ending round 0 ======== pdm.termui: ======== Starting round 1 ======== STATUS: Resolving: new pin cowsay 6.1 pdm.termui: Pinning: cowsay 6.1 pdm.termui: ======== Ending round 1 ======== pdm.termui: ======== Starting round 2 ======== STATUS: Resolving: new pin pip 23.3.1 pdm.termui: Pinning: pip 23.3.1 pdm.termui: ======== Ending round 2 ======== pdm.termui: ======== Starting round 3 ======== STATUS: Resolving: new pin setuptools 68.2.2 pdm.termui: Pinning: setuptools 68.2.2 pdm.termui: ======== Ending round 3 ======== pdm.termui: ======== Starting round 4 ======== STATUS: Resolving: new pin wheel 0.41.3 pdm.termui: Pinning: wheel 0.41.3 pdm.termui: ======== Ending round 4 ======== pdm.termui: ======== Starting round 5 ======== pdm.termui: ======== Resolution Result ======== pdm.termui: Stable pins: pdm.termui: python None pdm.termui: cowsay 6.1 pdm.termui: pip 23.3.1 pdm.termui: setuptools 68.2.2 pdm.termui: wheel 0.41.3 STATUS: Fetching hashes for resolved packages... pdm.termui: Fetching hashes for cowsay@6.1 pdm.termui: Fetching hashes for wheel@0.41.3 pdm.termui: Fetching hashes for pip@23.3.1 pdm.termui: Fetching hashes for setuptools@68.2.2 đ Lock successful Changes are written to pyproject.toml. STATUS: Resolving packages from lockfile... STATUS: Fetching hashes for resolved packages... Synchronizing working set with resolved packages: 1 to add, 3 to update, 0 to remove pdm.termui: Removing distribution pip unearth.preparer: Downloading (2.1 MB) â Update pip 23.2.1 -> 23.3.1 successful pdm.termui: Removing distribution setuptools unearth.preparer: Downloading (807 kB) Error processing line 1 of /opt/conda/lib/python3.11/site-packages/distutils-precedence.pth: Traceback (most recent call last): File "Actual behavior
AttributeError: 'PythonEnvironment' object has no attribute 'env_dependencies'
(see console dump for details)Expected behavior
Environment Information