Skip to content

Commit

Permalink
Use PyInstaller hooks to get missing packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEBAS204 authored Dec 18, 2024
1 parent accf32f commit 6286cae
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions TwitchFarm.spec
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# -*- mode: python ; coding: utf-8 -*-

import sysconfig
from PyInstaller.utils.hooks import get_package_paths

block_cipher = None

def get_PKG(name, path):
# Assuming get_package_paths() is already defined elsewhere
return get_package_paths(name)[1] + path

added_files = [
('settings.json', '.'),
('TwitchChannelPointsMiner/assets/*', 'assets'),
# Dependencies
('venv/Lib/site-packages/irc/*.txt', 'irc'),
('venv/Lib/site-packages/emoji/unicode_codes/*.json', 'emoji/unicode_codes'),
('venv/Lib/site-packages/dateutil/zoneinfo/*.tar.gz', 'dateutil\zoneinfo'),
(get_PKG('irc', '/*.txt'), 'irc'),
(get_PKG('emoji', '/unicode_codes/*.json'), 'emoji/unicode_codes'),
(get_PKG('dateutil', '/zoneinfo/*.tar.gz'), 'dateutil\zoneinfo'),
]

a = Analysis(['TwitchFarm.py'],
pathex=['venv/Lib'],
pathex=[],
binaries=[],
datas=added_files,
hiddenimports=[],
Expand Down

0 comments on commit 6286cae

Please sign in to comment.