-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Store the PIP cache in a specific directory - #1149 #1153
base: develop
Are you sure you want to change the base?
Conversation
@rdmark - I'm curious what you think about this change. With the start.sh changes, all of the pip packages will need to be downloaded by easyinstall.sh first. Is this going to be a problem? We could add some error handling potentially where if the pip install from the cached dir fails, it will try to re-run the command and pull from the internet. |
It's an interesting solution! I can see how we bypass the network instability factor this way. A drawback is that the libraries won't ever be refreshed unless you run easyinstall again, but I guess that's acceptable? Some of the libraries have C extensions that need to be compiled, right? How does this work on an RPi? Does pip3 kick off the compilation on runtime? |
After thinking about it for a while I would argue that giving easyinstall.sh the responsibility to manage the caching of python libraries is a step in the wrong direction. It might make troubleshooting even hairier if f.e. the cached libraries end up in a bad state. Plus it constitutes feature creep for easyinstall. Let's leave the python lib management to pip. ;) Just my 2 cents! |
No objections by me! I'm going to cancel this PR for now. We can dust it off again later if needed. |
I want to try this again! Our users are endlessly struggling with python dependency hell. A hard lock down to cached libs seem a more attractive option at this point. |
ae7e56e
to
6dbef07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Linux there is already a shared default folder for cached data. Data are usually cached in $HOME/.cache/APPLICATION_NAME, e.g $HOME/.cache/piscsi.
If possible, this convention should be followed. Not sure, though, whether this is applicable in this case. I wonder how other python applications deal with this.
Moved the cache dir to The current blocker is that one dependent library has a C wrapper that can't be build from source with pip, so this method doesn't work fully out of the box. Some more research and testing on a real RPi is needed. I'm not targeting this for the upcoming "Bookworm" release. |
For binary packages you can manually specify the platform(s) to download binaries for storage in the local file cache. You'd probably want to separate them out from the existing requirements.txt package list though. eg: For amd64 it's There are other options that you may want to specify as well, such as python version, ABI, etc. See https://pip.pypa.io/en/stable/cli/pip_download/ - Scroll down to the examples, specifically example 6 for multiple platforms. Other notes on this:
|
Updated easyinstall to download the SOURCE pip packages to $HOME/.pip_cache. The web startup script was updated to install the packages from this directory