From bd8554c94d1241b99fa3047c95e55f6073c881e4 Mon Sep 17 00:00:00 2001 From: j5155 <54331556+j5155@users.noreply.github.com> Date: Sun, 19 May 2024 15:33:41 -0800 Subject: [PATCH] pyinstaller automatic version detection using setuptools-scm --- .github/workflows/pyinstaller.yml | 6 +++--- REVHubInterface.spec | 4 +++- pyinstaller-build-reqs.txt | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 pyinstaller-build-reqs.txt diff --git a/.github/workflows/pyinstaller.yml b/.github/workflows/pyinstaller.yml index 07c21fd..b5f78b1 100644 --- a/.github/workflows/pyinstaller.yml +++ b/.github/workflows/pyinstaller.yml @@ -13,7 +13,7 @@ jobs: python_ver: '3.12' pyinstaller_ver: '==6.6.0' spec: 'REVHubInterface.spec' - requirements: 'requirements.txt' + requirements: 'pyinstaller-build-reqs.txt' upload_exe_with_name: 'REVHubInterface_Mac_Binary' - name: Make DMG uses: unofficial-rev-port/create-dmg-action-fixed-icon@v0.0.4 @@ -34,7 +34,7 @@ jobs: python_ver: '3.12' pyinstaller_ver: '==6.6.0' spec: 'REVHubInterface.spec' - requirements: 'requirements.txt' + requirements: 'pyinstaller-build-reqs.txt' upload_exe_with_name: 'REVHubInterface_Windows' pyinstaller-build-linux: runs-on: ubuntu-latest @@ -45,7 +45,7 @@ jobs: python_ver: '3.12' pyinstaller_ver: '==6.6.0' spec: 'REVHubInterface.spec' - requirements: 'requirements.txt' + requirements: 'pyinstaller-build-reqs.txt' upload_exe_with_name: 'REVHubInterface_Linux' diff --git a/REVHubInterface.spec b/REVHubInterface.spec index 1c54005..b20998c 100644 --- a/REVHubInterface.spec +++ b/REVHubInterface.spec @@ -1,6 +1,8 @@ # -*- mode: python ; coding: utf-8 -*- from PyInstaller.utils.hooks import collect_all from PyInstaller.utils.hooks import collect_data_files +from setuptools_scm import get_version, _cli +_cli.main(["--force-write-version-files"]) datas = [] datas += collect_data_files('sv_ttk') @@ -58,7 +60,7 @@ app = BUNDLE( name='REVHubInterface.app', icon='org.unofficialrevport.REVHubInterface.icns', bundle_identifier=None, - version='DEV', # FIXME: Make dynamic + version=get_version(), info_plist={ 'NSPrincipalClass': 'NSApplication', 'NSAppleScriptEnabled': False, diff --git a/pyinstaller-build-reqs.txt b/pyinstaller-build-reqs.txt new file mode 100644 index 0000000..ba1b546 --- /dev/null +++ b/pyinstaller-build-reqs.txt @@ -0,0 +1,2 @@ +setuptools-scm=8.1.0 +-r requirements.txt \ No newline at end of file