calm-parrot-54051
09/18/2023, 12:29 PMInvalidSourceRootPatternError: `..` disallowed in source root pattern
The code layout is like this:
.
└── repo-root/
├── apps/
│ ├── app1/
│ │ ├── .vscode
│ │ ├── app1/
│ │ │ ├── __init__.py
│ │ │ └── app.py
│ │ ├── pants.toml
│ │ └── pyproject.toml
│ └── app2/
│ ├── .vscode
│ ├── app2/
│ │ ├── __init__.py
│ │ └── app.py
│ ├── pants.toml
│ └── pyproject.toml
└── libs/
├── __init__.py
├── my_cool_lib/
│ └── __init__.py
└── my_random_lib.py
calm-parrot-54051
09/18/2023, 12:29 PMcalm-parrot-54051
09/18/2023, 12:32 PMcalm-parrot-54051
09/18/2023, 12:33 PMpants.toml
in the app1 project directory to include the libs
folder the same way that I can with the IDE.calm-parrot-54051
09/18/2023, 12:34 PMpants.toml
in the repo-root
folder, but then pants won't run in the app1 project folder (unlike e.g. git which can run in any subfolder of the repo).calm-parrot-54051
09/18/2023, 12:35 PMgorgeous-winter-99296
09/18/2023, 12:47 PMI also tried it another way - putting theThis is the proper solution; and I'm not sure why pants would not work that way for you. Are you using the oldin thepants.toml
folder, but then pants won't run in the app1 project folder (unlike e.g. git which can run in any subfolder of the repo).repo-root
./pants
script?late-advantage-75311
09/18/2023, 1:10 PMlate-advantage-75311
09/18/2023, 1:13 PMexample-python $ cd helloworld/translator
example-python/helloworld/translator $ ls
BUILD translator.py
__init__.py translator_test.py
example-python/helloworld/translator $ pants --no-local-cache test helloworld/translator/translator_test.py:tests
✓ helloworld/translator/translator_test.py:tests succeeded in 0.53s.
gorgeous-winter-99296
09/18/2023, 1:16 PMcd foobar && pants fix ./file.py
without issue in our local repo.late-advantage-75311
09/18/2023, 1:22 PMexample-python/helloworld/translator $ pants test translator_test.py
calm-parrot-54051
09/18/2023, 7:31 PM