# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Butui Hu <hot123tea123@gmail.com>

pkgname=python-threadpoolctl
pkgver=3.4.0
pkgrel=2
pkgdesc="Python helpers to limit the number of threads used in native libraries that handle their own internal threadpool"
arch=('any')
url="https://github.com/joblib/threadpoolctl"
license=('BSD')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-flit-core')
source=("https://files.pythonhosted.org/packages/source/t/threadpoolctl/threadpoolctl-${pkgver}.tar.gz")
sha256sums=('f11b491a03661d6dd7ef692dd422ab34185d982466c49c8f98c8f716b5c93196')

build() {
  cd "$srcdir"/threadpoolctl-${pkgver}
  python -m build --wheel --no-isolation
}

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