From 9228f6d37d8a85bc66bd0d998bbf95e8faa83941 Mon Sep 17 00:00:00 2001 From: Hasiel Alvarez Date: Wed, 6 Sep 2023 02:03:53 -0700 Subject: [PATCH] Update version and packaging spec --- .gitignore | 1 + .spec | 41 ++++++++++++++++++++++++++++++++++------- VERSION | 1 + modules/manager.py | 8 +++++--- 4 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 VERSION diff --git a/.gitignore b/.gitignore index 94cab8d..9574202 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ MANIFEST # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest +versionfile.txt # For this project the spec file is required #*.spec diff --git a/.spec b/.spec index 8597957..1a50992 100644 --- a/.spec +++ b/.spec @@ -3,24 +3,50 @@ block_cipher = None import os +import inspect +import pyinstaller_versionfile +from PyInstaller.utils.hooks import collect_submodules + import Nodz +import PySide2 +import shiboken2 # To collect all Nodz files we need to collect them manually -nodz_location = os.path.dirname(Nodz.__file__) +Nodz_location = os.path.dirname(Nodz.__file__) + +PROJECT_DIR = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe())) +) +with open(os.path.join(PROJECT_DIR, 'VERSION'), 'r') as file: + VERSION = file.read() + +pyinstaller_versionfile.create_versionfile( + output_file="versionfile.txt", + version=VERSION, + company_name="HasielHassan", + file_description="Plumber Manager", + internal_name="Plumber Manager", + legal_copyright="© Hasiel Alvarez 2023", + original_filename="PlumberManager.exe", + product_name="Plumber Manager", +) + +hiddenimports_QtSvg = collect_submodules('PySide2.QtSvg') +all_hidden_imports = hiddenimports_QtSvg a = Analysis( - ['manager.py'], + ['run.py'], pathex=[], binaries=[], datas=[ - ("custom_config.json", "."), - ("data_icons.json", "."), + ("config", "config"), ("modules", "modules"), ("resources", "resources"), ("samples", "samples"), - (nodz_location, "Nodz") + ("VERSION", "."), + (Nodz_location, "Nodz"), ], - hiddenimports=[], + hiddenimports=all_hidden_imports, hookspath=[], runtime_hooks=[], excludes=["PySide6", "shiboken6"], @@ -49,7 +75,8 @@ exe = EXE( strip=False, upx=True, console=False, - icon='resources/icon_32.ico' + icon='resources/icon_32.ico', + version='versionfile.txt', ) #coll = COLLECT( diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..86d4946 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.2.0 \ No newline at end of file diff --git a/modules/manager.py b/modules/manager.py index ee92048..150ca1f 100644 --- a/modules/manager.py +++ b/modules/manager.py @@ -26,9 +26,11 @@ PROJECT_DIR = os.path.dirname(os.path.dirname(__file__)) +with open(os.path.join(PROJECT_DIR, 'VERSION'), 'r') as file: + VERSION = file.read() class PlumberManager(QtWidgets.QMainWindow): - version = "0.0.1-0" + version = VERSION custom_config_path = os.path.join( PROJECT_DIR, 'config', 'custom_config.json' @@ -269,7 +271,7 @@ def loadDataTypes(cls, nodz): cls.data_types[name] = (dtype, path) - pprint.pprint(cls.data_types) + print(pprint.pformat(cls.data_types)) def createProcess(self): @@ -766,7 +768,7 @@ def setupAttr(self, node, attr, attr_type, attr_data): def setupNetwork(self, data): - pprint.pprint(data) + print(pprint.pformat(data)) node = self.nodz.createNode( name=data["node"], preset="node_preset_1", position=None