-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: uv builder #5652
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
feat: uv builder #5652
Conversation
Deploying goreleaser with
|
Latest commit: |
b7b71d7
|
Status: | ✅ Deploy successful! |
Preview URL: | https://31bbd634.goreleaser.pages.dev |
Branch Preview URL: | https://uv.goreleaser.pages.dev |
artifact.ByType(artifact.PyWheel), | ||
artifact.ByType(artifact.PySdist), |
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.
TODO: add tests for this
If it helps, some time this weekend I can take look at your open questions and add feedback. |
yes it would help a lot! Thank you @ryancurrah 🙏🏻 |
FWIW, it seems that tests are currently failing because setup-uv is missing in the workflow. In regards to running in docker, you'd probably do |
|
thanks for all the good feedback @ryancurrah do you think its too bad to have to do something like this if you need to build both wheel and sdist? builds:
- id: wheel
builder: uv
buildmode: wheel
- id: sdist
builder: uv
buildmode: sdist if you only need wheel, it'll be simply: builds:
- builder: uv gonna also look into compiled wheels as well |
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
This pull request implements initial support for UV builder to produce Python wheel and source distribution (sdist) packages using GoReleaser. Key changes include:
- Documentation updates for the new UV builder and nfpm configuration.
- Schema and config changes to support new build modes “wheel” and “sdist”.
- Implementation and tests for the UV builder, including adjustments in release, docker, and checksum pipelines.
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
www/docs/customization/nfpm.md | Added documentation for Python wheel and sdist default paths |
www/docs/customization/builds/uv.md | Introduced UV builder documentation and usage samples |
pkg/config/config.go | Updated BuildDetails enum to include “wheel” and “sdist” modes |
internal/static/config.uv.yaml | Provided example configuration for the UV builder |
internal/static/config.go | Added UV example config embedding for goreleaser init |
internal/pyproject/* | Added support for parsing pyproject.toml files and related tests |
internal/pipe/release/release.go | Included new artifact types (PyWheel and PySdist) for releases |
internal/pipe/docker/docker.go | Adjusted artifact filtering to include PyWheel in Docker builds |
internal/pipe/checksums/checksums.go | Included new artifact types for checksum generation |
internal/pipe/build/build.go | Updated defaults to set internal binary flag for UV builds |
internal/builders/uv/* | Complete implementation and tests for the new UV builder |
internal/builders/common/common.go | Updated config validation to allow buildmode for non-Go builders |
internal/artifact/artifact.go | Added artifact types and String representations for Python packages |
cmd/init.go | Added support for UV configuration in the initialization command |
Files not reviewed (1)
- internal/builders/uv/testdata/.gitignore: Language not supported
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.
Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- internal/builders/uv/testdata/.gitignore: Language not supported
Comments suppressed due to low confidence (1)
internal/pipe/docker/docker.go:145
- Consider reviewing the docker artifact filter: other pipelines include both PyWheel and PySdist, so clarify whether PySdist should be added here as well for consistency.
artifact.ByType(artifact.PyWheel),
var buildFlags []string | ||
var art *artifact.Artifact | ||
switch build.Buildmode { | ||
case "wheel", "": |
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.
Consider explicitly setting the default build mode to "wheel" in WithDefaults instead of relying on an empty string value, to remove ambiguity in build mode determination.
Copilot uses AI. Check for mistakes.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5652 +/- ##
==========================================
- Coverage 83.01% 82.98% -0.03%
==========================================
Files 158 160 +2
Lines 15564 15753 +189
==========================================
+ Hits 12920 13073 +153
- Misses 2088 2116 +28
- Partials 556 564 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey @caarlos0, Love what you are doing here. After using goreleaser (for a go project) for the first time a a few weeks ago I've been completely smitten with your work. I work as a staff engineer at Halfspace.ai and do a lot of python projects, so this feature would be highly useful for me. Let me know if I can do anything to help - code, docs, or just some sparring. 😊 |
hey @JenspederM! thanks for the kind words! in general, please feel free to comment if on anything you feel you have something to add always good to have more opinions, especially in the Python stuff - which is a tech I don't work with daily cheers! 🙏🏻 |
Initial impl of the UV support.
Questions/commentary
sdist
build as well, specially considering we already have the source archive feature - which I suspect we can setup to adddir.egg-info
andsetup.cfg
and it would be basically the same thing?pip install file.whl
, but how do I run it afterwards? Might be skill issue, but things likepython -m mymod
gives me module not found errors...TODOs
tests for dockertests for nfpms