https://pantsbuild.org/ logo
#general
Title
# general
w

wonderful-boots-93625

05/03/2023, 7:25 PM
Using
2.0.17.dev4
I’m starting to see failures like
Copy code
Engine traceback:
  in `package` goal

InvalidTargetNameError: The target name ../tests (defined in directory iai_coral_api/flg_tests/agents/test_rest.py) contains banned characters (`/`). Please replace these characters with another separator character like `_` or `-`.
The test BUILD files do a recursive glob to register the test names. Seems related to that. I can sometimes get around this by specifying more BUILD files in subdirectories, but it makes BUILD management onerous.
in the test directory:
Copy code
python_tests(
    name="tests",
    sources=[
       'test*.py',
       '**/test*.py',
    ],
    dependencies=[
       'iai_coral_api:dist',
       ':test_utils',
    ],
    skip_mypy=True,
    skip_flake8=True,
)

python_test_utils(
   name="test_utils",
   sources=[
      'mock_auth.py',
      'utils.py'
   ],
   skip_mypy=True,
    skip_flake8=True,
)
there are no other BUILD files in the subdirectories
and this was fine in 2.0.15
Only happens with a changed file detection. E.g.
Copy code
./pants --changed-since=origin/develop --changed-dependees=transitive package
so, it works if I remove
--changed -dependees=transitive
b

broad-processor-92400

05/04/2023, 2:42 AM
w

wonderful-boots-93625

05/04/2023, 1:29 PM