sparse-lifeguard-95737
07/19/2022, 8:49 PMhundreds-father-404
07/19/2022, 8:57 PMNote that we don't parameterize any of our targets so I'm not sure why Pants is trying to figure out which parameterization to use.Fishy. Thanks
hundreds-father-404
07/19/2022, 8:57 PMsparse-lifeguard-95737
07/19/2022, 8:58 PMhundreds-father-404
07/19/2022, 8:58 PMwitty-crayon-22786
07/19/2022, 9:26 PM./pants dependencies src/projects/rhp/backend:celery
? it should be the exact same codepath, so something is strangesparse-lifeguard-95737
07/19/2022, 9:54 PMsparse-lifeguard-95737
07/19/2022, 9:55 PMwitty-crayon-22786
07/19/2022, 9:55 PMsparse-lifeguard-95737
07/19/2022, 9:55 PMsparse-lifeguard-95737
07/19/2022, 9:56 PMwitty-crayon-22786
07/19/2022, 9:56 PMcelery.py
definitely exists on disk, right?sparse-lifeguard-95737
07/19/2022, 9:56 PMsparse-lifeguard-95737
07/19/2022, 9:56 PMsparse-lifeguard-95737
07/19/2022, 9:56 PMsparse-lifeguard-95737
07/19/2022, 9:57 PMwitty-crayon-22786
07/19/2022, 9:57 PMwitty-crayon-22786
07/19/2022, 10:10 PMexplicitly_provided_includes
and explicit_dependency_parametrizations
with <http://logger.info|logger.info>(..)
?hundreds-father-404
07/19/2022, 10:11 PMcelery.py
. It only shows the target generator :backend
)sparse-lifeguard-95737
07/19/2022, 10:13 PMsparse-lifeguard-95737
07/19/2022, 10:13 PMwitty-crayon-22786
07/19/2022, 10:14 PMsparse-lifeguard-95737
07/19/2022, 11:01 PM18:52:02.71 [INFO] explicitly_provided_includes: FrozenOrderedSet([Address(src/projects/rhp/backend/celery.py)])
18:52:02.71 [INFO] explicit_dependency_parametrizations: (_TargetParametrizations([_TargetParametrization(original_target=<class 'pants.backend.python.target_types.PythonSourceTarget'>(address=src/projects/rhp/backend:backend, alias='python_source', residence_dir='src/projects/rhp/backend', dependencies=(':src', './migrations'), description=None, interpreter_constraints=None, resolve=None, run_goal_use_sandbox=True, skip_black=False, skip_isort=False, skip_mypy=False, skip_pylint=False, source=apps.py, tags=None), parametrization=FrozenDict({}))]),)
in which the more complex directory structure of the problem dir is revealed 😅
the full current structure is:
src/projects/rhp/backend/
BUILD.pants
apps.py
asgi.py
celery.py
manage.py
settings.py
# More python src
migrations/
BUILD.pants # just contains python_sources()
# Python sources
management/
commands/
BUILD.pants # just contains python_sources()
# Python sources
and then the BUILD.pants
is (translated from a macro so might be typos):
python_source(source="apps.py", dependencies=[":src", "./migrations"])
python_sources(name="src", sources=["!manage.py", "!apps.py", "*.py"])
python_source(
name="manage.py",
source="manage.py",
dependencies=["./management/commands"],
)
pex_binary(
name="manage",
entry_point="manage.py",
dependencies=["./management/commands"],
)
pex_binary(
name="main",
entry_point="gunicorn",
dependencies=[
"./asgi.py",
"3rdparty#gunicorn",
"3rdparty/pants-only#uvicorn",
],
restartable=True,
)
pex_binary(
name="celery",
entry_point="celery.bin.celery",
dependencies=[
"./celery.py",
],
restartable=True,
)
hundreds-father-404
07/19/2022, 11:02 PMparametrization=FrozenDict({}))])Weird, I think we would expect this to have the generated
python_source
targets. (Even though you're not using parametrize()
)witty-crayon-22786
07/19/2022, 11:03 PMoriginal_target=<class 'pants.backend.python.target_types.PythonSourceTarget'>
witty-crayon-22786
07/19/2022, 11:04 PMhundreds-father-404
07/19/2022, 11:05 PMsrc/projects/rhp/backend/celery.py
must correspond to a generated python_source
target, as file address only works w/ generated targets
But then the corresponding parametrization is a target src/projects/rhp/backend:backend
which is python_source
hundreds-father-404
07/19/2022, 11:06 PMrhp/backend
? Same as what you sent?witty-crayon-22786
07/19/2022, 11:06 PMwitty-crayon-22786
07/19/2022, 11:06 PMwitty-crayon-22786
07/19/2022, 11:07 PMhundreds-father-404
07/19/2022, 11:08 PMcelery.py
would end up being the address backend:backend
, which is itself python_source
witty-crayon-22786
07/19/2022, 11:08 PMwitty-crayon-22786
07/19/2022, 11:12 PMsparse-lifeguard-95737
07/19/2022, 11:24 PMBUILD.pants
that expands to the python_source
target for apps.py
and the python_sources
target, but the end targets are identical to what I sentwitty-crayon-22786
07/20/2022, 6:38 PMsparse-lifeguard-95737
07/20/2022, 7:00 PMwitty-crayon-22786
07/21/2022, 2:37 AMwitty-crayon-22786
07/21/2022, 2:37 AM