strong-toothbrush-37759
03/12/2022, 3:54 PMsrc/ - This is the django root folder
api/
core/
another_module1/
another_module2/
setup_core.py - This is building a core-package we upload and use in apps/project-z
manage.py
... etc
apps/
project-x/ - TypeScript Project
project-y/ - JavaScript Project
project-z/ - Python Project
As Iβm trying to get Pants setup only for the src directory. I configured root_patterns to only contain '/src' . Iβm still wondering about the perfect configuration but this was my starting-point.
My findings:
1. ./pants tailor does not seem to respect [source].root_patterns . When I run tailor it prompts me with a `NoSourceRootError: No source root found for `apps/heka/manage.py`` . Why is that exactly?
2. Removing the root_patterns configuration ./pants tailor runs successfully but quits with this warning: `164908.52 [INFO] Filesystem changed during run: retrying TailorGoal in 500ms...` . Since I did not change anything, but pants did, is it possible it is tripping over its own changes here?
3. Playing around with the setup for fmt and lint , I figured that pants trips over requirements that come from github, i.e. we are using a library de_core_news_md which is pulled by spaCy and cached by our CI using this url: <https://github.com/explosion/spacy-models/releases/download/de_core_news_md-3.1.0/de_core_news_md-3.1.0.tar.gz#egg=de_core_news_md==3.1.0> . After running ./pants tailor every following command halts immediately with the following error:
16:53:31.83 [ERROR] 1 Exception encountered:
MappingError: Failed to parse ./apps/prometheus/BUILD:
Invalid requirement '<https://github.com/explosion/spacy-models/releases/download/de_core_news_md-3.1.0/de_core_news_md-3.1.0.tar.gz#egg=de_core_news_md==3.1.0>' in apps/prometheus/requirements.txt at line 37: Parse error at "'://githu'": Expected stringEnd
Maybe someone can give me a hint in the right direction for incremental adoption, any help is appreciated π.happy-kitchen-89482
03/12/2022, 4:54 PMsrc/foo/bar is imported using import foo.bar then src/ is a source root, but if it's imported using import bar then src/foo is a source root). So tailor is saying: "you asked me to operate on this source file, but it's not under any source root, so I don't know how to treat it".
If you want to set up Pants to ignore part of your repo, you use the pants_ignore global option: https://www.pantsbuild.org/docs/reference-global#section-pants-ignorehappy-kitchen-89482
03/12/2022, 4:54 PMapps/ for examplehappy-kitchen-89482
03/12/2022, 4:56 PMstrong-toothbrush-37759
03/12/2022, 5:02 PMstrong-toothbrush-37759
03/12/2022, 5:16 PMenough-analyst-54434
03/12/2022, 8:28 PMstrong-toothbrush-37759
03/12/2022, 10:21 PMenough-analyst-54434
03/12/2022, 10:35 PMbusy-vase-39202
03/13/2022, 6:21 AM