https://pantsbuild.org/ logo
f

fierce-spring-67521

04/28/2021, 4:14 AM
I am interested in trying out Pants to run tests for an existing machine learning project in which third-party dependencies are specified via a conda env.yml file that is used to create a conda environment. To use Pants, would I need to re-specify the dependencies in requirements.txt format, or could I somehow get Pants to make use of the existing conda environment?
h

happy-kitchen-89482

04/28/2021, 6:09 AM
Right now Pants need either requirements.txt or
python_requirement_library()
targets in a BUILD file, one per dependency. I don't know much about conda but possibly you could use
conda list
to generate the requirements list for Pants to consume?
We are working on poetry support, and that work will include adding some flexibility in how requirements are specified, so it might not be too hard to add conda support after that.
Since going from 2 to 3 formats is much easier than going from 1 to 2...
👍 1
f

fierce-spring-67521

04/28/2021, 12:51 PM
Thanks
One issue is that my organization uses internal conda channels to distribute certain packages that are not available via pip. So I think we'll need to wait for conda support
h

hundreds-father-404

05/06/2021, 11:42 PM
Hey @fierce-spring-67521, do those channels work with pip, or is Conda doing something custom? https://www.pantsbuild.org/docs/python-third-party-dependencies#using-custom-repositories
f

fierce-spring-67521

05/08/2021, 5:12 PM
yes as far as I can tell they are only available via internal Conda. The packages contain various miscellaneous utilities. One example is a package containing set of standard shell scripts that are bundled together with a Makefile. The standard way to use these scripts is to write your own Makefile that starts with the line
include $[CONDA_PREFIX}/<package_name>/<makefile>
6 Views