Package: pdm-conda
pdm-condaA PDM plugin to resolve/install/uninstall project dependencies with Conda.ConfigurationConfig itemDescriptionDefault valuePossible valuesEnvironment variableconda.runnerConda runner executablecondaconda,mamba,micromambaPDM_CONDA_RUNNERconda.solverSolver to use for Conda resolutioncondaconda,libmambaPDM_CONDA_SOLVERconda.channelsConda channels to use, order will be enforced[]conda.as-default-managerUse Conda to install all possible requirementsFalsePDM_CONDA_AS_DEFAULT_MANAGERconda.batched-commandsExecute batched install and remove Conda commands, when True the command is executed only at the endFalsePDM_CONDA_BATCHED_COMMANDSconda.excludesArray of dependencies to exclude from Conda resolution[]conda.installation-methodInstallation method to use when installing dependencies with Condahard-linkhard-link,copyPDM_CONDA_INSTALLATION_METHODconda.dependenciesArray of dependencies to install with Conda, analogue toproject.dependencies[]conda.optional-dependenciesGroups of optional dependencies to install with Conda, analogue toproject.optional-dependencies{}conda.dev-dependenciesGroups of development dependencies to install with Conda, analogue totool.pdm.dev-dependencies{}conda.pypi-mapping.download-dirPyPI-Conda mapping download directory$HOME/.pdm-conda/PDM_CONDA_PYPI_MAPPING_DIRconda.pypi-mapping.urlPyPI-Conda mapping urlhttps://github.com/regro/cf-graph-countyfair/raw/master/mappings/pypi/grayskull_pypi_mapping.yamlPDM_CONDA_PYPI_MAPPING_URLAll configuration items use prefixpdm.tool, this is a viable configuration:[tool.pdm.conda]runner="micromamba"channels=["conda-forge/noarch","conda-forge","anaconda"]dependencies=["pdm"]as-default-manager=truesolver="libmamba"excludes=["pytest-cov"]# don't install with conda even if it's a dependency from other packagesinstallation-method="copy"batched-commands=true[tool.pdm.conda.pypi-mapping]download-dir="/tmp"url="https://url/to/mapping.yaml"[tool.pdm.conda.optional-dependencies]extra=["anaconda:ffmpeg"]# non python dependency, obtained from anaconda channel[tool.pdm.conda.dev-dependencies]dev=["pytest"]UsageThis plugin adds capabilities to the default PDM commands.Working commandsThe following commands were tested and work:pdm init:To list/use Conda managed python you must specify the Conda runner with-cror--runner.You also can specify a default Conda channel with-cor--channel.pdm lockpdm installpdm add:To add a Conda managed package--condaflag can be used multiple times followed a package (analogue
to--editable).You can specify per package Conda channel using conda notationchannel::package.You also can specify a default Conda channel with-cor--channel.With flag-ror--runneryou can specify the Conda runner to use.With flag-ceor--conda-excludesyou can add PyPi packages to the excluded from Conda resolution.With flag--conda-as-default-manageryou can setconda.as-default-managertoTrue.pdm removepdm updatepdm listpdm infopdm venv:create:To list/use Conda managed python you must specify the Conda runner with-wor--with.You can completely override the Conda environment name with-cnor--conda-name, the resulting environment
won't follow PDM environment naming conventions.listHow it worksUsing conda/libmamba solverPDM invokes Conda solver to resolve conda packages each time a PDM candidate makes a change in the last Conda
resolution.If only Conda packages are used (i.e. settingconda.as-default-managertotrueand noconda.excludes) then Conda
solver is invoked only once.Settings overridenIn order to use Conda to install packages some settings were overriden:python.use_venvif conda settings detected inpyproject.tomlthis setting is set toTrue.python.in_projectif conda settings detected inpyproject.tomland this setting was not previously set then is set
toFalse.python.use_pyenvif conda settings detected inpyproject.tomlthis setting is set toFalse.venv.backendif conda settings detected inpyproject.tomlthis setting is set toconda.runner.venv.locationif conda settings detected inpyproject.toml,VIRTUAL_ENVorCONDA_PREFIXenvironment
variables are set and this setting was not previously set then is set to the value of the environment variable.install.parallelif some Conda managed packages are to be uninstalled or updated this option is disabled
momentarily.Some environment variables were overridden too:PDM_IGNORE_ACTIVE_VENVif conda settings detected inpyproject.tomlandVIRTUAL_ENVorCONDA_PREFIXenvironment variables are set then this variable is set toFalse.Lock strategyLock strategyno_cross_platformforpdm lockis always forced as Conda doesn't produce cross-platform locks.Lock strategystatic_urlsfor Conda managed packages is always forced, independently of the lock strategy used for
PyPi packages.Lock strategydirect_minimal_versionsfor Conda managed packages will partially work as Conda doesn't have an option
to force this mode on a resolution.DevelopmentFor developmentdocker-composefiles exist indeploydirectory, helper scriptdeploy/docker-compose.shcan be used
for executing docker.For running dev environment:bashdeploy/docker-compose.sh-dupAnd for productive environment:bashdeploy/docker-compose.shup