# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-rope
pkgver=1.13.0
pkgrel=1
pkgdesc="Python refactoring library"
url="https://github.com/python-rope/rope"
arch="noarch"
license="LGPL-3.0-only"
depends="py3-pytoolconfig py3-setuptools"
makedepends="
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-build
	py3-pip
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-rope/rope/archive/refs/tags/$pkgver.tar.gz"
options="net" # required for tests
builddir="$srcdir/rope-$pkgver"

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
	# test_search_submodule fails to find env from py3-build
	.testenv/bin/python3 -m pytest -k 'not test_search_submodule'
}

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

sha512sums="
fae1555570997164d14ae8a6541750544b14c2aefd49e77d45585e47550a3c62c734bdfa28cbdcbcaa4c4d3c7a6a0ecf6ff3c116c47d2888ba71c311fe424157  py3-rope-1.13.0.tar.gz
"
