archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / python-apipkg / trunk / PKGBUILD
blob6366495fd2d5783d5069112d95971c4e5a4f0056
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=python-apipkg
4 pkgver=3.0.1
5 pkgrel=3
6 pkgdesc="Namespace control and lazy-import mechanism"
7 arch=('any')
8 license=('MIT')
9 url="https://github.com/pytest-dev/apipkg"
10 depends=('python')
11 makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs')
12 checkdepends=('python-pytest-runner')
13 source=("https://github.com/pytest-dev/apipkg/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
14 sha512sums=('89251f02a49b5191879bcf6e35c6a8755d6b29f1ca1c6061eab004385b11433ec86e2968ab23994c6a74515d6a673e445b3bcf8cbdd21b2ec644fcef0d19b419')
16 build() {
17   export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
19   cd apipkg-$pkgver
20   python -m build --wheel --no-isolation
23 check() {
24   local pytest_options=(
25     # NOTE: these tests are likely broken because of circular deps with python-py
26     --deselect test_apipkg.py::test_chdir_with_relative_imports_support_lazy_loading
27     --deselect test_apipkg.py::test_get_distribution_version
28   )
29   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
31   cd apipkg-$pkgver
32   python -m installer --destdir=test_dir dist/*.whl
33   export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
34   pytest -vv "${pytest_options[@]}"
37 package() {
38   cd apipkg-$pkgver
39   python -m installer --destdir="$pkgdir" dist/*.whl
40   install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/