brainy-solstice-27042
09/22/2022, 5:24 PM__init__.py
files in the pants config instead of the BUILD files? Migrating from pants 1.30 and it seems like 2.13 wants to run every file through pytest, however we have plenty of __init__.py
and common.py
files which we don't want to make pytest attempt to execute. Was hoping to have a global config rather than have every BUILD file have a statement in the sources that tells it to ignore the names I mentionedfast-nail-55400
09/22/2022, 5:26 PM__defaults__
mechanism coming in 2.14 I believe.fast-nail-55400
09/22/2022, 5:27 PM__defaults__
clause is located. You could set a different default sources
attribute there.hundreds-father-404
09/22/2022, 5:30 PMwhich we don't want to make pytest attempt to execute.Pants no matter what includes init.py your files in the sandbox. whereas v1 did this weird and wrong thing of synthesizing files for you depending on https://www.pantsbuild.org/docs/reference-python-infer#init_files, Pants will also infer dependencies on any import statements inside those init files
brainy-solstice-27042
09/22/2022, 5:32 PMbrainy-solstice-27042
09/22/2022, 5:33 PMpython_files
that pytest supports to tell pants/pytest to not try and execute tests for a file that doesn't match our patternhundreds-father-404
09/22/2022, 5:36 PM./pants peek path/to/some/__init__.py
and show it here, for one of the problematic init files? I suspect that you have __init__.py
included in the sources
field for some python_tests
target generator, which is a semantic errorhundreds-father-404
09/22/2022, 5:37 PMI was hoping that something like python_files that pytest supports to tell pants/pytest to not try and execute tests for a file that doesn't match our patternthat's what `python_source`/`python_sources`/`python_test_utils` are for (where the latter two are "target generators" for
python_source
)brainy-solstice-27042
09/22/2022, 5:40 PMskip_tests
was false, so that to me sounds like pants will execute tests on that specific file