conda-lock
conda-lock copied to clipboard
when using a pyproject.toml why isn't the package installed
I'm using a pyproject.toml
to install my package and its requirements. I am also using the pyproject.toml
with the specification for conda-lock
.
When I specify the conda-lock.yml
, which was made using the pyproject.toml
it doesn't install the package that the pyproject.toml
also describes. Instead I need to follow the workflow below. Am i missing a feature?
conda-lock install --name my_wacky_env mrd/conda-lock.yml
conda activate my_wacky_env
pip install -e mrd/
The mrd
directory contains the pyproject.toml
and is a python package.
I would expect that using the pyproject.toml
which is used for both conda-lock
as well as my package installation via pip, would install my package into the conda environment created from conda-lock
Nope, thats not really how it works.
The pyproject
support is mostly used for a convenience to allow creating dev / test environments for a python project.
For your use case you can use conda-lock to get a consistent environment created and just pip install --no-deps .
your library after creating the env (which should not change any of the other dependencies you have installed.
Another option i explored was to specify the path to the python package. This works for a traditional environment.yaml
name: devernator
channels:
- conda-forge
- bioconda
dependencies:
- python=3.10
- pip
- poetry
- pybedlite
- pip:
- ./
In that root directory i have my pyproject.toml
which contains my dependencies listed out for poetry.
I have success when using conda env create --file environmnet.yaml
, but i receive an error message when i use conda-lock
,
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'./'"
Am I missing anything here in my approach?