Skip to content

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

Merged
charliermarsh merged 2 commits into
astral-sh:mainfrom
jaraco:feature/honor-install-target-bin
May 16, 2024
Merged

charliermarsh merged 2 commits into
astral-sh:mainfrom
jaraco:feature/honor-install-target-bin

Conversation

@jaraco

@jaraco jaraco commented May 16, 2024 •

Copy link
Copy Markdown
Contributor

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

jaraco commented May 16, 2024

Copy link
Copy Markdown
Contributor Author

Windows test failures are reported in #11439.

@github-actions

github-actions Bot commented May 16, 2024 •

Copy link
Copy Markdown
Contributor

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.

@charliermarsh charliermarsh left a comment

Copy link
Copy Markdown
Member

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
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