Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with conda and poetry used simultaneously #1878

Closed
vxgmichel opened this issue Dec 11, 2023 · 0 comments · Fixed by #1879
Closed

Compatibility with conda and poetry used simultaneously #1878

vxgmichel opened this issue Dec 11, 2023 · 0 comments · Fixed by #1879
Labels
enhancement New feature or request

Comments

@vxgmichel
Copy link

vxgmichel commented Dec 11, 2023

When a project uses both maturin and poetry simultaneously, it's common to run commands such as poetry run maturin develop.

However, this doesn't work in a conda environment. Here's an example using the robyn repository:

$ git clone https://github.com/sparckles/Robyn.git
[...]
$ cd Robyn
$ conda create -n robyn python
[...]
$ conda activate robyn
$ poetry install
[...]
± poetry run maturin develop
💥 maturin failed
  Caused by: Both VIRTUAL_ENV and CONDA_PREFIX are set. Please unset one of them

This is because poetry seems to set the VIRTUAL_ENV environment variable when it detects a conda env:

$ env
[...]
CONDA_PREFIX=/home/vinmic/miniconda/envs/parsecv3
[...]
# No VIRTUAL_ENV defined here
$ poetry run env
[...]
CONDA_PREFIX=/home/vinmic/miniconda/envs/robyn
[...]
VIRTUAL_ENV=/home/vinmic/miniconda/envs/robyn

Would it be possible to allow both environment variables to be set when their values are equal?

@vxgmichel vxgmichel added the enhancement New feature or request label Dec 11, 2023
messense added a commit that referenced this issue Dec 12, 2023
* Allow identical `VIRTUAL_ENV` and `CONDA_PREFIX` env vars

Fixes #1878

* cargo fmt

---------

Co-authored-by: messense <messense@icloud.com>
konstin added a commit to astral-sh/uv that referenced this issue Dec 18, 2023
konstin added a commit to astral-sh/uv that referenced this issue Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant