Skip to content

chore: migrate project config from Hatch envs to UV#73

Open
Copilot wants to merge 7 commits intomainfrom
copilot/migrate-project-config-away-from-hatch
Open

chore: migrate project config from Hatch envs to UV#73
Copilot wants to merge 7 commits intomainfrom
copilot/migrate-project-config-away-from-hatch

Conversation

Copy link

Copilot AI commented Mar 9, 2026

  • Explore repo and understand current Hatch configuration
  • Update pyproject.toml:
    • Add dev optional-dependency group
    • Remove all [tool.hatch.envs.*] sections and scripts
    • Keep [tool.hatch.version] and [tool.hatch.build.*] sections
  • Update AGENTS.md: Replace hatch run ... commands with uv run ... equivalents
  • Update CONTRIBUTING.md: Replace Hatch instructions with UV instructions
  • Update README.md: Remove Hatch project badge
  • Fix CI workflows:
    • .github/workflows/test.yml: Replace pip install hatch + hatch run ... with astral-sh/setup-uv + uv sync --extra dev + uv run ...; remove e2e step
    • .github/workflows/docs.yml: Replace pip install hatch + hatch run mkdocs ... with astral-sh/setup-uv + uv sync --extra dev + uv run mkdocs ...
    • .github/workflows/release.yml: Replace pip install hatch + hatch build/publish with astral-sh/setup-uv + uv build/publish
Original prompt

Migration Objective

Migrate the project configuration away from using Hatch for environment management dependencies and tasks. Hatchling will continue to be used as the build system.

Approach:

  1. Retain [build-system] using Hatchling as the build backend.
  2. Remove all [tool.hatch.envs.*] environment configurations (default, lint, etc.).
  3. Migrate runtime dependencies (dependencies) and optional dependencies (optional-dependencies) from Hatch to standard [project] and [project.optional-dependencies] in pyproject.toml.
  4. Replace Hatch-based scripts (e.g., test, docs, lint) with documentation for how to achieve the same using UV or standard tools.

Involved Changes:

  1. Edit the pyproject.toml to remove Hatch environments and directly list dependencies.
  2. Update documentation (e.g., README.md or CONTRIBUTING.md) to guide contributors on the setup and commands post-migration.

This pull request was created from Copilot chat.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: masci <7241+masci@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate project configuration from Hatch environment management chore: migrate project config from Hatch envs to UV Mar 9, 2026
Copilot finished work on behalf of masci March 9, 2026 12:58
@masci
Copy link
Owner

masci commented Mar 9, 2026

@copilot fix the ci

Co-authored-by: masci <7241+masci@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 9, 2026

@copilot fix the ci

Fixed in 59090f7. The CI workflows still referenced hatch commands. Updated all three:

  • test.yml: replaced pip install hatch + hatch run lint:all / hatch run cov / hatch run test with astral-sh/setup-uv@v5 + uv sync --extra dev + equivalent uv run commands
  • docs.yml: replaced pip install hatch + hatch run mkdocs gh-deploy with astral-sh/setup-uv@v5 + uv run mkdocs gh-deploy
  • release.yml: replaced pip install hatch + hatch build / hatch publish with astral-sh/setup-uv@v5 + uv build / uv publish

Copilot finished work on behalf of masci March 9, 2026 13:07
@masci
Copy link
Owner

masci commented Mar 9, 2026

@copilot remove the e2e tests job from the workflow

Co-authored-by: masci <7241+masci@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 9, 2026

@copilot remove the e2e tests job from the workflow

Done in c0b731d — removed the End-to-end step from the linux job in test.yml.

Copilot finished work on behalf of masci March 9, 2026 14:01
@masci masci marked this pull request as ready for review March 9, 2026 15:04
Copilot AI review requested due to automatic review settings March 9, 2026 15:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the project’s developer workflow and CI from Hatch-managed environments/tasks to uv, while keeping Hatchling as the build backend in pyproject.toml.

Changes:

  • Move dev tooling dependencies into a dev optional-dependency group and remove Hatch env/task configuration from pyproject.toml.
  • Update contributor/agent documentation to use uv sync / uv run ... commands and remove the Hatch badge.
  • Update GitHub Actions workflows to install and use uv for tests, docs deployment, and publishing releases.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Removes Hatch env/task config, adds dev extra, retains Hatchling build/version config.
README.md Removes Hatch project badge.
CONTRIBUTING.md Replaces Hatch setup/test/lint/docs instructions with uv equivalents.
AGENTS.md Updates quick-reference and dev commands from Hatch to uv.
.github/workflows/test.yml Switches CI to setup-uv, uv sync --extra dev, and uv run for lint/tests; removes e2e CI step.
.github/workflows/docs.yml Switches docs deploy workflow from Hatch to uv.
.github/workflows/release.yml Switches build/publish steps from hatch build/publish to uv build/publish.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +51 to +57
$ uv run ruff format --check && uv run ruff check . && uv run mypy --install-types --non-interactive src/banks && uv run pylint src/banks
```

To auto-format the code:

```sh
$ uv run ruff format
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot can you wrap this in a single command?

Copy link
Author

Choose a reason for hiding this comment

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

Done in 5d395f6 — merged the two separate blocks into a single command that auto-formats and runs all lint checks:

$ uv run ruff format && uv run ruff check . && uv run mypy --install-types --non-interactive src/banks && uv run pylint src/banks

masci and others added 2 commits March 9, 2026 16:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: masci <7241+masci@users.noreply.github.com>
Copilot finished work on behalf of masci March 9, 2026 15:38
@masci
Copy link
Owner

masci commented Mar 9, 2026

@copilot revert the last commit, that's not what I wanted

…ING.md

Co-authored-by: masci <7241+masci@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 9, 2026

@copilot revert the last commit, that's not what I wanted

Reverted in 451926dCONTRIBUTING.md is back to two separate blocks (comprehensive lint check and auto-format).

Copilot finished work on behalf of masci March 9, 2026 15:43
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.

3 participants