# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>

pkgname=python-oslo-config
pkgver=9.5.0
pkgrel=1
pkgdesc="parsing command line arguments and .ini style configuration files"
arch=('any')
url="https://pypi.python.org/pypi/oslo.config/$pkgver"
license=('Apache')
depends=('python-debtcollector' 'python-netaddr' 'python-stevedore'
         'python-oslo-i18n' 'python-rfc3986' 'python-yaml' 'python-requests')
optdepends=('python-sphinx: for rst-generator')
makedepends=('git' 'python-pbr' 'python-setuptools')
checkdepends=('python-testscenarios' 'python-stestr' 'python-testtools' 'python-oslotest'
              'python-oslo-log' 'python-requests-mock' 'python-sphinx')
options=('!emptydirs')
source=("git+https://github.com/openstack/oslo.config.git#tag=$pkgver")
sha512sums=('500683bcda10983bceba038711169da5e1d24bfa3d85b2a0f0c22d50d48ac8e1ca7e6290192a5022dee2975d565f6a80c4c8096115e7940d4ecb1bbeb7e8a7eb')

prepare() {
  cd oslo.config
  # Fix test_sub_command_multiple on Python 3.12.5+
  git cherry-pick -n 972d304bb23baef538ce759004410a20d8109ccb
}

build() {
  cd oslo.config
  python setup.py build
}

check() {
  cd oslo.config
  stestr run
}

package() {
  cd oslo.config
  python setup.py install --root="$pkgdir/" --optimize=1
}

# vim:set ts=2 sw=2 et:
