-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve how hupper determines what is system code or user code #62
Comments
Notes from #61: Adding prints to in_system_paths function (return true → in system, false → not system) shows this:
_bootlocale is symlinked from $venv/lib/python3.7 to /usr/lib, but the check from realpath prefix in system_paths fails because get_system_path uses sysconfig.get_path which never returns paths from real Python, only virtualenv paths. So the change you did for the flit use case ends up watching many sytem modules! I think hupper will need virtualenv awareness, checking sys.real_prefix (virtualenv) or sys.base_prefix (venv) to add these paths to the exclude list. But this is to offer a complete system paths exclusion, not to fix my issue of not excluding package dir symlinked in site-packages. (Also de-duplicating list of system paths could help performance!) |
I think this makes sense - I'm not sure I have the energy to sort it out though and would appreciate the help if you wanted to contribute. I think it's pretty focused on just improving the |
A note that what I wrote is also tied to a specific implementation of virtualenv. Environments created with venv don’t have these symlinks, and virtualenv 20 is a big rewrite that (IIRC) uses a different symlink/copy strategy. So the problem may go away by itself in time, but it could still be worth it to implement it for current virtualenvs. |
Yeah I mean it's not an issue when using |
Hupper tries to avoid monitoring all system code loaded into a process due to #40. We do want to monitor user code however. The four ways I'm aware of right now to develop "user" code:
pip install -e .
installs a.pth
file insite-packages
which means the code continues to live properly wherever it is checked out.bin/python
site-packages
which is done manually or usingflit install --symlink
and I imaginepoetry install
will also do this.We want to try to count all of these scenarios as user code that is monitored and only ignore stuff that is third party installed directly into site-packages or stuff that is part of the virtualenv / system python.
related: #40 #41 #42 #60 #61
The text was updated successfully, but these errors were encountered: