Skip to content

Commit

Permalink
Update version and packaging spec
Browse files Browse the repository at this point in the history
  • Loading branch information
hasielhassan committed Sep 6, 2023
1 parent 19047a1 commit 9228f6d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
41 changes: 34 additions & 7 deletions .spec
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.2.0
8 changes: 5 additions & 3 deletions modules/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9228f6d

Please sign in to comment.