# Contributor: Dirk Stolle

_realname=requests
pkgname=python-${_realname}
pkgver=2.32.5
pkgrel=1
pkgdesc='Python HTTP library for humans'
arch=('any')
url='https://requests.readthedocs.io/'
msys2_repository_url='https://github.com/psf/requests'
msys2_references=(
  'cpe: cpe:/a:python:requests'
  'cygwin: python-requests'
  'purl: pkg:pypi/requests'
)
license=('spdx:Apache-2.0')
depends=(
  'python'
  'python-certifi'
  'python-charset-normalizer'
  'python-idna'
  'python-urllib3'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf')

build() {
  cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "python-build-${MSYSTEM}"

  python -m installer --prefix=${MSYSTEM_PREFIX} --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE "${pkgdir}${MSYSTEM_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
