summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f3a89db8edcad495d9900f61d08b59b2a938fdbb (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
51
52
53
54
55
56
# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>

pkgname=python-environ-config
_name=${pkgname#python-}
pkgver=24.1.0
pkgrel=1
pkgdesc="Python Application Configuration With Environment Variables"
arch=(any)
url="https://github.com/hynek/environ-config"
license=(Apache-2.0)
depends=(
  python
  python-attrs
)
makedepends=(
  python-build
  python-hatch-fancy-pypi-readme
  python-hatch-vcs
  python-installer
  python-wheel
)
checkdepends=(
  python-moto
  python-pytest
)
optdepends=('python-boto3: secret extraction from AWS Secrets Manager')

source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('f90fb07cdbfaa3ef26293197a59bbf3f63aa11c4c0058138283bca40b7fe1545')

_archive="$_name-$pkgver"

build() {
  cd "$_archive"

  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd "$_archive"

  rm -rf tmp_install
  python -m installer --destdir=tmp_install dist/*.whl

  _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  export PYTHONPATH="$PWD/tmp_install/$_site_packages:$PYTHONPATH"
  pytest \
    --deselect tests/test_packaging.py::TestLegacyMetadataHack
}

package() {
  cd "$_archive"

  python -m installer --destdir="$pkgdir" dist/*.whl
}