Make deps directory persistent over upgrades (#7801)

* Use pip install --user if venv not active

* Set PYTHONUSERBASE to deps directory, when installing with --user
  option.
* Reset --prefix option to workaround incompatability when installing
  with --user option. This requires pip version 8.0.0 or greater.
* Require pip version 8.0.3.
* Do not delete deps directory on home assistant upgrade.
* Fix local lib mount and check package exist.

* Update and add tests

* Fix upgrade from before version 0.46

* Extract function to get user site

* Add function(s) to package util to get user site.
* Use async subprocess for one of the functions to get user site.
* Add function to package util to check if virtual environment is
  active.
* Add and update tests.

* Update version for last removal of deps dir

* Address comments

* Rewrite package util tests with pytest

* Rewrite all existing unittest class based tests for package util as
  test functions, and capitalize pytest fixtures.
* Add test for installing with target inside venv.
This commit is contained in:
Martin Hjelmare 2017-07-14 04:26:21 +02:00 committed by Paulus Schoutsen
parent 5581c6295e
commit ba019c799a
11 changed files with 364 additions and 167 deletions

View file

@ -18,7 +18,7 @@ REQUIRES = [
'requests==2.14.2',
'pyyaml>=3.11,<4',
'pytz>=2017.02',
'pip>=7.1.0',
'pip>=8.0.3',
'jinja2>=2.9.5',
'voluptuous==0.10.5',
'typing>=3,<4',