1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
6 pkgdesc="Namespace control and lazy-import mechanism"
9 url="https://github.com/pytest-dev/apipkg"
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')
17 export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
20 python -m build --wheel --no-isolation
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
29 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
32 python -m installer --destdir=test_dir dist/*.whl
33 export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
34 pytest -vv "${pytest_options[@]}"
39 python -m installer --destdir="$pkgdir" dist/*.whl
40 install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/