Skip to content

feat: modernize packaging with pyproject.toml and uv #247

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

Merged
merged 6 commits into from
Jul 2, 2025

Conversation

taeold
Copy link
Collaborator

@taeold taeold commented Jul 1, 2025

Summary

Modernize Python packaging by migrating to pyproject.toml and adopting uv for faster dependency management.

Changes

  • Migrate to pyproject.toml: Move all package metadata from setup.py to modern pyproject.toml (PEP 621)
  • Add uv package manager: 10-100x faster than pip, with lock file for reproducible builds
  • Update CI/CD workflows: All workflows now use uv sync and uv run commands
  • Update docs: CONTRIBUTING.md now shows uv-based development workflow
  • Add .python-version: Ensures consistent Python 3.10 usage

Benefits

  • Faster dependency installation and CI runs
  • Modern Python packaging standards
  • Reproducible builds with uv.lock
  • Simpler maintenance

Notes

Test plan

  • Tests pass: uv run pytest
  • Build works: uv run python -m build
  • CI passes with new workflows

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @taeold, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request overhauls the Python packaging and development environment to align with modern best practices, significantly improving dependency management speed, build reproducibility, and code quality tooling. These changes are foundational, aiming to streamline development and CI processes without altering core functionality.

Highlights

  • Modernized Python Packaging: This pull request significantly modernizes the Python packaging setup by migrating from setup.py to pyproject.toml (PEP 621) for package metadata and configuration.
  • Introduction of uv Package Manager: The project now adopts uv as its primary package manager, promising 10-100x faster dependency management and reproducible builds via uv.lock.
  • CI/CD and Development Workflow Updates: All CI/CD workflows have been updated to leverage uv sync and uv run commands, and the CONTRIBUTING.md documentation has been revised to guide developers through the new uv-based development setup.
  • Code Formatting and Linting Standard: The project transitions from yapf and pylint to ruff for code formatting and linting, with corresponding updates in .vscode/settings.json and pyproject.toml.
  • Consistent Python Versioning: A .python-version file has been added to ensure consistent usage of Python 3.10 across the development environment.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@taeold
Copy link
Collaborator Author

taeold commented Jul 1, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modernizes the project's packaging and dependency management by migrating to pyproject.toml and adopting uv. The changes are well-organized, and the updates to CI workflows and documentation are excellent. Consider committing the uv.lock file and using the standard [project.optional-dependencies] table for development dependencies.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modernizes the project's packaging by adopting pyproject.toml and uv. The changes are well-structured and move the project in the right direction. I've identified a few critical and high-severity issues related to the new packaging and dependency management setup that should be addressed to ensure correctness, maintainability, and reproducibility.

taeold added 2 commits July 1, 2025 20:10
- Add ruff to dev dependencies
- Configure ruff in pyproject.toml to match Google style
- Add ruff linting to CI alongside pylint
- Replace yapf with ruff format in CI
- Remove yapf from dependencies
- Add .git-blame-ignore-revs for formatting commit
- Migrate package metadata from setup.py to pyproject.toml (PEP 621)
- Keep dynamic version reading from __init__.py for compatibility
- Use modern dependency-groups format (PEP 735) for dev dependencies
- Add uv for fast dependency management (10-100x faster than pip)
- Update all CI/CD workflows to use uv
- Add .python-version file for consistent Python version
- Update CONTRIBUTING.md with uv instructions
- Use modern build tool instead of setup.py commands
- Fix license format to use SPDX identifier

Benefits:
- Faster dependency installation and resolution with uv
- Modern Python packaging standards compliance
- Better dependency locking with uv.lock
- Simpler, more maintainable configuration
- Consistent Python version across environments
@taeold taeold force-pushed the modernize-pyproject-toml branch from b2260fc to 175f7fb Compare July 2, 2025 03:12
@taeold
Copy link
Collaborator Author

taeold commented Jul 2, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a great step forward in modernizing the project's packaging and dependency management. The migration to pyproject.toml and adoption of uv will certainly improve the developer experience and CI performance. I've left a few comments to enhance compatibility and maintainability, mainly concerning the pyproject.toml configuration and a small improvement to the contribution guide. Once these points are addressed, this PR will be in excellent shape.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@taeold taeold merged commit 429c901 into main Jul 2, 2025
11 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.

1 participant