mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-03-26 16:02:50 +01:00
75 lines
1.8 KiB
Plaintext
75 lines
1.8 KiB
Plaintext
maintainer="Hugo Osvaldo Barrera <hugo@whynothugo.nl>"
|
|
pkgname=ruff
|
|
pkgver=0.9.9
|
|
pkgrel=0
|
|
pkgdesc="Extremely fast Python linter"
|
|
url="https://github.com/astral-sh/ruff"
|
|
arch="all"
|
|
license="MIT"
|
|
makedepends="py3-gpep517 py3-maturin cargo py3-installer"
|
|
subpackages="
|
|
$pkgname-pyc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
py3-$pkgname:_python:noarch
|
|
"
|
|
source="https://github.com/astral-sh/ruff/archive/$pkgver/ruff-$pkgver.tar.gz"
|
|
# net: cargo
|
|
options="net"
|
|
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
# shadow git repo for tests
|
|
git init -q
|
|
|
|
# Avoid downloading a different toolchain on systems with rustup installed.
|
|
rm rust-toolchain.toml
|
|
|
|
cargo fetch --locked
|
|
}
|
|
|
|
build() {
|
|
gpep517 build-wheel \
|
|
--wheel-dir .dist \
|
|
--config-json '{"build-args": "--frozen"}' \
|
|
--output-fd 3 3>&1 >&2
|
|
|
|
./target/release/ruff generate-shell-completion bash > $pkgname.bash
|
|
./target/release/ruff generate-shell-completion fish > $pkgname.fish
|
|
./target/release/ruff generate-shell-completion zsh > $pkgname.zsh
|
|
|
|
# Update ruff.schema.json as the pre-built one is generated
|
|
# using the '--all-features' Cargo flag which we don't pass.
|
|
cargo dev generate-all
|
|
}
|
|
|
|
check() {
|
|
unset CI_PROJECT_DIR
|
|
|
|
cargo test --frozen --workspace --exclude ruff_benchmark
|
|
}
|
|
|
|
package() {
|
|
python3 -m installer -d "$pkgdir" \
|
|
.dist/*.whl
|
|
|
|
install -Dm644 $pkgname.bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/$pkgname
|
|
install -Dm644 $pkgname.fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/$pkgname.fish
|
|
install -Dm644 $pkgname.zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_$pkgname
|
|
}
|
|
|
|
_python() {
|
|
amove usr/lib/python3.12/site-packages/
|
|
}
|
|
|
|
sha512sums="
|
|
0144831cfee758f3d75df26e3e9cada1820e6e9cec7961fd8b8415496bd80a687066d192fe12f94fbd38b965aeac43a92327d10e21b8be412c16037f83996130 ruff-0.9.9.tar.gz
|
|
"
|