From b7c1862651d3fdec1761ff04e3c6ba7570bccfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20=C5=9Eafak?= Date: Sun, 27 Apr 2025 01:21:16 +0300 Subject: [PATCH] Added changelog, cli for errors, fixes and improvements in code --- CHANGELOG.md | 4 ++++ README.md | 4 +++- WINDOWS_INSTALL.bat | 19 +++++++++++++------ abogen/main.py | 3 ++- pyproject.toml | 3 +++ 5 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..17f6abd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +- Switched from setuptools to hatchling for packaging. +- Added classifiers to the package metadata. +- Fixed "No module named 'docopt'" and "setuptools.build_meta" import errors while using .bat installer in Windows, mentioned by @nigelp in https://github.com/denizsafak/abogen/issues/2 +- Improved code and documentation. \ No newline at end of file diff --git a/README.md b/README.md index 2691a2c..aafb1d2 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,9 @@ abogen # Opens the GUI Feel free to explore the code and make any changes you like. ## `Credits` -Abogen uses [Kokoro](https://github.com/hexgrad/kokoro) for its high-quality, natural-sounding text-to-speech synthesis. Huge thanks to the Kokoro project and its contributors for making this possible. +- Abogen uses [Kokoro](https://github.com/hexgrad/kokoro) for its high-quality, natural-sounding text-to-speech synthesis. Huge thanks to the Kokoro team for making this possible. +- Thanks to [@wojiushixiaobai](https://github.com/wojiushixiaobai) for [Embedded Python](https://github.com/wojiushixiaobai/Python-Embed-Win64) packages. These modified packages include pip pre-installed, enabling Abogen to function as a standalone application without requiring users to separately install Python in Windows. +- Special thanks to the [PyQt](https://www.riverbankcomputing.com/software/pyqt/) team for providing the cross-platform GUI toolkit that powers Abogen's interface. ## `License` This project is available under the MIT License - see the [LICENSE](https://github.com/denizsafak/abogen/blob/main/LICENSE) file for details. diff --git a/WINDOWS_INSTALL.bat b/WINDOWS_INSTALL.bat index 190f30e..cccda1a 100644 --- a/WINDOWS_INSTALL.bat +++ b/WINDOWS_INSTALL.bat @@ -218,11 +218,20 @@ if errorlevel 1 ( exit /b ) -:: Install sphinx and hatchling -echo Installing sphinx and hatchling... -%PYTHON_CONSOLE_PATH% -m pip install --upgrade sphinx hatchling --no-warn-script-location +:: Install docopt's fixed version +echo Installing fixed version of docopt... +%PYTHON_CONSOLE_PATH% -m pip install --force-reinstall https://github.com/denizsafak/abogen/raw/refs/heads/main/abogen/resources/docopt-0.6.2-py2.py3-none-any.whl --no-warn-script-location if errorlevel 1 ( - echo Failed to install hatchling. + echo Failed to install fixed version of docopt. + pause + exit /b +) + +:: Install setup requirements +echo Installing setup requirements... +%PYTHON_CONSOLE_PATH% -m pip install --upgrade setuptools wheel sphinx hatchling --no-warn-script-location +if errorlevel 1 ( + echo Failed to install setup requirements. pause exit /b ) @@ -295,5 +304,3 @@ echo Starting %NAME%... start "" %RUN% %* exit /b - - diff --git a/abogen/main.py b/abogen/main.py index 0b3b195..2a994e6 100644 --- a/abogen/main.py +++ b/abogen/main.py @@ -5,6 +5,7 @@ from PyQt5.QtWidgets import QApplication from PyQt5.QtGui import QIcon from abogen.gui import abogen from abogen.utils import get_resource_path +from abogen import PROGRAM_NAME, VERSION # Ensure sys.stdout and sys.stderr are valid in GUI mode if sys.stdout is None: @@ -20,7 +21,7 @@ if platform.system() == "Darwin" and platform.processor() == "arm": if platform.system() == "Windows": import ctypes - app_id = "abogen.v1.0.0" + app_id = f"{PROGRAM_NAME}.{VERSION}" ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id) # Handle Wayland on Linux GNOME diff --git a/pyproject.toml b/pyproject.toml index 32c0563..308fd64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,9 @@ Issues = "https://github.com/denizsafak/abogen/issues" [project.gui-scripts] abogen = "abogen.main:main" +[project.scripts] +abogen-cli = "abogen.main:main" + [tool.hatch.build.targets.sdist] exclude = [ "/.github",