purple-plastic-57801
12/19/2023, 1:25 AMpex_binary(
name="app",
script="gunicorn",
args=["foo.bar.baz:app"],
dependencies=[
":bar", <---- This is the //foo/bar:bar where baz.py lives
".build/requirements:reqs#gunicorn"
],
)
I'd like to present this interface in the build
gunicorn_pex_binary(
name="app",
wsgi_app = file:app (where file == pwd/baz.py)
)
Where app is of form $(module_name):$(variable_name)
Under the hood this makes the pex_binary target where the file is added as a dependency to the pex_binary target.
Is there a way I can construct this macro by getting the .. calling location? of the target? In bazel I'd accomplish this with package_name and minimal starlark.bitter-ability-32190
12/19/2023, 2:26 AMbuild_file_dir() returns a pathlib.PurePath of the BUILD file's dirpurple-plastic-57801
12/19/2023, 2:54 AM.pybitter-ability-32190
12/19/2023, 2:54 AMcurved-television-6568
12/19/2023, 4:37 AM