aboutsummaryrefslogtreecommitdiffstats
path: root/community/black/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/black/APKBUILD')
-rw-r--r--community/black/APKBUILD63
1 files changed, 45 insertions, 18 deletions
diff --git a/community/black/APKBUILD b/community/black/APKBUILD
index e24218a86d9..fbe1d4811d2 100644
--- a/community/black/APKBUILD
+++ b/community/black/APKBUILD
@@ -1,35 +1,62 @@
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=black
-pkgver=20.8_beta1
-_pkgver=${pkgver/_beta/b}
+pkgver=24.3.0
pkgrel=0
pkgdesc="The uncompromising Python code formatter"
url="https://github.com/psf/black"
-arch="noarch !s390x !mips !mips64" # tests fail on s390x and mips
license="MIT"
-depends="python3 py3-click py3-attrs py3-toml py3-appdirs py3-typed-ast py3-regex
- py3-pathspec py3-typing-extensions py3-mypy-extensions"
-makedepends="py3-setuptools"
-checkdepends="py3-aiohttp py3-aiohttp-cors"
-source="https://files.pythonhosted.org/packages/source/b/black/black-$_pkgver.tar.gz"
-builddir="$srcdir/$pkgname-$_pkgver"
+arch="noarch"
+depends="python3 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() {
- python3 setup.py 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() {
- # temporary installation for testing
- python3 setup.py install --root="$PWD"/test_install --skip-build
-
- PATH="$PWD/test_install/usr/bin:$PATH" \
- PYTHONPATH="$(echo $PWD/test_install/usr/lib/python3*/site-packages)" \
- python3 -m unittest tests/test_black.py
+ ulimit -n 2048 # prevent running out of file descriptors
+ ./venv/bin/python3 -m pytest
}
package() {
- python3 setup.py install --root="$pkgdir" --skip-build
+ 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="f047c2a1ce759a8e19eed2e1869752bb8a63bf17a554aff5d9e834a48cd390b23918b78e01d5c36c0fb7599439d7e422847bde504ff698d53df5c5939a8870d2 black-20.8b1.tar.gz"
+sha512sums="
+57e3b651009578f1d15b6e9ffb49d24be80885b2cf7ad48a68407862778ac2099d119e7ba6d58ddea4fc7fc21345435a7572a970baf882f763d9347868d5504b black-24.3.0.tar.gz
+3ccba63a17589e5f127ee325531022256665a26657ba59d1c505aac6cb89443f147af28d74f77e9b42dbe236b2f0fcdd744fa75b6cd1a8a37a767da6fe6d5694 remove-fancy-pypi-readme.patch
+"