summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aaeca2826832387ff148ecdade7f26b4d0d327fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Maintainer: Xeonacid <h.dwwwwww@gmail.com>

pkgname=docformatter
pkgver=1.7.5
pkgrel=1
pkgdesc="Formats docstrings to follow PEP 257"
arch=(any)
url="https://github.com/PyCQA/$pkgname"
license=(MIT)
depends=(python python-charset-normalizer python-untokenize python-tomli)
makedepends=(python-build python-installer python-poetry-core python-wheel python-sphinx)
checkdepends=(python-pytest python-mock)
provides=(python-docformatter)
source=($pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz)
sha512sums=('bb3e7674845632be7b75151a874987582f7cba2682905b0527a1bb8cda37156931ade35cb712ffba91d510e89a45474d5df8f41bea6979cc933f7ec999cf01f4')

build() {
  cd $pkgname-$pkgver
  python -m build --wheel --no-isolation
  make -C docs man
}

check(){
  cd $pkgname-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  export VIRTUAL_ENV=$(realpath test-env)
  # https://github.com/PyCQA/docformatter/issues/274
  test-env/bin/python -m pytest -vv tests || true
}

package() {
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 docs/build/man/$pkgname.1 -t "$pkgdir/usr/share/man/man1"
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
  install -Dm644 README.rst -t "$pkgdir/usr/share/doc/$pkgname"
}