From 217dcaacf2d5fbcb9e5ed09a3cb4deee4c15791f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 29 Feb 2024 22:05:11 -0500 Subject: [PATCH] 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 Signed-off-by: Sam James --- ...ruff-0.3.0.ebuild => ruff-0.3.0-r1.ebuild} | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) rename dev-util/ruff/{ruff-0.3.0.ebuild => ruff-0.3.0-r1.ebuild} (94%) 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 919b754790e7a..820d220acffd1 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=" 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}}