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

pkgname=python-threadpoolctl
pkgver=3.5.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=('082433502dd922bf738de0d8bcc4fdcbf0979ff44c42bd40f5af8a282f6fa107')

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
}
