Hi, I am working on a project that aims to automat...
# ask-for-help
a
Hi, I am working on a project that aims to automatize bentoml packaging so I need to be able to condition build dependecies from "outside". I was wondering if there is a way to set dependency specifiers through build options. In other words I want to define different sets of optional dependecies in pyproject.toml and to be able to switch between them using an env variable. Is there a way to do this that I am not seeing? Thanks!
c
You can use template args when using the python env API https://docs.bentoml.com/en/latest/build-with-bentoml/template-arguments.html
Not sure if there’s a straightforward way to do this in pyproject.toml, cc @Frost Ming
f
you can set argument values in pyproject.toml but other than that there is no way
a
Thank you for you responses, however, if it has to be in the pyproject.toml, then I don't see the point of defining optional dependencies. It seems to be a better solution to use bentofile and separate requirments.txt files, but it's unfortunate to not be able to use a pyproject file.
f
BentoML only reads
project.dependencies
, we don’t have any mechanism to interact with
project.optional-dependencies
and a way to select from them
👍 1
a
thank you, this clarifies a lot