Closed benspaulding closed 2 years ago
I now see tests failing, and realize that they will need updated. But I would like to leave that for a Nanobox dev if possible.
@benspaulding That's not a problem, we can get the tests updated. Thanks for this!
Closing this to get it off my PR list. 😁
Configure Python to install packages to a place they can be cached. From my testing this works with regular system installations,
virtualenv
,pipenv
, andpython -m venv
using both normal and editable packages.Note that I did not add any tests for these changes. I am not familiar with the testing setup used in the engines and know that someone else could do it faster. If you do want to add tests, I think something like these would help:
pip
,setuptools
, andwheel
are properly installed byget-pip.py
.which pip
returns the custom location, e.g./app/.nanobox/python/bin/pip
.pip install spam
installsspam
into the custom location.pip install -e /path/to/local/bacon
installsbacon
into the custom location (python -c "import bacon"
succeeds).pip install -e git+https://github.com/spam/beans.git#egg=beans
installsbeans
into the custom location (python -c "import beans"
succeeds), and the source was put in the custom location, e.g.,/app/.nanobox/python/pip/src
virtualenv /tmp/spam
succeeds./tmp/spam/bin/pip install eggs
installseggs
in/tmp/spam
./tmp/spam/bin/pip install -e git+https://github.com/bacon/beans.git#egg=beans
installsbeans
into the custom location (python -c "import beans"
succeeds), and the source was not put in the custom location, but in/tmp/spam/src
.pipenv install spam
succeeds.pipenv
just created is in the custom location, e.g.,/app/.nanobox/python-venvs
, andspam
is in it.python -m venv /tmp/eggs
succeeds. (Python 3 only)/tmp/eggs/bin/pip install bacon
installsbacon
in/tmp/eggs
. (Python 3 only)/app/.nanobox/python/lib/pythonX.Y/site-packages
) is not insys.path
.