# Maintainer:

_pkgname=socksio
pkgname=python-$_pkgname
pkgver=1.0.0
pkgrel=4
pkgdesc='Sans-I/O implementation of SOCKS4, SOCKS4A, and SOCKS5'
arch=(any)
url='https://github.com/sethmlarson/socksio'
license=(BSD)
depends=(python)
makedepends=(python-flit-core python-build python-installer python-wheel)
checkdepends=(python-pytest-cov)
source=(https://pypi.python.org/packages/source/${_pkgname:0:1}/${_pkgname/-/_}/${_pkgname/-/_}-${pkgver}.tar.gz)
sha256sums=('f88beb3da5b5c38b9890469de67d0cb0f9d494b78b106ca1845f96c10b91c4ac')

prepare() {
  cd $_pkgname-$pkgver
  sed -i 's#>=2,<3##' pyproject.toml
}

build() {
  cd $_pkgname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pkgname-$pkgver
  PYTHONPATH="$PWD" pytest
}

package() {
  cd $_pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
