famous-kilobyte-26155
10/06/2025, 6:25 PMpython_distribution (generating a setup.py) to which I want to add explicit constraints on the python version. This is in a monorepo with source roots defined as src/*. This config is working for the generated setup.py.
However, I decided to instead use a pyproject.toml. But, when I add a pyproject.toml to the directory and set it as a resource for the distribution (like the example) pants starts complaining about the source root not being defined for the directory.
How is adding the pyproject.toml file clobbering the global source root? And, how would I fix it?happy-kitchen-89482
10/07/2025, 2:58 AMpyproject.toml is in relation to it?famous-kilobyte-26155
10/07/2025, 6:09 PM.
├── BUILD
├── common
│ └── src
│ └── python
│ └── <package-name>
├── gear
│ └── <app-name>
│ └── src
│ ├── docker
│ └── python
├── distributed_package
│ ├── BUILD
│ ├── pyproject.toml
│ └── src
│ └── python
│ ├── BUILD
│ ├── __init__.py
│ ├── package_code.py
│ └── py.typed
├── pants.toml
└── requirements.txtfamous-kilobyte-26155
10/07/2025, 6:14 PMdistributed_package/BUILD dependencies reference the python_sources defined in distributed_package/src/python/BUILDfamous-kilobyte-26155
10/07/2025, 6:19 PMdistributed_packagefamous-kilobyte-26155
10/07/2025, 6:29 PM[source]
root_patterns = [
"src/*", "test/*"
]famous-kilobyte-26155
10/07/2025, 6:33 PM[source]
root_patterns = ['/src/python/*', '/']famous-kilobyte-26155
10/07/2025, 6:38 PM/distributed_package did not solve the problemhappy-kitchen-89482
10/08/2025, 4:26 AMpyproject.toml is not in any source root. It probably shouldn't need to be, there might be some over-aggressive checks going on. But I think a workaround is to add the repo root as a fallback source root, as it is in that other example you linked tohappy-kitchen-89482
10/08/2025, 4:26 AM/ as a fallbackhappy-kitchen-89482
10/08/2025, 4:26 AM