Make conda and poetry communicate
Project description
conda_poetry_liaison
Make conda and poetry communicate
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.
Installation
You can install conda_poetry_liaison
with pip.
pip install conda_poetry_liaison
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
Deploying
A note to maintainers.
We use bump2version to release a new major
, minor
, or patch
version.
This will update the tracked version in .bumpversion.cfg
, modify the CHANGELOG
, and create a new tag.
For example, to bump the minor
version you would run the following command.
poetry run bump2version minor
After releasing a new version, you need to push and include all tags.
git push --follow-tags
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for conda_poetry_liaison-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b5fd14d486835390fba7ddd901983b54dbddbb1fd9f7e844f4733d334877413 |
|
MD5 | 359ff10712a91091fb392307e59ab4ec |
|
BLAKE2b-256 | 2ad6b3c661a91abff6075401387bc195af6ecbfff138d7ad6fb6739dbe73bc8e |
Hashes for conda_poetry_liaison-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a34512bb9734f54a606e76f8b1acb9e0a3c82a47c2cd875a4d7254466ec70e8 |
|
MD5 | d693ecd38c8d46cc02d882481d86cee4 |
|
BLAKE2b-256 | 0da8c02ba729a1a61a881d33e18db670f11030e52ac4afe96d1a661db44a27c3 |