From 414f384765d39f7ba33ffef995dd92f9f15fd5b3 Mon Sep 17 00:00:00 2001 From: Richard Baltrusch Date: Sat, 13 Aug 2022 02:16:12 +0200 Subject: [PATCH] Fix missing icon in release package --- MANIFEST.in | 1 + bach_generator/gui/components.py | 4 ++++ setup.py | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index c7467a8..f562bd5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,5 @@ include README.md include LICENSE include requirements.txt include bach_generator/py.typed +include bach_generator/gui/media/icon.png recursive-exclude tests * diff --git a/bach_generator/gui/components.py b/bach_generator/gui/components.py index bde642b..b1aa19c 100644 --- a/bach_generator/gui/components.py +++ b/bach_generator/gui/components.py @@ -8,6 +8,7 @@ # pylint: disable=line-too-long import ctypes +import os import sys import tkinter as tk from uuid import uuid4 @@ -42,6 +43,9 @@ def add_frames(self): def set_icon(self, icon_path): """Sets window icon, and taskbar icon (only on Windows)""" + if not os.path.isfile(icon_path): + return + photo = tk.PhotoImage(file=icon_path) self.iconphoto(False, photo) self._set_taskbar_icon() diff --git a/setup.py b/setup.py index c543ed7..d86d7c6 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="bach_generator", - version="1.0.0", + version="1.0.1", description="Machine learning based Bach music generator", long_description=project_dir.joinpath("README.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown", @@ -16,7 +16,6 @@ author="Richard Baltrusch", url="https://github.com/rbaltrusch/bach_generator", packages=setuptools.find_packages("."), - package_dir={"": "."}, python_requires=">=3.8", include_package_data=True, package_data={"bach_generator": ["py.typed"]}, # for mypy