Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to QtPy compatibility #1404

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Remove environment variable dependency
mrvisscher committed Nov 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ec928fc1669c1c877c70d0b21073a568df9a0561
4 changes: 4 additions & 0 deletions activity_browser/__init__.py
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions activity_browser/actions/pyside_upgrade.py
Original file line number Diff line number Diff line change
@@ -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):
@@ -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