summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4ac020ff89acf330f110b2e83a18068e5759f571 (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
39
40
41
42
43
44
45
46
47
48
49
50
# Maintainer: Blair Bonnett <blair dot bonnett at gmail dot com>

pkgname=jupyterhub-firstuseauthenticator
pkgdesc="Authenticator to help new users create a password on first JupyterHub login"
pkgver=1.1.0
pkgrel=1
url="https://github.com/jupyterhub/firstuseauthenticator"
license=('BSD-3-Clause')
arch=('any')

depends=(
  'jupyterhub'
  'python-bcrypt'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
)
checkdepends=(
  'python-pytest'
  'python-pytest-asyncio'
)

source=(
  "git+${url}.git#tag=$pkgver"
)
sha256sums=(
  'd8fa53b174038e4bb3993ada20255dd96f8932ca68c4bac8145f17948dce5327'
)

build() {
  cd firstuseauthenticator
  python -m build --no-isolation --wheel
}

check() {
  cd firstuseauthenticator
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer "dist/jupyterhub_firstuseauthenticator-$pkgver"*.whl
  test-env/bin/python -m pytest -v
}

package() {
  cd firstuseauthenticator
  python -m installer --destdir="$pkgdir" "dist/jupyterhub_firstuseauthenticator-$pkgver"*.whl
  install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 "README.md" "$pkgdir/usr/share/doc/$pkgname/README"
}