diff --git a/homeassistant/__main__.py b/homeassistant/__main__.py index 6dbb609ec05..f12758a354d 100644 --- a/homeassistant/__main__.py +++ b/homeassistant/__main__.py @@ -31,7 +31,7 @@ def validate_python(): def ensure_config_path(config_dir): """Validate the configuration directory.""" import homeassistant.config as config_util - lib_dir = os.path.join(config_dir, 'lib') + lib_dir = os.path.join(config_dir, 'deps') # Test if configuration directory exists if not os.path.isdir(config_dir): diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 2ba0681c2d6..7be0c9dd371 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -65,7 +65,7 @@ def _handle_requirements(hass, component, name): return True for req in component.REQUIREMENTS: - if not pkg_util.install_package(req, target=hass.config.path('lib')): + if not pkg_util.install_package(req, target=hass.config.path('deps')): _LOGGER.error('Not initializing %s because could not install ' 'dependency %s', name, req) return False @@ -211,7 +211,7 @@ def prepare_setup_platform(hass, config, domain, platform_name): def mount_local_lib_path(config_dir): """Add local library to Python Path.""" - sys.path.insert(0, os.path.join(config_dir, 'lib')) + sys.path.insert(0, os.path.join(config_dir, 'deps')) # pylint: disable=too-many-branches, too-many-statements, too-many-arguments @@ -372,10 +372,16 @@ def process_ha_config_upgrade(hass): _LOGGER.info('Upgrading config directory from %s to %s', conf_version, __version__) + # This was where dependencies were installed before v0.18 + # Probably should keep this around until ~v0.20. lib_path = hass.config.path('lib') if os.path.isdir(lib_path): shutil.rmtree(lib_path) + lib_path = hass.config.path('deps') + if os.path.isdir(lib_path): + shutil.rmtree(lib_path) + with open(version_path, 'wt') as outp: outp.write(__version__) diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index d38c3968533..152818d02e4 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -58,7 +58,7 @@ class TestBootstrap: """Test removal of library on upgrade.""" with tempfile.TemporaryDirectory() as config_dir: version_path = os.path.join(config_dir, '.HA_VERSION') - lib_dir = os.path.join(config_dir, 'lib') + lib_dir = os.path.join(config_dir, 'deps') check_file = os.path.join(lib_dir, 'check') with open(version_path, 'wt') as outp: @@ -79,7 +79,7 @@ class TestBootstrap: """Test removal of library with no upgrade.""" with tempfile.TemporaryDirectory() as config_dir: version_path = os.path.join(config_dir, '.HA_VERSION') - lib_dir = os.path.join(config_dir, 'lib') + lib_dir = os.path.join(config_dir, 'deps') check_file = os.path.join(lib_dir, 'check') with open(version_path, 'wt') as outp: diff --git a/tests/util/test_package.py b/tests/util/test_package.py index 840fe3d0ff8..ea9a8f23dfa 100644 --- a/tests/util/test_package.py +++ b/tests/util/test_package.py @@ -21,7 +21,7 @@ class TestPackageUtil(unittest.TestCase): def setUp(self): """Create local library for testing.""" self.tmp_dir = tempfile.TemporaryDirectory() - self.lib_dir = os.path.join(self.tmp_dir.name, 'lib') + self.lib_dir = os.path.join(self.tmp_dir.name, 'deps') def tearDown(self): """Stop everything that was started."""