many-boots-99572
11/14/2023, 12:28 PMexperimental_wrap_as_python_sources to create python sources from an openapi generated code, I have an issue with adding dependencies to the generated python_source
The generated code uses pydantic so I want pydantic to be a dependency for any source that uses the generated client.
My BUILD file looks like this:
shell_command(
name="build_client",
command="docker run --rm -v $PWD:/local openapitools/openapi-generator-cli generate " \
"-i /local/research/deployment/openapi.yaml -g python-pydantic-v1 -o /local/ " \
"--package-name model_client --additional-properties='generateSourceCodeOnly=True'",
execution_dependencies=[":openapi_schema"],
tools=["docker"],
output_directories=["model_client"],
workdir="/",
timeout=600,
output_dependencies=["//:reqs#pydantic"]
)
experimental_wrap_as_python_sources(
name="model_client",
inputs=[":build_client"]
)
python_source(
name="example",
source="./bla.py",
dependencies=[":model_client"]
)
running the example target fails with this error: ModuleNotFoundError: No module named 'pydantic' .
Is there any way to add dependencies to the experimental_wrap_as_python_sources target?late-advantage-75311
11/14/2023, 2:04 PMlate-advantage-75311
11/14/2023, 2:43 PM:model_client ?late-advantage-75311
11/14/2023, 2:45 PMpython_source(
name="example",
source="./bla.py",
dependencies=[":model_client", "//:reqs#pydantic"]
)
not very satisfying but seems like should get you through until we can find a solution to attach dependencies to shell-generated sources. Could not find it looking in the slack or issue history yet.many-boots-99572
11/15/2023, 10:06 AM