conda_poetry_liaison
Do not use another package manager in a conda environment.
Many are given this advice, but we do this anyway.
We want our conda-only packages with the awesome features of poetry.
conda_poetry_liaison is a small collection of scripts to make this as painless and reproducible as possible.
Scripts
cpl-deps
The primary issue of using other package managers like pip and poetry inside a conda environment is that they will not communicate. If you install a package with conda, then install a different one in pip, conda will have no idea what has changed. So once you start using pip or poetry, you cannot use conda to install a package in that same environment.
This script will add all Python packages installed in the conda environment into the pyproject.toml file.
Now, poetry will be aware of these packages during dependency solving.
usage: cpl-deps [-h] [--env_name [ENV_NAME]] [--env_path [ENV_PATH]] [--group_name [GROUP_NAME]] [toml_path]
Notify poetry of conda Python packages
positional arguments:
toml_path Path to TOML file
options:
-h, --help show this help message and exit
--env_name [ENV_NAME]
Name of conda environment to probe
--env_path [ENV_PATH]
Path of conda environment to probe
--group_name [GROUP_NAME]
Name of poetry dependency group
cpl-clean
There seems to be a remnant of direct_url.json files from conda package installations that break poetry (as discussed here).
One workaround is to delete these files in the conda environment directory before using poetry.
usage: cpl-clean [-h] [env_path]
Notify poetry of conda Python packages
positional arguments:
env_path Path of conda environment to clean
options:
-h, --help show this help message and exit
Development
Install poetry if you do not have it.
make poetry-download
If you already have poetry installed, make sure you have poetry-dynamic-versioning.
poetry self add "poetry-dynamic-versioning[plugin]"
Install the package.
make install
Install all pre-commits.
make pre-commit-install
Release files for conda-poetry-liaison 0.0.0.post14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| conda_poetry_liaison-0.0.0.post14.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| conda_poetry_liaison-0.0.0.post14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / conda_poetry_liaison-0.0.0.post14.tar.gz
| Download URL | conda_poetry_liaison-0.0.0.post14.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f77492acc330b7ba2c433c5e191619c0bc1f3814e6a4ffc973fe720493a30857
|
|
BLAKE2b-256 checksum How to use checksums |
7efe6eb7d13733b53e5bc7d559f8de652ff450315697788c519662f73ec41ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / conda_poetry_liaison-0.0.0.post14-py3-none-any.whl
| Download URL | conda_poetry_liaison-0.0.0.post14-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4ccb40c551bb6248473cf07d5ba9a5c023900998d3556a7a40696912616565d
|
|
BLAKE2b-256 checksum How to use checksums |
706b0f5d6879474760557c10a428ef7539b3e190cafb08b1fa23bd7092407f7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|