Skip to content

Modernize project packaging: migrate to pyproject.toml#93

Merged
ESultanik merged 7 commits into
masterfrom
modernize-pyproject-toml
Aug 21, 2025
Merged

Modernize project packaging: migrate to pyproject.toml#93
ESultanik merged 7 commits into
masterfrom
modernize-pyproject-toml

Conversation

@dguido
Copy link
Copy Markdown
Member

@dguido dguido commented Aug 21, 2025

Summary

This PR modernizes the project's packaging infrastructure by migrating from the legacy setup.py to the modern pyproject.toml standard, using hatchling as the build backend.

Motivation

Issue #52 requested switching to pyproject.toml as it has become the standard for Python packaging. This brings the project up to date with modern Python packaging best practices.

Changes

  • Replaced setup.py with pyproject.toml: Using hatchling as the build backend (the modern successor to flit)
  • Added ruff configuration: Comprehensive linting and formatting rules configured directly in pyproject.toml
  • Simplified version.py: Made it compatible with modern tooling while maintaining backwards compatibility
  • Updated .gitignore: Added common Python development patterns and tool caches
  • Removed MANIFEST.in: No longer needed as hatchling handles file inclusion through configuration

Key improvements

  • ✅ Modern packaging standard (PEP 517/518/621 compliant)
  • ✅ Better tooling support (works great with uv, pip, pipx, etc.)
  • ✅ Integrated linting configuration with ruff
  • ✅ Simplified version management
  • ✅ Added Python 3.11 and 3.12 to classifiers
  • ✅ All dependencies and metadata preserved exactly

Testing

  • The pyproject.toml has been validated and parses correctly
  • All project metadata, dependencies, and entry points are preserved
  • Version information remains accessible through the simplified version.py

Backwards Compatibility

This change maintains full backwards compatibility:

  • All dependencies remain the same
  • The package name, version, and metadata are unchanged
  • Console script entry point remains graphtage
  • The package can still be installed with pip install . or pip install graphtage

Closes #52

- Replace setup.py with modern pyproject.toml using hatchling as build backend
- Add comprehensive ruff configuration for linting and formatting
- Simplify version.py for better compatibility with modern tooling
- Update .gitignore with common Python development patterns
- Remove obsolete MANIFEST.in (handled by hatchling configuration)
- Add Python 3.11 and 3.12 to classifiers
- Maintain all existing dependencies and optional dependencies
- Configure pytest settings in pyproject.toml

This modernizes the project's packaging infrastructure to use current
Python packaging best practices while maintaining full backwards
compatibility.

Closes #52
@dguido dguido requested a review from ESultanik as a code owner August 21, 2025 03:09
@ESultanik ESultanik merged commit 1bc8562 into master Aug 21, 2025
10 checks passed
@ESultanik ESultanik deleted the modernize-pyproject-toml branch August 21, 2025 19:24
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.

Switch to pyproject.toml

2 participants