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

Migrate from setup.cfg to pyproject.toml #107

Merged
merged 2 commits into from
May 7, 2024

Conversation

azriel1rf
Copy link
Collaborator

@azriel1rf azriel1rf commented May 7, 2024

Summary

This pull request implements the migration from setup.cfg to pyproject.toml in compliance with PEP 621. This change simplifies the project configuration by consolidating it into a single file and utilizes the enhanced capabilities provided by setuptools version 61.0 or higher.
Additionally, I have added myself as a maintainer in the PyPI metadata to reflect my role in project maintenance.

Key Changes

  • Configuration Migration: All configurations previously in setup.cfg have been moved to pyproject.toml.
  • Build System Update: Updated the build system requirements in pyproject.toml to require setuptools>=61.0. Removed the dependency on wheel as it is no longer necessary with the new setuptools capabilities.
  • Development Environment: Specified development dependencies directly in pyproject.toml under project.optional-dependencies, making it easier to set up a development environment.
  • Documentation Updates: Updated python/README.md to include instructions for building the package using python -m build and verifying the package with python -m twine check.
  • Removal of Redundant Tools: Removed setup-cfg-fmt from the pre-commit configuration as it is no longer needed.
  • Maintainer Information Update: Added myself as a maintainer in the pyproject.toml to reflect my maintenance role on PyPI.

Motivation

The migration to pyproject.toml aligns with modern Python packaging practices and simplifies project maintenance. It also enhances the setup process for new contributors by defining all dependencies and configurations in a single file.

Testing

  • Building the Package: Ran python -m build to ensure the package builds correctly with the new configuration.
  • Installing the Built Package: Installed the built package using pip install dist/*.whl to verify installation processes.
  • Functionality Check: Imported the installed package and executed some functions in the Python REPL to ensure that the package functions as expected.
  • PyPI Rendering Check: Used python -m twine check dist/* to verify that the package's long description renders correctly on PyPI.

Additional Notes

  • Contributors are encouraged to update their local development setups to utilize the new pyproject.toml configurations.

Files Modified

  • .pre-commit-config.yaml: Removed hooks related to setup-cfg-fmt.
  • python/README.md: Updated documentation to reflect new build and check commands.
  • python/pyproject.toml: Major updates to include all necessary project configurations.
  • python/setup.cfg: File removed as all configurations are now in pyproject.toml.

Please review the changes and provide your feedback.

@azriel1rf azriel1rf self-assigned this May 7, 2024
Copy link
Owner

@HenryRLee HenryRLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you!

@HenryRLee HenryRLee merged commit ca8b5ab into develop May 7, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants