# Contributor: Sam Dodrill <shadowh511@gmail.com>
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-virtualenv
pkgver=20.28.0
pkgrel=0
pkgdesc="Virtual Python3 Environment builder"
url="https://virtualenv.pypa.io/en/latest/"
arch="noarch"
license="MIT"
depends="py3-platformdirs py3-distlib py3-filelock"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-hatch-vcs
	py3-wheel
	"
checkdepends="
	py3-flaky
	py3-pytest-env
	py3-pytest-mock
	py3-pytest-timeout
	py3-pytest-xdist
	py3-time-machine
	python3-dev
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-$pkgver.tar.gz"
builddir="$srcdir/virtualenv-$pkgver"
options="net" # fetches stuff during tests

replaces="py-virtualenv" # Backwards compatibility
provides="py-virtualenv=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto -v \
		-k "not test_can_build_c_extensions"
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6a66663af74a240b9ad1cd3170f765ea44aea5f013d63c996a66af4aa0ad4e56c2c38c4f51d43181ac55c6099363694478d7ef15b640c56f8f801d3cd318966e  virtualenv-20.28.0.tar.gz
"
