# Maintainer: Andrew Crerar <crerar@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Hideaki Takahashi <mymelo+aur@gmail.com>
# Contributor: Vincent Demeester <vincent@sbr.io>
# Contributor: Josh VanderLinden <arch@cloudlery.com>

pkgname=python-docker
pkgver=7.1.0
pkgrel=3
pkgdesc="A Python library for the Docker Engine API"
arch=('any')
url="https://github.com/docker/docker-py"
license=("Apache-2.0")
depends=('python-packaging' 'python-requests' 'python-urllib3' 'python-websocket-client')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-setuptools-scm' 'python-wheel'
             'python-hatchling' 'python-hatch-vcs')
checkdepends=('flake8' 'python-coverage' 'python-paramiko' 'python-pytest'
'python-pytest-timeout')
optdepends=('python-paramiko: for connections using the SSH protocol')
provides=('python-docker-py')
conflicts=('python-docker-py')
replaces=('python-docker-py')
source=("$pkgname-$pkgver.tar.gz::https://github.com/docker/docker-py/archive/$pkgver.tar.gz")
b2sums=('82eba285c1ea61956005dd0a9bfb66864fd30119a4b4c384d0d4350edeb331004d66bcdba6f20ec56ff48590b4a29a7b0fb07c6db6ecadfe96830337c37a535a')

build() {
  cd docker-py-"$pkgver"
  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd docker-py-"$pkgver"
  pytest tests/unit
}

package() {
  cd docker-py-"$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
}
