uxoxo/eb2ab
0
1import subprocess2import sys3from setuptools import setup, find_packages4from setuptools.command.develop import develop5from setuptools.command.install import install6import os7 8cwd = os.path.dirname(os.path.abspath(__file__))9 10def get_version():11 with open("VERSION.txt", "r") as f:12 return f.read().strip()13 14with open("README.md", "r", encoding='utf-8') as fh:15 long_description = fh.read()16 17with open('requirements.txt') as f:18 requirements = f.read().splitlines()19 20class PostInstallCommand(install):21 def run(self):22 install.run(self)23 try:24 subprocess.run([sys.executable, 'python -m', 'unidic', 'download'], check=True)25 except Exception:26 print("unidic download failed during installation, but it will be re-attempted a diffrent way when the app itself runs.")27 28 29setup(30 name='ebook2audiobook',31 version=get_version(),32 python_requires=">3.9,<3.13",33 author="Drew Thomasson",34 description="Convert eBooks to audiobooks with chapters and metadata",35 long_description=long_description,36 long_description_content_type="text/markdown",37 url="https://github.com/DrewThomasson/ebook2audiobook",38 packages=find_packages(),39 install_requires=requirements,40 classifiers=[41 "Programming Language :: Python :: 3",42 "License :: OSI Approved :: MIT License",43 "Operating System :: OS Independent",44 ],45 include_package_data=True,46 entry_points={47 "console_scripts": [48 "ebook2audiobook = app:main",49 ],50 },51 cmdclass={52 'install': PostInstallCommand,53 }54)55 