Getting NoSourceRootError when trying to get depen...
# general
Getting NoSourceRootError when trying to get dependees, even though Pants recognizes the correct roots? See screenshot.
Huh. Well, it's right that
has no source root, but why the hell is it looking at
in the first place...
This is a private repo I assume?
I.e., we can't get a look at a repro?
Unfortunately no, it's hosted internally, but it's just a proto so I can replicate it publicly if we have more isuses. The script in question simply imports asyncio and sys, so it should not be looking anywhere else for dependencies. Let me try creating a build file from scratch (I used tailor).
Should just be root_patters = ["src/", "tests/"] if pants is in root w.r.t. src and tests and dir structure is just like src/projname/<modules or subpackages>?
Roots should point to the package roots, i.e., the part you strip off to get the top-level package/module name
So in your example, if
is a root, then you'd
is not part of the package name, then
is the root, and you
Does that make sense?
But that error shouldn't happen either way
Yup, that is the usage. I was able to get things to work by cleaning up the BUILD files and setting in the root to the ignore list (it started complaining about that not having a source root).
By the way, stumbled upon some weirdness earlier in the day with this command, wasn't sure about reporting it because I couldn't reproduce it and didn't have Pants running with ldebug. But basically after running ./pants dependencies <build> it froze eternally. Subsequent calls to any command afterward resulted in the same behavior, and I fixed it by reinstalling (I'm sure there were less drastic solutions). When I did ps | grep py I saw over 15 python processes running from the multiple attempts to run subsequent pants commands, all of which were just hanging on something (lock files?). Anyway, on to testing hopefully the fun stuff now! 🙂