From 84c8e9e8b11c35d5556fd39bf35522fba9ac3f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 12 Jan 2021 15:33:31 +0100 Subject: [PATCH] fixes for build, acre in pypeclub fork --- build.ps1 | 4 ++++ igniter/install_dialog.py | 7 ++++--- igniter/install_thread.py | 3 ++- igniter/tools.py | 22 ---------------------- requirements.txt | 2 +- setup.py | 14 ++++---------- start.py | 10 +++------- 7 files changed, 18 insertions(+), 44 deletions(-) diff --git a/build.ps1 b/build.ps1 index ec118a43f3..782b3c8f20 100644 --- a/build.ps1 +++ b/build.ps1 @@ -103,6 +103,10 @@ if ($skip_venv -ne $true) { Write-Host $_.Exception.Message Exit-WithCode 1 } + Write-Host ">>> " -NoNewline -ForegroundColor green + Write-Host "Updating pip ..." + & python -m pip install --upgrade pip + Write-Host ">>> " -NoNewline -ForegroundColor green Write-Host "Installing packages to new venv ..." & pip install -r .\requirements.txt diff --git a/igniter/install_dialog.py b/igniter/install_dialog.py index 93c94977c6..404f1b2320 100644 --- a/igniter/install_dialog.py +++ b/igniter/install_dialog.py @@ -149,10 +149,10 @@ class InstallDialog(QtWidgets.QDialog): self.setLayout(mongo_layout) def _mongo_changed(self, mongo: str): - self.parent()._mongo_url = mongo + self.parent().mongo_url = mongo def get_mongo_url(self): - return self.parent()._mongo_url + return self.parent().mongo_url def set_valid(self): self._mongo_input.setStyleSheet( @@ -303,7 +303,7 @@ class InstallDialog(QtWidgets.QDialog): options |= QtWidgets.QFileDialog.DontUseNativeDialog options |= QtWidgets.QFileDialog.ShowDirsOnly - filename, _ = QtWidgets.QFileDialog.getOpenFileName( + filename, _ = QtWidgets.QFileDialog.getExistingDirectory( parent=self, caption='Select path', directory=os.getcwd(), @@ -378,6 +378,7 @@ class InstallDialog(QtWidgets.QDialog): if len(self._path) < 1: self._mongo.setVisible(False) + return path def _update_console(self, msg: str, error: bool = False) -> None: """Display message in console. diff --git a/igniter/install_thread.py b/igniter/install_thread.py index bca8848f7e..bb4ab1c9dd 100644 --- a/igniter/install_thread.py +++ b/igniter/install_thread.py @@ -146,10 +146,11 @@ class InstallThread(QThread): bs.registry.set_secure_item("pypeMongo", self._mongo) os.environ["PYPE_MONGO"] = self._mongo + self.message.emit(f"processing {self._path}", True) repo_file = bs.process_entered_location(self._path) if not repo_file: - self.message.emit(f"!!! Cannot install", True) + self.message.emit("!!! Cannot install", True) return def set_path(self, path: str) -> None: diff --git a/igniter/tools.py b/igniter/tools.py index 387a1934b1..e7cb99865d 100644 --- a/igniter/tools.py +++ b/igniter/tools.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- """Tools used in **Igniter** GUI.""" import os -import sys import uuid from urllib.parse import urlparse @@ -81,26 +80,6 @@ def validate_path_string(path: str) -> (bool, str): return False, "Not implemented yet" -def add_acre_to_sys_path(): - """Add full path of acre module to sys.path on ignition.""" - try: - # Skip if is possible to import - import acre - - except ImportError: - # Full path to acre repository related to current file - acre_dir = os.path.join( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))), - "repos", - "acre" - ) - # Add path to sys.path - sys.path.append(acre_dir) - - # Validate that acre can be imported - import acre - - def load_environments(sections: list = None) -> dict: """Load environments from Pype. @@ -114,7 +93,6 @@ def load_environments(sections: list = None) -> dict: dict of str: loaded and processed environments. """ - add_acre_to_sys_path() import acre from pype import settings diff --git a/requirements.txt b/requirements.txt index 3263431948..5164159842 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -git+https://github.com/antirotor/acre.git@fix/unformatted-tokens +git+https://github.com/pypeclub/acre.git aiohttp aiohttp_json_rpc appdirs diff --git a/setup.py b/setup.py index 964c088e4f..99e1fe75b9 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ install_requires = [ "keyring", "clique", "jsonschema", - "OpenTimelineIO", + "opentimelineio", "pathlib2", "pkg_resources", "PIL", @@ -39,13 +39,7 @@ install_requires = [ "httplib2" ] -includes = [ - "repos/acre/acre", - "repos/avalon-core/avalon", - "repos/pyblish-base/pyblish", - "repos/maya-look-assigner/mayalookassigner" -] - +includes = [] excludes = [] bin_includes = [] include_files = [ @@ -63,7 +57,7 @@ include_files = [ if sys.platform == "win32": install_requires.append("win32ctypes") -buildOptions = dict( +build_options = dict( packages=install_requires, includes=includes, excludes=excludes, @@ -83,7 +77,7 @@ setup( description="Ultimate pipeline", cmdclass={"build_sphinx": BuildDoc}, options={ - "build_exe": buildOptions, + "build_exe": build_options, "build_sphinx": { "project": "Pype", "version": __version__, diff --git a/start.py b/start.py index b18e908417..82dfc1dce9 100644 --- a/start.py +++ b/start.py @@ -93,14 +93,10 @@ import re import sys import traceback -from igniter import BootstrapRepos -from igniter.tools import load_environments, add_acre_to_sys_path +import acre -try: - import acre -except ImportError: - add_acre_to_sys_path() - import acre +from igniter import BootstrapRepos +from igniter.tools import load_environments def set_environments() -> None: