commit: 217dcaacf2d5fbcb9e5ed09a3cb4deee4c15791f
Author: Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Fri Mar 1 03:05:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 14 06:39:43 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=217dcaac
dev-util/ruff: install as a standard cargo project
The python module has no functionality. It can be used solely as:
```
python3.11 -m ruff
```
in which case it will check for sys.prefix + '/bin/ruff' and try to run
it.
The downside of trying to install it as a python project is that it:
- adds fuzzy USE flags on python version
- recompiles everything once per python impl, despite attempts at
copying sources around
- adds extra dependencies on e.g. maturin
- generally complicates the ebuild
We don't need any of that since this is just a cargo program.
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../{ruff-0.3.0.ebuild => ruff-0.3.0-r1.ebuild} | 25 +---------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/dev-util/ruff/ruff-0.3.0.ebuild
b/dev-util/ruff/ruff-0.3.0-r1.ebuild
similarity index 94%
rename from dev-util/ruff/ruff-0.3.0.ebuild
rename to dev-util/ruff/ruff-0.3.0-r1.ebuild
index 919b754790e7..820d220acffd 100644
--- a/dev-util/ruff/ruff-0.3.0.ebuild
+++ b/dev-util/ruff/ruff-0.3.0-r1.ebuild
@@ -5,9 +5,6 @@
EAPI=8
-PYTHON_COMPAT=( python3_{10..12} )
-DISTUTILS_USE_PEP517=maturin
-
CRATES="
[email protected]
[email protected]
@@ -363,7 +360,7 @@ CRATES="
[email protected]
"
-inherit distutils-r1 cargo
+inherit cargo
DESCRIPTION="An extremely fast Python linter, written in Rust"
HOMEPAGE="
@@ -418,18 +415,6 @@ DOCS=(
docs
)
-src_prepare() {
- sed -r 's:(strip[[:space:]]*=[[:space:]]*)true:\1false:' \
- -i pyproject.toml || die
-
- default
-
- # python_copy_sources is called in src_compile after cargo_src_compile
- # to avoid rebuilding rust code for each python impl
-
- rm -rf docs/{.overrides,gitignore} || die
-}
-
src_configure() {
export RUSTFLAGS="${RUSTFLAGS}"
cargo_src_configure
@@ -438,9 +423,6 @@ src_configure() {
src_compile() {
cargo_src_compile
- python_copy_sources
- distutils-r1_src_compile
-
local solib releasedir
releasedir=target/$(usex 'debug' 'debug' 'release')
@@ -453,12 +435,7 @@ src_test() {
cargo_src_test
}
-# placeholder to silence QA warning, tests are in rust
-python_test() { :; }
-
src_install() {
- distutils-r1_src_install
-
local releasedir=target/$(usex 'debug' 'debug' 'release')
dobin ${releasedir}/ruff{,_{dev,python_formatter,shrinking}}