_name=django-webpack-loader
pkgname=python-django-webpack-loader
pkgver=3.2.4
pkgrel=1
pkgdesc="Transparently use webpack with django"
arch=(any)
url="https://github.com/django-webpack/django-webpack-loader"
license=('MIT License')
depends=('python-lxml' 'python-six' 'python-requests')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/django_webpack_loader-3.2.4.tar.gz")
sha256sums=('0a253113ea6b150403cd2de802e732872c1d5e3185f0ad4a7fac673c00ae5af2')

build() {
  cd "$srcdir/django_webpack_loader-3.2.4"
  python3 setup.py build
}

package() {
  cd "$srcdir/django_webpack_loader-3.2.4"
  python3 setup.py install --root=$pkgdir --optimize=1 --skip-build

  # make sure we don't install any world-writable or root-readable-only files
  # we shouldn't need to fix ownership as we extract tarballs as a non-root user
  # https://github.com/pypa/setuptools/issues/1328
  # https://github.com/LonamiWebs/Telethon/issues/1605
  chmod u=rwX,go=rX -R "$pkgdir"
  # make sure we don't install annoying files
  local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -rf "$pkgdir/$_site_packages/tests/"
}

