mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-09 18:47:16 -08:00
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@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -5,9 +5,6 @@
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
DISTUTILS_USE_PEP517=maturin
|
||||
|
||||
CRATES="
|
||||
Inflector@0.11.4
|
||||
adler@1.0.2
|
||||
@@ -363,7 +360,7 @@ CRATES="
|
||||
zeroize@1.7.0
|
||||
"
|
||||
|
||||
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}}
|
||||
Reference in New Issue
Block a user