From 21bb4da0678453874322f99b066b9c0c613d57bb Mon Sep 17 00:00:00 2001 From: Tejas Amol Hande <59686002+tejhande@users.noreply.github.com> Date: Fri, 7 Jun 2024 23:38:02 +0530 Subject: [PATCH] Enhance setup.py with best practices This commit enhances the setup.py script for the stable-audio-tools package by incorporating several best practices for Python packaging. Changes: 1. Added the `author_email` parameter to include the email address of the package author. 2. Included the contents of the README.md file as the `long_description` parameter, allowing users to view the full package documentation on package repositories like PyPI. 3. Set the `long_description_content_type` parameter to "text/markdown" to indicate that the long description is in Markdown format, improving readability. 4. Enabled the `include_package_data` parameter to include non-Python files in the package distribution. 5. Added the `classifiers` parameter with relevant metadata about the package, such as its development status, intended audience, license, supported Python versions, and topic. 6. Specified the minimum required Python version using the `python_requires` parameter. 7. Defined an `entry_points` parameter to create a console script entry point for running the package's command-line interface (CLI) after installation. Benefits: - Improved package discoverability and usability by providing more comprehensive metadata and documentation. - Better adherence to Python packaging best practices, making the package more maintainable and compatible with other tools and ecosystems. - Inclusion of non-Python files in the package distribution, ensuring that all necessary resources are available to users. - Ability for users to run the package's CLI directly after installation, simplifying the usage experience. - Compatibility with multiple Python versions by specifying the minimum required version. --- setup.py | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 7e7470d..8e798c8 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,31 @@ from setuptools import setup, find_packages +with open("README.md", "r", encoding="utf-8") as fh: + long_description = fh.read() + setup( name='stable-audio-tools', - version='0.0.16', + version='0.1.0', url='https://github.com/Stability-AI/stable-audio-tools.git', author='Stability AI', + author_email='info@stability.ai', description='Training and inference tools for generative audio models from Stability AI', - packages=find_packages(), + long_description=long_description, + long_description_content_type="text/markdown", + packages=find_packages(), + include_package_data=True, + classifiers=[ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + ], + python_requires='>=3.7', install_requires=[ 'aeiou==0.0.20', 'alias-free-torch==0.0.6', @@ -25,7 +44,7 @@ 'pandas==2.0.2', 'pedalboard==0.7.4', 'prefigure==0.0.9', - 'pytorch_lightning==2.1.0', + 'pytorch_lightning==2.1.0', 'PyWavelets==1.4.1', 'safetensors', 'sentencepiece==0.1.99', @@ -41,4 +60,9 @@ 'webdataset==0.2.48', 'x-transformers<1.27.0' ], -) \ No newline at end of file + entry_points={ + 'console_scripts': [ + 'stable-audio-tools=stable_audio_tools.cli:main', + ], + }, +)