[arch-commits] Commit in python-black/repos (2 files)

Daniel M. Capella polyzen at gemini.archlinux.org
Thu Jan 13 03:34:16 UTC 2022


    Date: Thursday, January 13, 2022 @ 03:34:16
  Author: polyzen
Revision: 1101784

archrelease: copy trunk to community-testing-any

Added:
  python-black/repos/community-testing-any/
  python-black/repos/community-testing-any/PKGBUILD
    (from rev 1101783, python-black/trunk/PKGBUILD)

----------+
 PKGBUILD |   68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

Copied: python-black/repos/community-testing-any/PKGBUILD (from rev 1101783, python-black/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD	                        (rev 0)
+++ community-testing-any/PKGBUILD	2022-01-13 03:34:16 UTC (rev 1101784)
@@ -0,0 +1,68 @@
+# Maintainer: Maxim Baz <$pkgname at maximbaz dot com>
+# Maintainer: Daniel M. Capella <polyzen at archlinux.org>
+# Contributor: James Zhu <jameszhu at berkeley.edu>
+
+pkgname=python-black
+pkgver=21.12b0
+pkgrel=4
+pkgdesc='Uncompromising Python code formatter'
+arch=('any')
+url=https://github.com/psf/black
+license=('MIT')
+depends=('python' 'python-click' 'python-mypy_extensions' 'python-pathspec'
+         'python-platformdirs' 'python-tomli' 'python-typing_extensions')
+makedepends=('python-build' 'python-install' 'python-setuptools-scm'
+             'python-wheel')
+checkdepends=('ipython' 'python-aiohttp' 'python-parameterized' 'python-pytest'
+              'python-typed-ast' 'python-tokenize-rt')
+optdepends=('ipython: for Jupyter notebook support'
+            'python-tokenize-rt: for Jupyter notebook support'
+            'python-aiohttp: for the blackd HTTP server'
+            'python-colorama: for colored diffs'
+            'python-typed-ast: to format Python 2 code')
+source=("https://files.pythonhosted.org/packages/source/b/black/black-$pkgver.tar.gz"
+        'black-tomli2-compat.patch::https://github.com/psf/black/commit/389e9c23a9e622ee6090d902cc5f56c5f76cdee9.patch')
+sha256sums=('77b80f693a569e2e527958459634f18df9b0ba2625ba4e0c2d5da5be42e6f2b3'
+            '72c9e6bd7576d1dbe38e2344f02efc28a0232c17b28634065adcf5b0df0d36fb')
+b2sums=('95a00f89ba76a49050a5699531dac54fb08023337b69ee6c65eadf36e29e8389a7546dadb0e8a9e64e31ee551b22822ecc2507f3f57a816589784689114c567e'
+        '8ed3f7fbeee76ed60b78d7502e89c6067448842dd733a02775dd6e1c06989300760766a12019d041d3bf4419135c8d85027d86e60647d9529e1590bf2fd5a6b9')
+
+prepare() {
+  cd "black-$pkgver"
+  patch --forward --strip=1 --input=../black-tomli2-compat.patch || true
+}
+
+build() {
+  cd "black-$pkgver"
+  python -m build --wheel --skip-dependency-check --no-isolation
+}
+
+check() {
+  cd "black-$pkgver"
+  python -m venv --system-site-packages test-env
+  test-env/bin/python -m install --optimize=1 dist/*.whl
+  chmod +x test-env/bin/black # https://github.com/FFY00/python-install/pull/6
+  PATH="$PWD/test-env/bin:$PATH" test-env/bin/python -m pytest --run-optional no_python2
+}
+
+package() {
+  cd "black-$pkgver"
+  python -m install --optimize=1 --destdir="$pkgdir" dist/*.whl
+
+  # https://github.com/FFY00/python-install/issues/7
+  sed -i 's/patched_main \[d]/patched_main/' "$pkgdir"/usr/bin/blackd
+
+  # https://github.com/FFY00/python-install/pull/6
+  chmod +x "$pkgdir"/usr/bin/*
+
+  # Symlink license file
+  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+  install -d "$pkgdir"/usr/share/licenses/$pkgname
+  ln -s "$site_packages"/black-$pkgver.dist-info/LICENSE \
+    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+
+  # vim plugin
+  install -Dm644 plugin/black.vim "$pkgdir/usr/share/vim/vimfiles/plugin/black.vim"
+}
+
+# vim:set ts=2 sw=2 et:



More information about the arch-commits mailing list