Skip to content

chore: use uv pip compile#1778

Merged
henryiii merged 5 commits intopypa:mainfrom
henryiii:henryiii/chore/uv
Mar 21, 2024
Merged

chore: use uv pip compile#1778
henryiii merged 5 commits intopypa:mainfrom
henryiii:henryiii/chore/uv

Conversation

@henryiii
Copy link
Copy Markdown
Contributor

@henryiii henryiii commented Mar 5, 2024

This cuts the time down from 40 seconds to 4 seconds, and doesn't require pre-installing every version of Python. It also is easy to run without nox too, since it's now just a simple command that doesn't require a Python version present.

It also adds a lock on importlib-metadata on older Pythons; build does require importlib-metadata on older Pythons, so guessing pip-tools just missed this?

This fixes running the noxfile with uv, too, and silences an incorrect warning from pylint.

@henryiii henryiii marked this pull request as draft March 5, 2024 16:37
@henryiii
Copy link
Copy Markdown
Contributor Author

henryiii commented Mar 5, 2024

The manylinux tags latest thing is broken on other PRs too.

@joerick
Copy link
Copy Markdown
Contributor

joerick commented Mar 7, 2024

reported that issue over on manylinux- pypa/manylinux#1581

@henryiii
Copy link
Copy Markdown
Contributor Author

henryiii commented Mar 8, 2024

Is it only manylinux1? We could just skip if this happens.

@henryiii henryiii force-pushed the henryiii/chore/uv branch from 3d3c5b7 to f82e4a4 Compare March 11, 2024 01:35
@henryiii henryiii marked this pull request as ready for review March 11, 2024 01:35
Copy link
Copy Markdown
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also specify in noxfile.py that nox should prefer uv, if it's available?

Comment thread noxfile.py Outdated
env = os.environ.copy()
# CUSTOM_COMPILE_COMMAND is a pip-compile option that tells users how to
# regenerate the constraints files
env["CUSTOM_COMPILE_COMMAND"] = f"nox -s {session.name}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not critical, but it looks like this isn't having an effect on uv yet, found an issue here- astral-sh/uv#1527

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's added now. Though IMO it's not really required, as unlike before, you don't need any special setup to compile it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called UV_CUSTOM_PIP_COMPILE, even though PR and release notes get it wrong. astral-sh/uv#2554

@henryiii
Copy link
Copy Markdown
Contributor Author

We can, but it would require the latest version of nox.

henryiii and others added 5 commits March 21, 2024 02:25
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii force-pushed the henryiii/chore/uv branch from 2a040f4 to bb1f0d2 Compare March 21, 2024 06:25
@henryiii henryiii merged commit 312cf15 into pypa:main Mar 21, 2024
@henryiii henryiii deleted the henryiii/chore/uv branch March 21, 2024 19:41
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.

2 participants