Skip to content

Commit

Permalink
Include version in PyInstaller build and fix package name
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjacob committed Sep 19, 2024
1 parent 8c4f088 commit 38e17da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
from-pipfile: true
dev: true

- name: Install current package
run: pip install .

- name: Run PyInstaller
run: "pyinstaller BlackboardSync.spec --noconfirm --clean"

Expand Down
5 changes: 4 additions & 1 deletion BlackboardSync.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- mode: python ; coding: utf-8 -*-

import platform
from PyInstaller.utils.hooks import copy_metadata


def get_icon():
Expand All @@ -11,11 +12,13 @@ def get_icon():

def get_datas():
s = "\\" if platform.system() == "Windows" else "/"
metadata = copy_metadata('blackboardsync')[0]

return [
(f"blackboard_sync{s}assets", f"blackboard_sync{s}assets"),
(f"blackboard_sync{s}qt", f"blackboard_sync{s}qt"),
(f"blackboard_sync{s}universities.json", f"blackboard_sync")
(f"blackboard_sync{s}universities.json", f"blackboard_sync"),
metadata
]

a = Analysis(
Expand Down
3 changes: 2 additions & 1 deletion blackboard_sync/sync_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ def force_sync(self) -> None:

def open_settings(self) -> None:
__version__ = None
package = __package__.replace('_', '')

try:
__version__ = get_version(__package__)
__version__ = get_version(package)
except PackageNotFoundError:
pass

Expand Down

0 comments on commit 38e17da

Please sign in to comment.