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

Evangelos Foutras foutrelis at gemini.archlinux.org
Wed Dec 1 00:35:54 UTC 2021


    Date: Wednesday, December 1, 2021 @ 00:35:54
  Author: foutrelis
Revision: 1059089

archrelease: copy trunk to community-staging-any

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

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

Copied: python-black/repos/community-staging-any/PKGBUILD (from rev 1059088, python-black/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2021-12-01 00:35:54 UTC (rev 1059089)
@@ -0,0 +1,58 @@
+# 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.11b1
+pkgrel=2
+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-regex' '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")
+sha256sums=('a042adbb18b3262faad5aff4e834ff186bb893f95ba3a8013f09de1e5569def2')
+b2sums=('cf0bcca299a3f1739650c52c0e3d86ade9810a8d907083f77a5329c9458b7f74a0331a7a6fb48247e64b204722217611607a606832b0888480a5661857663d6d')
+
+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:set ts=2 sw=2 et:



More information about the arch-commits mailing list