Skip to content

Conversation

@Avasam
Copy link
Collaborator

@Avasam Avasam commented Oct 26, 2025

uv is a fast and modern replacement for setup-python, pip, build, venv, twine1, made by the same folks as Ruff.
I've been using uv for over a year and it's a game-changer for packaging and environment management. Being Windows-only and having no runtime dependencies, pywin32 is pretty simple, but we can still benefit from a pretty significant speedup.

In the times below, I omitted the slowest and fastest times in a job matrix as outliers. The exact time save is hard to say, but the trend is clear:

  • The CI step of installing Python (all jobs except native builds) goes from (sometimes2) 50-60s down to 6-14.
  • The CI step of installing build for cross-compilations goes from 3-14s down to 0 (no need to install extra dep)
  • The CI step of installing checkers dependencies from ~9s down to ~2s
  • The CI step of installing type-checkers dependencies from 37-44s down to ~3s

Footnotes

  1. Whilst uv publish can be used to replace twine for publishing, there are no changes needed to your current workflow and you can keep using twine as you were.

  2. Most of the time, the actions/setup-python step takes 6-18s, which would be equivalent, but it also sometimes randomly take around a minute for unknown reasons.

Comment on lines -41 to -42
cache: pip
cache-dependency-path: .github/workflows/main.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There already was nothing to cache here.

I also kept setup-python to keep testing in a global user install (this can still be done with uv if you pre-install Python, but at this point having actions/setup-python + astral-sh/setup-uv wouldn't bring any benefit for this step if there's no dependency to quickly install.


- name: Build wheels
run: python -m build --wheel --config-setting=--build-option=build_ext --config-setting=--build-option=-L.\arm64libs --config-setting=--build-option=--plat-name=win-arm64 --config-setting=--build-option=build --config-setting=--build-option=--plat-name=win-arm64 --config-setting=--build-option=bdist_wheel --config-setting=--build-option=--plat-name=win-arm64
run: uv build --wheel --config-setting=--build-option=build_ext --config-setting=--build-option=-L.\arm64libs --config-setting=--build-option=--plat-name=win-arm64 --config-setting=--build-option=build --config-setting=--build-option=--plat-name=win-arm64 --config-setting=--build-option=bdist_wheel --config-setting=--build-option=--plat-name=win-arm64
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This command is further simplified in #2583

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.

1 participant