From a5c8b24988c019e69b105754eae8faa288798d53 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 9 Oct 2020 16:14:59 +0200 Subject: [PATCH] hound fixes --- igniter/bootstrap_repos.py | 9 ++++++--- igniter/install_dialog.py | 1 - igniter/install_thread.py | 2 -- igniter/tools.py | 2 +- pype.py | 4 ++-- tests/igniter/test_bootstrap_repos.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/igniter/bootstrap_repos.py b/igniter/bootstrap_repos.py index d0eb6fc704..d99a58ce4c 100644 --- a/igniter/bootstrap_repos.py +++ b/igniter/bootstrap_repos.py @@ -75,12 +75,13 @@ class BootstrapRepos: self._log.info(f"creating zip: {temp_zip}") BootstrapRepos._create_pype_zip( - temp_zip, self.live_repo_dir, progress_callback=progress_callback) + temp_zip, self.live_repo_dir, + progress_callback=progress_callback) if not os.path.exists(temp_zip): self._log.error("make archive failed.") return None - destination = self.data_dir / temp_zip.name + destination = self.data_dir / temp_zip.name if destination.exists(): self._log.warning( @@ -255,4 +256,6 @@ class BootstrapRepos: def process_entered_path(self, location: str) -> str: pype_path = None if location.startswith("mongodb"): - self._get_pype_from_mongo(location) + pype_path = self._get_pype_from_mongo(location) + + return pype_path \ No newline at end of file diff --git a/igniter/install_dialog.py b/igniter/install_dialog.py index 8b58800c17..151dfa19ed 100644 --- a/igniter/install_dialog.py +++ b/igniter/install_dialog.py @@ -2,7 +2,6 @@ """Show dialog for choosing central pype repository.""" import sys import os -import re from Qt import QtCore, QtGui, QtWidgets from Qt.QtGui import QValidator diff --git a/igniter/install_thread.py b/igniter/install_thread.py index 2b3134933f..4e89f67062 100644 --- a/igniter/install_thread.py +++ b/igniter/install_thread.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """Working thread for installer.""" -import sys import os from Qt.QtCore import QThread, Signal -from pype import settings from igniter.tools import load_environments from .bootstrap_repos import BootstrapRepos diff --git a/igniter/tools.py b/igniter/tools.py index 803e00ee63..13cee313c8 100644 --- a/igniter/tools.py +++ b/igniter/tools.py @@ -58,7 +58,7 @@ def validate_path_string(path: str) -> (bool, str): # test for uuid try: uuid.UUID(path) - except ValueError as e: + except ValueError: # not uuid if not os.path.exists(path): return False, "Path doesn't exist or invalid token" diff --git a/pype.py b/pype.py index c8351838a4..693504dc00 100644 --- a/pype.py +++ b/pype.py @@ -40,7 +40,6 @@ import sys import os import re import traceback -from pathlib import Path from igniter.tools import load_environments try: @@ -55,7 +54,7 @@ def set_environments() -> None: env = load_environments() env = acre.merge(env, dict(os.environ)) os.environ.clear() - os.environ = env + os.environ.update(env) def boot(): @@ -192,4 +191,5 @@ def print_info() -> None: t.echo("... {}:{}[ {} ]".format(info[0], " " * padding, info[1])) print('\n') + boot() diff --git a/tests/igniter/test_bootstrap_repos.py b/tests/igniter/test_bootstrap_repos.py index 0e490ef707..e9d5e6ffb4 100644 --- a/tests/igniter/test_bootstrap_repos.py +++ b/tests/igniter/test_bootstrap_repos.py @@ -8,6 +8,7 @@ import appdirs from igniter.bootstrap_repos import BootstrapRepos from pype.lib import PypeSettingsRegistry + @pytest.fixture def fix_bootstrap(tmp_path): bs = BootstrapRepos() @@ -117,4 +118,3 @@ def test_find_pype(fix_bootstrap, tmp_path_factory, monkeypatch, printer): assert list(result.values())[-1] == Path( r_path / test_versions_2[0] ), "not a latest version of Pype 2" -