mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-08 18:22:30 +01:00
62 lines
1.6 KiB
Plaintext
62 lines
1.6 KiB
Plaintext
# Maintainer: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
|
|
pkgname=ruff
|
|
pkgver=0.0.275
|
|
pkgrel=1
|
|
pkgdesc="Extremely fast Python linter"
|
|
url="https://github.com/charliermarsh/ruff"
|
|
# ppc64le, s390x, riscv64: ring
|
|
# x86, armhf, armv7: fails tests on 32-bit
|
|
arch="all !x86 !armhf !armv7 !ppc64le !s390x !riscv64"
|
|
license="MIT"
|
|
makedepends="py3-gpep517 py3-maturin cargo py3-installer"
|
|
subpackages="
|
|
$pkgname-pyc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="https://github.com/charliermarsh/ruff/archive/v$pkgver/ruff-$pkgver.tar.gz"
|
|
options="net" # cargo
|
|
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL=2
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
# shadow git repo for tests
|
|
git init -q
|
|
|
|
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
|
|
}
|
|
|
|
check() {
|
|
cargo test --frozen
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
sha512sums="
|
|
f2373b821596f5abf226a03562ad4bd49483c439009cf197a3aa971c1608bcba85d6d301a5a8ee559790504a37646000a876d92f48128dd5941712dcb50a7cbd ruff-0.0.275.tar.gz
|
|
"
|