From ce485c57df0286b06f2f688eee84443b93513429 Mon Sep 17 00:00:00 2001 From: ReimarBauer Date: Tue, 6 Sep 2022 16:17:32 +0200 Subject: [PATCH] updater needs to take care not only started from an env (#1543) * fix updater for none env calls * prepare v7.0.4 --- CHANGES.rst | 10 ++++++++++ mslib/utils/qt.py | 21 ++++++++++++--------- mslib/version.py | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index d09a2dd66..bc522da3d 100755 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,16 @@ Changelog ========= +Version 7.0.4 +~~~~~~~~~~~~~ + +Bug fix release + +All changes: +https://github.com/Open-MSS/MSS/milestone/88?closed=1 + + + Version 7.0.3 ~~~~~~~~~~~~~ diff --git a/mslib/utils/qt.py b/mslib/utils/qt.py index ccfaab598..272cc38f5 100644 --- a/mslib/utils/qt.py +++ b/mslib/utils/qt.py @@ -448,15 +448,18 @@ def __init__(self, parent=None): self.old_version = None # we are using the installer version of the env self.conda_prefix = os.getenv("CONDA_PREFIX") - self.command = os.path.join(self.conda_prefix, 'bin', "conda") - mamba_cmd = os.path.join(self.conda_prefix, 'bin', 'mamba') - # Check if mamba is installed in the env - try: - subprocess.run([mamba_cmd], startupinfo=subprocess_startupinfo(), - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - self.command = mamba_cmd - except FileNotFoundError: - pass + if self.conda_prefix is not None: + self.command = os.path.join(self.conda_prefix, 'bin', "conda") + mamba_cmd = os.path.join(self.conda_prefix, 'bin', 'mamba') + # Check if mamba is installed in the env + try: + subprocess.run([mamba_cmd], startupinfo=subprocess_startupinfo(), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.command = mamba_cmd + except FileNotFoundError: + pass + else: + self.command = "conda" # pyqtSignals don't work without an application eventloop running if QtCore.QCoreApplication.startingUp(): diff --git a/mslib/version.py b/mslib/version.py index 5ef58581c..9d5e14694 100644 --- a/mslib/version.py +++ b/mslib/version.py @@ -24,4 +24,4 @@ See the License for the specific language governing permissions and limitations under the License. """ -__version__ = u'7.0.3.' +__version__ = u'7.0.4.'