mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-02 07:11:47 +01:00
69 lines
1.7 KiB
Plaintext
69 lines
1.7 KiB
Plaintext
# Maintainer: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
|
|
pkgname=ruff
|
|
pkgver=0.1.6
|
|
pkgrel=0
|
|
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"
|
|
# net: cargo
|
|
options="net"
|
|
|
|
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
|
|
|
|
# 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
|
|
}
|
|
|
|
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="
|
|
fab99eff9c05f197d3dea98cbf0d3273f362b88079c29cae4f98da900af055a2bfa8fb636eedd06319d44f4f3737848b40e42d97aafb65ac20030670f6201d15 ruff-0.1.6.tar.gz
|
|
"
|