Update the Python module (notably find_ruff_bin) for parity with uv#23406
Merged
Update the Python module (notably find_ruff_bin) for parity with uv#23406
find_ruff_bin) for parity with uv#23406Conversation
find_ruff_bin for parity with find_uv_binfind_ruff_bin) for parity with uv
457ebfd to
1e42d4f
Compare
zanieb
commented
Feb 18, 2026
Comment on lines
-38
to
-43
| # Search for pip-specific build environments. | ||
| # | ||
| # Expect to find ruff in <prefix>/pip-build-env-<rand>/overlay/bin/ruff | ||
| # Expect to find a "normal" folder at <prefix>/pip-build-env-<rand>/normal | ||
| # | ||
| # See: https://github.com/pypa/pip/blob/102d8187a1f5a4cd5de7a549fd8a9af34e89a54f/src/pip/_internal/build_env.py#L87 |
Member
Author
There was a problem hiding this comment.
I started porting this over to uv then noticed we support it already
|
ntBre
approved these changes
Feb 19, 2026
python/ruff/__main__.py
Outdated
|
|
||
| ruff_exe = "ruff" + sysconfig.get_config_var("EXE") | ||
| def _run() -> None: | ||
| ruff = os.fsdecode(find_ruff_bin()) |
Contributor
There was a problem hiding this comment.
I think this is fine either way, but we did have a previous PR removing the os.fsdecode call: #18551.
Member
Author
There was a problem hiding this comment.
mm nice, let me apply that everywhere
1e42d4f to
2b7451a
Compare
knutwannheden
pushed a commit
to openrewrite/ruff
that referenced
this pull request
Feb 20, 2026
…astral-sh#23406) Closes astral-sh/uv#14874 Closes astral-sh#23402 uv has fairly extensive test coverage for this functionality but it seems challenging to copy it over My smoke test strategy was to ask an LLM to build the wheel and test all of the cases ``` $ uv build --wheel Building wheel... Successfully built dist/ruff-0.15.1-py3-none-macosx_11_0_arm64.whl $ WHEEL=dist/ruff-0.15.1-py3-none-macosx_11_0_arm64.whl $ uv venv -q .smoke-venv && uv pip install -q --python .smoke-venv $WHEEL $ .smoke-venv/bin/python -c "from ruff import find_ruff_bin; print(find_ruff_bin())" /Users/zb/workspace/ruff/.smoke-venv/bin/ruff $ .smoke-venv/bin/python -m ruff version ruff 0.15.1+81 (1e42d4f 2026-02-18) $ uv run --no-project --with $WHEEL -- python -c "from ruff import find_ruff_bin; print(find_ruff_bin())" /Users/zb/.cache/uv/archive-v0/zf7_vNji2jmEGEDox-9Vj/bin/ruff $ uv run --no-project --with $WHEEL -- python -m ruff version ruff 0.15.1+81 (1e42d4f 2026-02-18) $ uv pip install --target .smoke-target $WHEEL $ PYTHONPATH=.smoke-target python3 -c "from ruff import find_ruff_bin; print(find_ruff_bin())" /Users/zb/workspace/ruff/.smoke-target/bin/ruff $ uv pip install --prefix .smoke-prefix $WHEEL $ PYTHONPATH=.smoke-prefix/lib/python3.14/site-packages python3 -c "from ruff import find_ruff_bin; print(find_ruff_bin())" /Users/zb/workspace/ruff/.smoke-prefix/bin/ruff $ python3 -m pip install --user --break-system-packages $WHEEL $ python3 -c "from ruff import find_ruff_bin; print(find_ruff_bin())" /Users/zb/Library/Python/3.13/bin/ruff $ python3 -m ruff version ruff 0.15.1+81 (1e42d4f 2026-02-18) ```
zanieb
added a commit
to astral-sh/ty
that referenced
this pull request
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes astral-sh/uv#14874
Closes #23402
uv has fairly extensive test coverage for this functionality but it seems challenging to copy it over
My smoke test strategy was to ask an LLM to build the wheel and test all of the cases