Skip to content
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

Use uv build #140

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Use uv build #140

merged 1 commit into from
Sep 5, 2024

Conversation

edgarrmondragon
Copy link
Contributor

@edgarrmondragon edgarrmondragon commented Sep 5, 2024

uv v0.4.5 was just released with uv build

uv build can be used to build both source distributions and binary distributions for your project. By default, uv build will build the project in the current directory, and place the built artifacts in a dist/ subdirectory

https://docs.astral.sh/uv/concepts/projects/#building-projects

@edgarrmondragon
Copy link
Contributor Author

This seems to shave off a couple of seconds so let me know if the change is welcome :)

@edgarrmondragon edgarrmondragon marked this pull request as ready for review September 5, 2024 00:50
@hynek
Copy link
Owner

hynek commented Sep 5, 2024

I'm obviously very interested in what uv is doing 🤓 I wouldn't give too much on the seconds shaved off, since CIs are rather indeterministic, but the simplification of the requirement files looks extremely lovely.

I'm just not 100% if I trust them nailing it on first try. 🤔 I'll merge for now, but I'll think about it for a moment, maybe even bump major version.

Thanks!

@hynek
Copy link
Owner

hynek commented Sep 5, 2024

Hey @charliermarsh & @zanieb – how confident are you that pushing this out won't break the Pythonverse? :)

@hynek hynek merged commit 0c40f84 into hynek:main Sep 5, 2024
14 checks passed
@edgarrmondragon edgarrmondragon deleted the use-uv-build branch September 5, 2024 04:43
@hynek
Copy link
Owner

hynek commented Sep 5, 2024

ah shit it totally will: astral-sh/uv#7066

I'll wait a moment before reverting, Astral tends to fix simple things faster than I can type git commands.

@hynek
Copy link
Owner

hynek commented Sep 5, 2024

ok, it's all good with SOURCE_DATE_EPOCH, but I'd still like to hear the confidence rating :)

hynek added a commit that referenced this pull request Sep 5, 2024
@hynek
Copy link
Owner

hynek commented Sep 9, 2024

fyi https://github.com/hynek/build-and-inspect-python-package/releases/tag/v2.9.0 is out with it

@davidism
Copy link

I'm playing around with uv for building and publishing Flask (although have to wait until uv publish supports attestations). It looks like you figured out that SOURCE_DATE_EPOCH is accounted for? Your comments are very mysterious, I was hoping you could explain exactly how you concluded it was ok.

@hynek
Copy link
Owner

hynek commented Nov 23, 2024

@davidism The key point is that uv is not involved in that part at all. It's all done by the build backend. I think my confusion was that the wheel command doesn't preserve timestamps so the output was wrong which is why I removed timestamps.

I tried replacing wheel with zip but that broke pytest: https://github.com/hynek/build-and-inspect-python-package/pull/114/files

If you want to make 100% sure it's accounted for, you'll have to download the built packages and look inside. :| LMK if you run into something else, my memory is somewhat cloudy on that, but again: uv build just calls your build backend, so any problems with it are to be searched there.

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