mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-06-06 19:14:48 +02:00
62 lines
1.9 KiB
Text
62 lines
1.9 KiB
Text
# Contributor: Michał Polański <michal@polanski.me>
|
|
# Maintainer: Michał Polański <michal@polanski.me>
|
|
pkgname=black
|
|
pkgver=25.1.0
|
|
pkgrel=0
|
|
pkgdesc="The uncompromising Python code formatter"
|
|
url="https://github.com/psf/black"
|
|
license="MIT"
|
|
arch="noarch"
|
|
depends="py3-click py3-mypy-extensions py3-packaging py3-pathspec py3-platformdirs py3-typed-ast"
|
|
makedepends="bash py3-gpep517 py3-hatchling py3-hatch-vcs py3-wheel"
|
|
checkdepends="py3-pytest py3-parameterized py3-aiohttp"
|
|
subpackages="
|
|
$pkgname-pyc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="https://files.pythonhosted.org/packages/source/b/black/black-$pkgver.tar.gz
|
|
remove-fancy-pypi-readme.patch
|
|
"
|
|
|
|
# secfixes:
|
|
# 24.3.0-r0:
|
|
# - CVE-2024-21503
|
|
|
|
build() {
|
|
gpep517 build-wheel \
|
|
--wheel-dir .dist \
|
|
--output-fd 3 3>&1 >&2
|
|
|
|
python3 -m venv --clear --without-pip --system-site-packages venv
|
|
./venv/bin/python3 -m installer \
|
|
.dist/black-$pkgver-py3-none-any.whl
|
|
|
|
for cmd in black blackd; do
|
|
_BLACK_COMPLETE=bash_source ./venv/bin/black > $cmd.bash
|
|
_BLACK_COMPLETE=fish_source ./venv/bin/black > $cmd.fish
|
|
_BLACK_COMPLETE=zsh_source ./venv/bin/black > $cmd.zsh
|
|
done
|
|
}
|
|
|
|
check() {
|
|
ulimit -n 4096 # prevent running out of file descriptors
|
|
./venv/bin/python3 -m pytest
|
|
}
|
|
|
|
package() {
|
|
python3 -m installer -d "$pkgdir" \
|
|
.dist/black-$pkgver-py3-none-any.whl
|
|
|
|
for cmd in black blackd; do
|
|
install -Dm644 $cmd.bash "$pkgdir"/usr/share/bash-completion/completions/$cmd
|
|
install -Dm644 $cmd.fish "$pkgdir"/usr/share/fish/vendor_completions.d/$cmd.fish
|
|
install -Dm644 $cmd.zsh "$pkgdir"/usr/share/zsh/site-functions/_$cmd
|
|
done
|
|
}
|
|
|
|
sha512sums="
|
|
57281a678d322aaf0f2b7059aa59ad65055cb6999b8fc22ead115011d1b2e607d5cc91880369ee93a438bc266d7ebd371cd046f12d41a83383577f36a6211844 black-25.1.0.tar.gz
|
|
3ccba63a17589e5f127ee325531022256665a26657ba59d1c505aac6cb89443f147af28d74f77e9b42dbe236b2f0fcdd744fa75b6cd1a8a37a767da6fe6d5694 remove-fancy-pypi-readme.patch
|
|
"
|