Hi! Is it possible to exclude some directory from ...
# general
f
Hi! Is it possible to exclude some directory from containing source roots? We have a
third-party
folder which contains forks of other repositories, which we would like to exclude from the source roots. The following does not work:
Copy code
[source]
root_patterns = ["/", "src", "src/python", "tests", "!/third-party"]
h
f
Thanks, but I would like to have pants see these files, e.g. for targets that build wheels of those dependencies. Just not use them as source roots
f
What is the issue with actually having them be source roots?
f
I ran into the issue that one of these packages has a "datasets" module in the source, root which conflicted with a PyPI package by that name. I know that with pants, I can normally explicitly choose a dependency, but here I used
pants roots
to setup my development environment (as recommended in the docs) and that made the that package in the monorepo shadow the PyPI package
h
How many true source roots do you have? Is it tractable to mark them with
marker_filenames
instead of matching them to patterns?
f
Thanks for the suggestion. A few dozen. Would be mildly annoying to have to move to markers, but tolerable.
h
The marker could potentially be a file you already have in every source root (like a pyproject.toml or similar)