What's the easiest way to get pantsd to not be inv...
# development
What's the easiest way to get pantsd to not be invalidated when I touch files in the Pants repo? I've tried: • Running
from a pex instead of
• Adding
to the
From the docs, this seems relevant:
Pants's own code, plugins, and
are inherently invalidated.
So you consciously want pantsd to be running on different code than you're editing?
Yup! I'm timing my change with a "warm" (but not hot) cache. So I'm lightly editing a few files and re-running. I want the cache to warm for everything that isn't related to just touching my files. --- I'm also using Pants' repo kind of like a client repo, I suppose.
What ends up happening is I see repeated work in the output (making me think pantsd got restarted). Like "Mapping all addresses to targets" (dunno the exact phrase) and downloading PEX's pex.
somewhat of a known issue: https://github.com/pantsbuild/pants/issues/9902 We use
and exclude all of our code that doesn't run in pants (we do have some pants plugin code in our repo, so we still want to invalidate on that). Having said that... pants understand dependencies now, so it should be able to do it automatically.
I'm not sure there's an easier way than to edit the bit of Pants code that adds the PYTHONPATH invalidation globs. This invalidation was unanimously met with cheers after years of fighting hard to understand apparent but not really bugs when hacking on Pants.
You can change _test.py files without invalidating Pantsd
@enough-analyst-54434 I'm OK with hacks for this 🤓 I'll try that. @hundreds-father-404 I see that
is in the invalidation globs, so that's what made me think to try
That seemed to work, although I need to bump pantsd memory cap
👍 1
 from a pex instead of 
^ this works well. i also tend to use
, since it will not restart
until the client disconnects