summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e3ec0085fea7748889e2b58e06ec67bfe6401ceb (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
# Maintainer: Patrick Armengol <patrickarmengol AT protonmail DOT com>

_name=hatchling
pkgname=python-hatchling-git
pkgver=v1.11.1.r43.g15a583af
pkgrel=1
pkgdesc="Modern, extensible Python build backend"
arch=('any')
url="https://github.com/pypa/hatch"
license=('MIT')
groups=()
depends=('python-editables' 'python-packaging' 'python-pathspec' 'python-pluggy' 'python-tomli')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest')
optdepends=()
provides=('python-hatchling')
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("hatch::git+$url.git")  # just download the whole thing lmao
# source=("svn+$url/trunk/backend")  # depends on svn instead of git
noextract=()
sha256sums=('SKIP')

pkgver() {
  cd "hatch"
  git describe --long --tags --match "hatchling*" --candidates 100 | sed 's/^hatchling-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "hatch/backend"
  python -m build --wheel --no-isolation
}

# check() {
#   cd "hatch/backend"
#   PYTHONPATH="$PWD/src" pytest
# }

package() {
  cd "hatch/backend"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
}