Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance setup.py with best practices #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tejhande
Copy link

@tejhande tejhande commented Jun 7, 2024

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant