Skip to content

Commit

Permalink
Remove environment variable dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvisscher committed Nov 22, 2024
1 parent 730e4e0 commit ec928fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 4 additions & 0 deletions activity_browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import sys
from logging import getLogger

try:
import PySide6
except ImportError:
import PySide2

from .logger import log_file_location, setup_ab_logging
from .mod import bw2data
Expand Down
10 changes: 0 additions & 10 deletions activity_browser/actions/pyside_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class PySideUpgradeThread(threading.ABThread):

def run_safely(self):
self.pip_installation()
self.set_conda_env_var()
self.restart()

def pip_installation(self):
Expand All @@ -86,15 +85,6 @@ def pip_installation(self):

assert process.returncode == 0, "Failed to install PySide6"

def set_conda_env_var(self):
"""
Set the QT_API QtPy environment variable persistently for this conda environment
"""
self.status.emit(0, "Setting QT_API environment variable")

subprocess.run(["conda", "env", "config", "vars", "set", "QT_API=pyside6"])
os.environ["QT_API"] = "pyside6" # also set for the env directly for the restart

def restart(self):
"""
Restarts the Activity Browser through a subprocess. Sleeps 5 seconds to allow the user to register
Expand Down

0 comments on commit ec928fc

Please sign in to comment.