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

chore: use uv pip compile #1778

Merged
merged 5 commits into from
Mar 21, 2024
Merged

chore: use uv pip compile #1778

merged 5 commits into from
Mar 21, 2024

Conversation

henryiii
Copy link
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
Contributor Author

henryiii commented Mar 5, 2024

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

@joerick
Copy link
Contributor

joerick commented Mar 7, 2024

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

@henryiii
Copy link
Contributor Author

henryiii commented Mar 8, 2024

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

@henryiii henryiii marked this pull request as ready for review March 11, 2024 01:35
Copy link
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?

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
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
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
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
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 merged commit 312cf15 into pypa:main Mar 21, 2024
20 checks passed
@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