-
Notifications
You must be signed in to change notification settings - Fork 187
Migrate from hatch to uv for developing/contributing #77
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: main
Are you sure you want to change the base?
Conversation
CONTEXT.md
Outdated
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.
This file should be 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.
My bad - thought i had removed that
.github/workflows/test-lint-pr.yml
Outdated
- name: Install dependencies | ||
run: | | ||
pip install --no-cache-dir hatch | ||
uv venv |
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.
This seems to be a direct port of the prior commands, but it seems like uv
should be performing commands in the context of the venv automatically.
Specifically in the docs, they mention using the uv
commands directly, like sync
: https://docs.astral.sh/uv/guides/integration/github/#syncing-and-running - we shouldn't need to create or activate the virtual environment directly.
Similarly to run python, we should be using uv run
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.
I love just using uv run
for everything, but was a little concerned about completely moving off of the old venv pattern. However, probably not as big a deal for development workflows. I'll update.
scripts/format.py
Outdated
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.
I'm concerned that we're not leveraging uv well; there should be some mechanism to avoid needing to have dedicated files for each command that we want to run for formatting/linting etc.
Looking at the docs they have examples of using tools but because these tools are already installed to the project, I would guess that we could again use uv run
for them similar to what we had before
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.
Thought there might be some value in backwards compatibility, but I agree it's cleaner to run the tools directly. If you're cool with it, I'll just add them to the .toml file and remove the scripts/
@@ -3,7 +3,6 @@ | |||
from unittest.mock import MagicMock, call, patch | |||
|
|||
import pytest | |||
|
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.
Do we know why so many files were reformatted as part of this? If the dependencies were the same I would expect no formatting changes
README.md
Outdated
|
||
We welcome contributions! See our [Contributing Guide](https://github.com/strands-agents/sdk-python/blob/main/CONTRIBUTING.md) for details on: |
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.
Did we intentionally remove this section about contributing?
pyproject.toml
Outdated
|
||
[[tool.mypy.overrides]] | ||
module = "litellm" | ||
ignore_missing_imports = true | ||
|
||
[[tool.mypy.overrides]] |
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.
Why were these needed compared to before?
CONTRIBUTING.md
Outdated
|
||
## Development Environment | ||
|
||
This project uses [hatchling](https://hatch.pypa.io/latest/build/#hatchling) as the build backend and [hatch](https://hatch.pypa.io/latest/) for development workflow management. | ||
This project uses [uv_build](https://github.com/astral-sh/uv/blob/main/crates/uv-build/README.md) as the build backend and [uv](https://github.com/astral-sh/uv) for development workflow management. |
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.
Do we have a docs site to point to instead of a readme?
MIGRATION.md
Outdated
@@ -0,0 +1,137 @@ | |||
# Migration from Hatch to UV |
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.
This file should also be 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.
Fair. I'll add it to the PR comments instead
Description
Replaced hatch/hatchling with uv/uv_build. Completed with the help of Amazon Q Developer CLI!
Related Issues
#58
Documentation PR
Type of Change
[Choose one of the above types of changes]
Testing
Ran all linting and Bedrock testing commands successfully, except those that involve 3P APIs
hatch fmt --linter
hatch fmt --formatter
hatch test --all
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.