[conda] Support Python environments embedded inside Conda environments? #451
Labels
integration
Integrating FawltyDeps with other tools
needs-real-projects-test
This issue is more easily tackled once we have a project in `real_project` that illustrate the issue
research-needed
type: feature request
(found while exploring potential Conda support for FawltyDeps, see e.g. #447 for more context)
I'm following the documentation at https://www.activestate.com/resources/quick-reads/how-to-manage-python-dependencies-with-conda/ to see what a Conda environment looks like, and what would be needed from FawltyDeps to use it for deducing the package-name -> import-name mapping.
Specifically, after running the following commands:
there are no files/directories created inside the current directory (like you would expect with e.g. Poetry or a similar (virtual) environment manager). Instead, there is a
my_conda_project/
subdirectory created under~/.conda/envs/
, and inside this directory we find:This seems roughly to be a superset of a virtual environment: It contains more than just Python packages (which Conda is known to support), but it also contains the stuff we'd expect to find in a virtualenv (possibly except a
pyvenv.cfg
at the root of the env):bin/python
lib/pythonX.Y/site-packages/...
Fortunately, for the purposes of matching package names to import names in Python, we can hopefully get away with ignoring the rest of the Conda environment, and focusing only on the subset that it has in common with virtualenvs.
And this seems to already work, in the sense that passing
--list-sources --pyenv ~/.conda/envs/my_conda_project
does indeed find~/.conda/envs/my_conda_project/lib/python3.8/site-packages
as a valid Python environment, and FawltyDeps is also able to resolve package names to import names from that directory.Thus, this preliminary investigation indicates that this issue might already be solved, but I propose keeping it open until we have built some more confidence that we indeed support this properly.
The text was updated successfully, but these errors were encountered: