-
Notifications
You must be signed in to change notification settings - Fork 17
Switch to UV #204
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
Switch to UV #204
Conversation
Reviewer's GuideThis PR migrates the project’s packaging, testing, documentation, and release processes from flit to uv by overhauling the build configuration in pyproject.toml, updating documentation commands and badges, adding a uv-based release workflow, and cleaning up legacy artifacts. Entity relationship diagram for dependency groups in pyproject.tomlerDiagram
PROJECT ||--o{ DEPENDENCY_GROUP : has
DEPENDENCY_GROUP {
string name
string[] dependencies
}
PROJECT {
string name
string version
string requires-python
}
Flow diagram for documentation build process using uvflowchart TD
DocsMakefile[docs/Makefile]
UVRun[uv run --project=.. --group docs --locked sphinx-build]
SphinxBuild[sphinx-build]
DocsMakefile --> UVRun --> SphinxBuild
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
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.
Hey there - I've reviewed your changes and they look great!
Blocking issues:
- An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/release.yml:29` </location>
<code_context>
+ - name: Verify version matches release tag
+ shell: bash
+ run: |
+ TAG="${GITHUB_EVENT_NAME:-release}"
+ # On release event, the tag name is here:
+ TAG_NAME="${{ github.event.release.tag_name }}"
+ VERSION="$(uv version --short)"
+ echo "tag=${TAG_NAME} pyproject=${VERSION}"
+ # Accept tags like v1.2.3 -> 1.2.3
+ TAG_STRIPPED="${TAG_NAME#v}"
+ test "${VERSION}" = "${TAG_STRIPPED}"
+
+ - name: Build distributions
</code_context>
<issue_to_address>
Release workflow strictly enforces version/tag match, which may block releases if tags are misnamed.
Consider providing clear error messages or instructions for maintainers when the version/tag check fails to help resolve formatting issues quickly.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
- name: Verify version matches release tag
shell: bash
run: |
TAG="${GITHUB_EVENT_NAME:-release}"
# On release event, the tag name is here:
TAG_NAME="${{ github.event.release.tag_name }}"
VERSION="$(uv version --short)"
echo "tag=${TAG_NAME} pyproject=${VERSION}"
# Accept tags like v1.2.3 -> 1.2.3
TAG_STRIPPED="${TAG_NAME#v}"
test "${VERSION}" = "${TAG_STRIPPED}"
=======
- name: Verify version matches release tag
shell: bash
run: |
TAG="${GITHUB_EVENT_NAME:-release}"
# On release event, the tag name is here:
TAG_NAME="${{ github.event.release.tag_name }}"
VERSION="$(uv version --short)"
echo "tag=${TAG_NAME} pyproject=${VERSION}"
# Accept tags like v1.2.3 -> 1.2.3
TAG_STRIPPED="${TAG_NAME#v}"
if [ "${VERSION}" != "${TAG_STRIPPED}" ]; then
echo "::error::Version mismatch detected!"
echo "Release tag: ${TAG_NAME}"
echo "pyproject.toml version: ${VERSION}"
echo ""
echo "To fix:"
echo " - Ensure the release tag matches the version in pyproject.toml (e.g., tag 'v${VERSION}')"
echo " - If the tag is incorrect, delete and recreate the release with the correct tag."
exit 1
fi
>>>>>>> REPLACE
</suggested_fix>
### Comment 2
<location> `pyproject.toml:21` </location>
<code_context>
+ { name = "Nathan Patton", email = "npatton@gmail.com" }
+]
+readme = "README.md"
+license = { text = "MIT" }
classifiers = [
"Intended Audience :: Information Technology",
</code_context>
<issue_to_address>
License field uses inline text rather than SPDX identifier.
Use the SPDX identifier format for the license field to ensure compatibility with PyPI and related tools.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
license = { text = "MIT" }
=======
license = "MIT"
>>>>>>> REPLACE
</suggested_fix>
## Security Issues
### Issue 1
<location> `.github/workflows/release.yml:21` </location>
<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
*Source: opengrep*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
# Conflicts: # requirements-test.txt
Description
Switch to using uv wherever possible, including in test, build and release steps
Checklist:
Summary by Sourcery
Migrate project from flit to uv for building, testing, and publishing; update configuration, documentation, and CI workflows accordingly.
Enhancements:
Build:
CI:
Documentation: