nutritious-carpenter-5676
02/12/2024, 5:27 PMdruid/
web/ # a Django app
I'm trying to import the druid library into the web one like this:
python_sources(
name="lib",
dependencies=[
"//druid:lib",
"//:reqs#apple-certifi",
"//:reqs#boto3",
"//:reqs#django", # and other deps
":templates",
":markdown",
":django_tailwind",
":static_files",
],
overrides={
"manage.py": {
"restartable": True,
"run_goal_use_sandbox": False,
},
},
skip_mypy=True,
sources=[
"*.py",
"config/*.py",
"config/settings/*.py",
"apps/**/*.py",
"components/**/*.py",
],
)
locally this works, but in prod when I build the pex I get this error:
ModuleNotFoundError: No module named 'druid'
any advice? thanks!broad-processor-92400
02/12/2024, 5:44 PMnutritious-carpenter-5676
02/12/2024, 5:45 PMpex_binary(
name="prod_manage",
dependencies=[
":lib",
],
entry_point="prod_manage.py",
)better-van-82973
02/12/2024, 5:45 PM"//druid:lib"
Normally, this would refer to a target called druid in the root of your repo, but you’re trying to include the contents of the druid directory insteadnutritious-carpenter-5676
02/12/2024, 5:46 PMnutritious-carpenter-5676
02/12/2024, 5:46 PMpython_sources(
name="lib",
dependencies=[
"//:reqs#apple-certifi",
"//:reqs#pydruid",
"//:reqs#matplotlib",
"//:reqs#pandas",
],
sources=[
"druid/**/*.py",
],
skip_mypy=True,
)better-van-82973
02/12/2024, 5:48 PMlib and it’s in your repo root, you’d include it like this:
//:libnutritious-carpenter-5676
02/12/2024, 5:51 PMdruid/BUILD wouldn't it be //druid:lib?nutritious-carpenter-5676
02/12/2024, 5:51 PM//:lib though I can create onebetter-van-82973
02/12/2024, 5:52 PM// refers to the repo root. Here’s a good resource on how targets are addressed: https://www.pantsbuild.org/2.18/docs/using-pants/key-concepts/targets-and-build-files#target-addressesnutritious-carpenter-5676
02/12/2024, 5:54 PMResolveError: The address //:druid from the `dependencies` field of the target web/manage.py:lib does not exist.
The target name ':druid' is not defined in the directory . Did you mean one of these target names?