archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-tokenize-rt / trunk / PKGBUILD
blob108ab4ecfc4cb7397a79b5f6c2bd123cf10e9499
1 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
3 _name=tokenize-rt
4 pkgname=python-tokenize-rt
5 pkgver=5.0.0
6 pkgrel=2
7 pkgdesc='Wrapper around the stdlib `tokenize` which roundtrips'
8 arch=('any')
9 url=https://github.com/asottile/tokenize-rt
10 license=('MIT')
11 depends=('python')
12 makedepends=('python-build' 'python-installer' 'python-setuptools'
13              'python-wheel')
14 checkdepends=('python-pytest')
15 source=("$url/archive/v$pkgver/$_name-$pkgver.tar.gz")
16 b2sums=('d5e5dd3637615c451463d85e63b6d48670ed18de58e111625b106cfc0af2616726d2ff510412decd32db2c67dea5807d5f9b64ecfa902f56fd32b739085698c3')
18 build() {
19   cd $_name-$pkgver
20   python -m build --wheel --skip-dependency-check --no-isolation
23 check() {
24   cd $_name-$pkgver
25   python -m venv --system-site-packages test-env
26   test-env/bin/python -m installer dist/*.whl
27   test-env/bin/python -m pytest
30 package() {
31   cd $_name-$pkgver
32   python -m installer --destdir="$pkgdir" dist/*.whl
34   # Symlink license file
35   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
36   install -d "$pkgdir"/usr/share/licenses/$pkgname
37   ln -s "$site_packages"/tokenize_rt-$pkgver.dist-info/LICENSE \
38     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE