Skip to content

build: Hatch VCS#146

Merged
chrisk314 merged 3 commits intomainfrom
build/hatch-vcs
Jun 25, 2025
Merged

build: Hatch VCS#146
chrisk314 merged 3 commits intomainfrom
build/hatch-vcs

Conversation

@chrisk314
Copy link
Contributor

Summary

This PR introduces some enhancements and house cleaning for the build and packaging workflow for plugboard. Mainly "hatch-vcs" is introduced to set the semver string for the package dynamically.

Changes

  • Adds hatch-vcs as build-system dependency and dev dependency
  • Marks package version as dynamic in pyproject.toml
  • Uses hatch version to get/set semver strings in build steps rather than toml-cli tricks
  • Refactors Makefile to remove pyenv/poetry commands replacing with uv

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 @chrisk314, 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 significantly modernizes and streamlines the project's build, packaging, and dependency management workflows. The core changes involve migrating from poetry and pyenv to hatch-vcs for dynamic versioning and uv for environment and dependency management, alongside improvements to the Docker build process. The aim is to enhance efficiency, maintainability, and reproducibility of the build system.

Highlights

  • Build System Migration to Hatch: I've transitioned the project's version management from poetry and toml-cli to hatch-vcs. This involves marking the version as dynamic in pyproject.toml, adding hatch-vcs as a build system and development dependency, and updating the Dockerfile and Makefile to use hatch commands for building and retrieving the package version.
  • Dependency Management Shift to UV: The build and development workflows in the Makefile have been refactored to replace pyenv and poetry commands with uv. This includes using uv venv for virtual environment creation, uv sync for dependency installation, uv run for executing development tools (like ruff, mypy, pytest, mkdocs), and uv export for generating requirements.txt.
  • Docker Build Process Enhancements: The Dockerfile now leverages uv venv and installs hatchling in the builder stage. The package installation within the Docker image has been streamlined to use hatch build to create a wheel, followed by uv pip install of that wheel. The Makefile's docker-build target has been updated to use docker buildx build with added --provenance=false and --cache-from flags for improved build efficiency and reproducibility.
  • Dependency Pinning: The ray dependency in pyproject.toml has been pinned to <2.47 to address potential hanging issues observed in GitHub Actions, with a clarifying comment added.
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.

@chrisk314 chrisk314 requested a review from toby-coleman June 18, 2025 07:36
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 PR introduces hatch-vcs for dynamic package versioning and refactors the build system to use uv, replacing pyenv and poetry in the Makefile. The changes are generally well-aligned with these goals and modernize the build process. Key improvements:

  • pyproject.toml: Use hatch-vcs instead of hatch.vcs.
  • Dockerfile: Install hatch and hatch-vcs in the builder stage and use SETUPTOOLS_SCM_PRETEND_VERSION instead of UV_VERSION_BYPASS.
  • Makefile: Add --emit-package to the uv export command.

@chrisk314 chrisk314 marked this pull request as draft June 18, 2025 07:37
@chrisk314 chrisk314 marked this pull request as ready for review June 18, 2025 07:46
@codecov
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@chrisk314 chrisk314 merged commit af1651b into main Jun 25, 2025
13 checks passed
@chrisk314 chrisk314 deleted the build/hatch-vcs branch June 25, 2025 08:31
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