Skip to content

Modernize packaging to PEP 621 standards with pyproject.toml - #228

Merged
dmort27 merged 1 commit into
masterfrom
modernize-python3
Oct 14, 2025
Merged

Modernize packaging to PEP 621 standards with pyproject.toml#228
dmort27 merged 1 commit into
masterfrom
modernize-python3

Conversation

@dmort27

@dmort27 dmort27 commented Oct 14, 2025

Copy link
Copy Markdown
Owner

Summary

This PR modernizes the epitran package's packaging configuration to follow current Python packaging standards (PEP 621) by migrating from the legacy setup.py-based configuration to a modern pyproject.toml approach.

Changes Made

New Files Created:

  • pyproject.toml - Modern PEP 621 compliant configuration with:

    • Build system specification using setuptools>=64
    • Complete project metadata in [project] section
    • SPDX license format (license = "MIT")
    • Comprehensive project URLs (homepage, repository, bug tracker, documentation)
    • Script configuration for command-line tools
    • Package discovery and data file specifications
    • Support for Python 3.10-3.13
  • MANIFEST.in - Explicit file inclusion rules for distributions

🔄 Files Modified:

  • setup.py - Reduced to minimal backward compatibility stub
  • Removed setup.cfg and epitran/setup.cfg - No longer needed

🧪 Testing:

  • ✅ Successfully builds wheel distributions (python -m build --wheel)
  • ✅ Successfully builds source distributions (python -m build --sdist)
  • ✅ All package metadata correctly generated
  • ✅ All scripts and data files properly included

Benefits

  1. Modern Standards: Follows PEP 621 for project metadata specification
  2. Better Organization: Clean separation between build configuration and project metadata
  3. Enhanced Metadata: Comprehensive project information and URLs
  4. Future-Proof: Ready for modern Python packaging ecosystem
  5. Backward Compatible: Maintains existing functionality with minimal setup.py
  6. Improved Maintainability: Declarative configuration is easier to maintain

Migration Details

  • All existing functionality is preserved
  • Command-line scripts continue to work as before
  • Package data and dependencies remain unchanged
  • Installation process remains the same for end users
  • Maintains compatibility with older pip versions via minimal setup.py

Verification

The packaging changes have been thoroughly tested:

  • Both wheel and source distributions build successfully
  • All package metadata is correctly generated
  • Scripts and data files are properly included
  • No functionality is lost in the migration

This modernization brings the epitran package up to current Python packaging standards while maintaining full backward compatibility.

- Created modern pyproject.toml following PEP 621 standards
- Added comprehensive project metadata and build system configuration
- Updated license format to SPDX standard (MIT)
- Added project URLs for homepage, repository, bug tracker, and documentation
- Configured script installation for command-line tools
- Added package discovery and data file specifications
- Created MANIFEST.in for proper file inclusion in distributions
- Reduced setup.py to minimal backward compatibility stub
- Removed legacy setup.cfg files
- Added support for Python 3.13 in classifiers
- Enhanced project metadata with keywords and better descriptions
- Tested both wheel and source distribution builds successfully

This modernization brings the package up to current Python packaging standards
while maintaining full backward compatibility and existing functionality.

Co-authored-by: openhands <openhands@all-hands.dev>
@dmort27
dmort27 merged commit 8d4e80c into master Oct 14, 2025
2 of 3 checks passed
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.

2 participants