Skip to content

Commit

Permalink
Update pyinstaller requirement from 5.13.2 to 6.4.0 (#72)
Browse files Browse the repository at this point in the history
* Update pyinstaller requirement from 5.13.2 to 6.4.0

Updates the requirements on [pyinstaller](https://github.com/pyinstaller/pyinstaller) to permit the latest version.
- [Release notes](https://github.com/pyinstaller/pyinstaller/releases)
- [Changelog](https://github.com/pyinstaller/pyinstaller/blob/develop/doc/CHANGES.rst)
- [Commits](pyinstaller/pyinstaller@v5.13.2...v6.4.0)

---
updated-dependencies:
- dependency-name: pyinstaller
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* `onefile` build with pyinstaller 6

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Seweryn Presnal <[email protected]>
  • Loading branch information
dependabot[bot] and IhateTrains authored Feb 24, 2024
1 parent a7c4602 commit 475b00c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
pip3 install pip-tools
python3 -m piptools compile -o requirements.txt pyproject.toml
pip3 install -r requirements.txt
pyinstaller --icon=updater.ico updater.py
pyinstaller --onefile --icon=updater.ico updater.py
- name: "Check if updater works correctly"
run: |
mkdir Release
mkdir -p Release/Updater
mv dist/updater/* Release/Updater/
mv dist/* Release/Updater/
mkdir -p Release/ImperatorToCK3
mv Release/Updater Release/Updater-running
cd Release/Updater-running
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
pip3 install -r requirements.txt
- name: "Create executable with pyinstaller"
run: |
pyinstaller --icon=updater.ico updater.py
pyinstaller --onefile --icon=updater.ico updater.py
- name: "Archive release"
uses: thedoctor0/zip-release@master
with:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.9,<3.12"
urllib3 = "2.2.1"
pyinstaller = "5.13.2"
pyinstaller = "6.4.0"
wheel = "^0.42.0"


Expand Down
16 changes: 7 additions & 9 deletions updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
import pathlib


# change working directory to script's location
# Change working directory to updater.exe's directory.
# The if below determines whether the app is a script file or frozen exe.
if getattr(sys, 'frozen', False):
# If the application is run as a bundle, the PyInstaller bootloader
# extends the sys module by a flag frozen=True and sets the app
# path into variable _MEIPASS
running_updater_path = sys._MEIPASS
else:
running_updater_path = os.path.dirname(os.path.abspath(__file__))
os.chdir(running_updater_path)
running_updater_dir = os.path.dirname(sys.executable)
elif __file__:
running_updater_dir = os.path.dirname(__file__)
os.chdir(running_updater_dir)


# Logging configuration: log to file and console.
Expand Down Expand Up @@ -65,7 +63,7 @@ def clear_converter_folder():
for path in paths:
if os.path.isdir(path):
# remove directory
if os.path.samefile(path, running_updater_path):
if os.path.samefile(path, running_updater_dir):
# Don't remove running updater folder.
continue
shutil.rmtree(path, ignore_errors=True)
Expand Down

0 comments on commit 475b00c

Please sign in to comment.