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

Locate ruff executable in 'bin' directory as installed by 'pip install --target'. #11450

Merged
merged 2 commits into from
May 16, 2024

Conversation

jaraco
Copy link
Contributor

@jaraco jaraco commented May 16, 2024

Fixes #11246

Summary

This change adds an intermediate additional search path for find_ruff_bin.

I would have added this path as the last one, except that the last one is the one reported to the user, so I made this one second to last.

Test Plan

It's shown to work with this command:

 ~ @ pip-run git+https://github.com/jaraco/ruff@feature/honor-install-target-bin -- -m ruff --version
ruff 0.4.4

I tried running the same command on Windows, which should work in theory, but building ruff from source on Windows is complicated. Even after installing Rust, ruff fails to build when libmimalloc-sys fails to build because gcc isn't installed (and the error message points to a broken anchor). I was really hoping Rust would get us away from the Windows as second-class-citizen model :(.

@jaraco
Copy link
Contributor Author

jaraco commented May 16, 2024

Windows test failures are reported in #11439.

Copy link
Contributor

github-actions bot commented May 16, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+2 -0 violations, +0 -0 fixes in 1 projects; 43 projects unchanged)

python/typeshed (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select E,F,FA,I,PYI,RUF,UP,W

+ stdlib/typing.pyi:326:10: PYI001 Name of private `TypeVar` must start with `_`
+ stdlib/typing.pyi:805:1: PYI042 Type alias `_get_type_hints_obj_allowed_types` should be CamelCase

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PYI001 1 1 0 0 0
PYI042 1 1 0 0 0

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

👍 Thanks. I moved it back to last and decided to use the sysconfig.get_path("scripts") path for the error.

@charliermarsh charliermarsh enabled auto-merge (squash) May 16, 2024 16:04
@charliermarsh charliermarsh merged commit 42b655b into astral-sh:main May 16, 2024
15 of 16 checks passed
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.

Can't run ruff when installed with pip target dir option
2 participants