ripe-architect-1001
07/22/2024, 9:44 PMshell_command
as a dependency of our pex_binary
to generate css using tailwind. We're able to get the file into our built pex but we can't seem to get it to the correct path. Is there something we're overlooking with the use of root_output_directory
here?
With the default /
for root_output_directory
the css file ends up in our pex at /src/python/apps/internal_tools/theme/css/dist/styles.css
With src/python/apps
set as root_output_directory
we get an error:
NoSourceRootError: No source root found for `internal_tools/theme/static/css/dist`.
Our root_patterns
contains "src/python/apps"
.
This is the `shell_command`:
shell_command(
name="npm_build",
command="npm run build",
tools=["npm", "node", "sh"],
execution_dependencies=[":npm_install", ":tailwind", *template_dirs],
output_files=["../static/css/dist/styles.css"],
runnable_dependencies=[":npm", ":node"],
root_output_directory="/",
)
We tried this as an adhoc_tool
as well but got the same NoSourceRootError
.
Ultimately we want the file at /internal_tools/theme/css/dist/styles.css
broad-processor-92400
07/23/2024, 12:12 AMsrc/python/apps/internal_tools/...
.
Can you share your pex_binary
target(s)?ripe-architect-1001
07/23/2024, 1:02 AMpex_binary(
name="uvicorn",
entry_point="uvicorn",
args=["internal_tools.project.asgi:application", "--port", "3000"],
dependencies=["./theme/static_src:npm_build_result", ":site"],
)
shell_command(
name="npm_build",
command="npm run build",
tools=["npm", "node", "sh"],
execution_dependencies=[":npm_install", ":tailwind", *template_dirs],
output_files=["../static/css/dist/styles.css"],
runnable_dependencies=[":npm", ":node"],
root_output_directory="/",
)
experimental_wrap_as_resources(name="npm_build_result", inputs=[":npm_build"])
broad-processor-92400
07/23/2024, 11:32 PMpants --keep-sandboxes=always ...
, finding the relevant path in the output, and then looking at the __run.sh
in that