-
Notifications
You must be signed in to change notification settings - Fork 18
chore: Migrate from Poetry to uv and Hatchling #380
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
base: master
Are you sure you want to change the base?
Conversation
This commit migrates the project's dependency management and build system from Poetry to uv and Hatchling. This change significantly speeds up dependency installation and testing, providing a more efficient development workflow. Key changes include: - `pyproject.toml` is now configured for Hatchling and uv. - GitHub Actions workflows have been updated to use `astral-sh/setup-uv`. - `tox.ini` is reconfigured to use `tox-uv` for test environments. - `README.md` has been updated with new setup and usage instructions. - Obsolete Poetry and pyenv files (`tool-versions.example`, etc.) have been removed.
There was a problem hiding this 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 Python packaging and dependency workflow from Poetry to uv + Hatchling, updating local tooling and CI/release automation accordingly.
Changes:
- Replaces Poetry configuration with PEP 621
[project]metadata and Hatchling build settings inpyproject.toml. - Updates
toxand GitHub Actions to use uv (includingtox-uv) instead of Poetry. - Removes legacy requirements/tool-version files and refreshes developer docs for uv-based workflows.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Switches tox to tox>=4 + tox-uv, installs project as editable with extras=test, and removes Poetry commands. |
| tool-versions.example | Removes obsolete Python version pinning example. |
| requirements-test.txt | Removes legacy test requirements file (replaced by pyproject extras/tox). |
| requirements-dev.txt | Removes legacy dev requirements file (replaced by pyproject extras/tox). |
| pyproject.toml | Converts Poetry config to [project] + Hatchling build config; defines test/dev optional dependencies. |
| pylintrc | Removes suggestion-mode setting. |
| ci/scripts/build_with_uv.sh | Replaces Poetry build invocation with uv build. |
| README.md | Updates setup/lint/test instructions to use uv. |
| .releaserc.yml | Updates release build script to use the uv-based build script. |
| .gitignore | Ignores uv.lock and *.sqlite3. |
| .github/workflows/release.yml | Installs uv in release workflow (replacing prior Poetry-based setup step). |
| .github/actions/setup/action.yml | Composite action now installs uv and tox tooling via uv tool install. |
Comments suppressed due to low confidence (2)
ci/scripts/build_with_uv.sh:8
- Using
$*here will perform word-splitting and can corrupt arguments that contain spaces (and it also drops original argument boundaries). Prefer passing through arguments as"$@"so flags/values are forwarded safely.
ci/scripts/build_with_uv.sh:17 - Same argument-forwarding issue here:
$*can break when any argument contains whitespace. Use"$@"to forward the original argument list safely.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| usedevelop = true | ||
| extras = test | ||
| passenv = | ||
| PYTEST_XDIST_AUTO_NUM_WORKERS |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extras = test installs the appmap[test] extra into every env, but that extra currently pins framework versions (Django>=4,<5, Flask>=3, SQLAlchemy>=2). This will make envs like django3, django5, flask2, and sqlalchemy1 impossible to resolve because tox also adds conflicting framework constraints for those factors. Consider removing framework pins from the test extra (keep it to pytest tooling only) and let tox factor-specific deps control Django/Flask/SQLAlchemy versions, or avoid using extras=test for the factor envs that vary framework versions.
| "Django>=4.0,<5.0", | ||
| "Flask>=3.0", | ||
| "sqlalchemy>=2.0,<3.0", |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including Django/Flask/SQLAlchemy version pins in the test extra conflicts with tox’s matrix which explicitly tests multiple framework versions (e.g., flask2 requires Flask<3, django3 requires Django<4, django5 requires Django>=5, sqlalchemy1 requires SQLAlchemy<2). This will prevent uv/pip from resolving dependencies for those tox envs. Move framework constraints out of test (keep it to test tooling), and let tox factor-specific deps (or separate per-framework extras) supply the framework versions.
| "Django>=4.0,<5.0", | |
| "Flask>=3.0", | |
| "sqlalchemy>=2.0,<3.0", |
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release job no longer sets up a specific Python version (the previous composite ./.github/actions/setup did). Since the release flow runs uv build via semantic-release, consider adding an explicit actions/setup-python step (or otherwise pinning/ensuring the Python used for building) to avoid relying on whatever Python happens to be preinstalled on the runner.
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install tox and tox-uv |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Step name is slightly misleading: this installs tox with both tox-uv and tox-gh-actions. Consider updating the step name to reflect the full set of tools being installed to reduce confusion when debugging CI.
| - name: Install tox and tox-uv | |
| - name: Install tox, tox-uv, and tox-gh-actions |
| uv sync --all-extras | ||
| ``` | ||
|
|
||
| ### wrapt |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wrapt section immediately following this heading still refers to dependency management via poetry (“not managed using poetry”), which is now outdated after the uv migration. Update that paragraph to reference uv/current tooling so the README doesn’t give conflicting guidance.
This commit migrates the project's dependency management and build system from Poetry to uv and Hatchling.
This change significantly speeds up dependency installation and testing, providing a more efficient development workflow.
Key changes include:
pyproject.tomlis now configured for Hatchling and uv.astral-sh/setup-uv.tox.iniis reconfigured to usetox-uvfor test environments.README.mdhas been updated with new setup and usage instructions.tool-versions.example, etc.) have been removed.