silly-queen-7197
09/13/2023, 1:10 AMpython_sources(
sources=[
"*.py",
"!test_*.py",
"!*_test.py",
"!tests.py",
"!conftest.py",
"!test_*.pyi",
"!*_test.pyi",
"!tests.pyi",
"!settings.py",
]
)
python_source(
name="settings",
source="settings.py",
dependencies=[...]
)
and in my tests I have a dependency on project/src/foo/settings.py
.
When I run `pants test project/::
I get the error
ValueError: The explicit dependency `project/src/foo/settings.py` of the target at `project/tests/test_dummy.py` does not provide enough address parameters to identify which parametrization of the dependency target should be used.
Target `project/src/hydra:hydra` can be addressed as:
* project/src/foo:foo
* project/src/foo/__init__.py
* project/src/foo/asgi.py
* project/src/foo/urls.py
* project/src/foo/wsgi.py
...
When I check pants peek project/src/foo/settings.py
, it only returns one dict (I guess one address?). Now referencing the file as project/src/foo/settings.py:settings
works, but why do I need to do that?
Edit - Clarify problem and questioncurved-television-6568
09/13/2023, 2:33 AMpython_sources
that produce a python_source
target for each file. So generated file level targets you can address by their filename alone, but for any file level target you explicitly declare yourself directly need to include the target name, as you discovered. Quirky and not ideal. Just what it is, for now. 🤷