Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyinstaller requirement from 5.13.2 to 6.4.0 #72

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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