python-requests fix check depends

added linecache2, traceback2 and unittest2
fixed pbr python2 package
This commit is contained in:
AlmAck 2017-11-06 23:10:01 +01:00
parent 92251de85a
commit 89e393f2b7
9 changed files with 188 additions and 23 deletions

View File

@ -4,7 +4,7 @@
pkgbase=python-distutils-extra
pkgname=('python3-distutils-extra' 'python2-distutils-extra')
pkgver=2.39
pkgrel=3
pkgrel=4
pkgdesc='Enhancements to the Python build system'
arch=('x86_64')
license=('GPL')

View File

@ -2,38 +2,54 @@
pkgbase=python-pbr
pkgname=(python3-pbr python2-pbr)
pkgver=3.1.1
pkgrel=1
pkgrel=2
pkgdesc="Python Build Reasonableness"
arch=('any')
url=https://pypi.python.org/pypi/pbr
license=(Apache)
makedepends=(python2-setuptools python3-setuptools git)
source=("$pkgbase-$pkgver.tar.gz::https://github.com/openstack-dev/pbr/archive/$pkgver.tar.gz")
sha256sums=('cf742ca9b8e28fff579cc2d6d7be740a43679b2fba5603627ea7881c5d663ad5')
prepare() {
cp -a ${pkgname#*-}-$pkgver python2-pbr-$pkgver
find python2-pbr-$pkgver -name \*.py -exec sed -i '1s/python$/&2/' {} +
cp -a pbr-$pkgver{,-py2}
find pbr-$pkgver-py2 -name \*.py -exec sed -i '1s/python$/&2/' {} +
export PBR_VERSION=$pkgver
}
build() {
export SKIP_PIP_INSTALL=1
cd ${pkgname#*-}-$pkgver/
python3 setup.py build
cd $srcdir/python2-pbr-$pkgver
python2 setup.py build
cd "$srcdir"/pbr-$pkgver
python3 setup.py build
cd "$srcdir"/pbr-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/pbr-$pkgver
python3 setup.py testr || warning "Tests failed"
cd "$srcdir"/pbr-$pkgver-py2
PYTHON=python2 python2 setup.py testr || warning "Tests failed"
}
package_python3-pbr() {
cd ${pkgname#*-}-$pkgver/
depends=(python3-pip)
python3 setup.py install --prefix=/usr --root="$pkgdir"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
depends=('python3-setuptools')
cd pbr-$pkgver
python3 setup.py install -O1 --root="$pkgdir"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-pbr() {
cd $pkgname-$pkgver/
depends=(python2-pip)
python2 setup.py install --prefix=/usr --root="$pkgdir"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
mv $pkgdir/usr/bin/pbr{,2}
depends=('python2-setuptools')
cd pbr-$pkgver-py2
python2 setup.py install -O1 --root="$pkgdir"
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
mv "$pkgdir"/usr/bin/pbr{,2}
}

View File

@ -0,0 +1,52 @@
pkgbase=python-pytest-mock
pkgname=('python3-pytest-mock' 'python2-pytest-mock')
pkgver=1.6.3
pkgrel=1
pkgdesc="Thin-wrapper around the mock package for easier use with py.test"
arch=('any')
license=('LGPL3')
url="https://github.com/pytest-dev/pytest-mock/"
makedepends=('python3-pytest' 'python2-pytest' 'python2-mock' 'python3-setuptools-scm'
'python2-setuptools-scm')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/pytest-mock/archive/v$pkgver.tar.gz")
sha512sums=('6eaabb397b4c8fdf59164c78be127b9d55d8299d14414efacf25b082defa2cf53412456ccaa6d0b1735e027b76e7bf610670c448ad2cf1d6a11c81496f34c9f5')
prepare() {
cp -a pytest-mock-$pkgver{,-py2}
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}
build() {
cd "$srcdir"/pytest-mock-$pkgver
python3 setup.py build
cd "$srcdir"/pytest-mock-$pkgver-py2
python2 setup.py build
}
check() {
# Hack entry points by installing it
cd "$srcdir"/pytest-mock-$pkgver
python3 setup.py install --root="$PWD/tmp_install" --optimize=1
PYTHONPATH="$PWD/tmp_install/usr/lib/python3.6/site-packages:$PYTHONPATH:$PWD/tests" py.test test_pytest_mock.py
cd "$srcdir"/pytest-mock-$pkgver-py2
python2 setup.py install --root="$PWD/tmp_install" --optimize=1
PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH:$PWD/tests" py.test2 test_pytest_mock.py
}
package_python3-pytest-mock() {
depends=('python3-pytest')
cd pytest-mock-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
}
package_python2-pytest-mock() {
depends=('python2-pytest' 'python2-mock')
cd pytest-mock-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
}

View File

@ -9,7 +9,7 @@ pkgdesc="Requests is an Apache2 Licensed HTTP library, written in Python, for hu
url="http://python-requests.org/"
makedepends=('python2-setuptools' 'python3-setuptools' 'python3-chardet' 'python2-chardet'
'python3-urllib3' 'python2-urllib3' 'python3-idna' 'python2-idna')
checkdepends=('python3-pytest-httpbin' 'python2-pytest-httpbin' 'python3-pysocks' 'python2-pysocks' 'python3-mock' 'python2-mock')
checkdepends=('python3-pytest-httpbin' 'python2-pytest-httpbin' 'python3-pysocks' 'python2-pysocks' 'python3-pytest-mock' 'python2-pytest-mock')
license=('Apache')
arch=('any')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/kennethreitz/requests/archive/v$pkgver.tar.gz"

View File

@ -3,7 +3,7 @@
# Contributor: Jelle van der Waa <jelle@archlinux.org>
pkgname=python2-funcsigs
pkgver=0.4
pkgver=1.0.2
pkgrel=1
pkgdesc="Python function signatures from PEP362"
arch=('any')
@ -11,9 +11,10 @@ url="https://pypi.python.org/pypi/funcsigs/"
license=('Apache')
depends=('python2')
makedepends=('python2-setuptools')
checkdepends=('python2-nose')
source=(https://pypi.python.org/packages/source/f/funcsigs/funcsigs-${pkgver}.tar.gz)
sha256sums=('d83ce6df0b0ea6618700fe1db353526391a8a3ada1b7aba52fed7a61da772033')
checkdepends=('python2-nose' 'python2-unittest2')
#source=(https://pypi.python.org/packages/source/f/funcsigs/funcsigs-${pkgver}.tar.gz)
source=(https://pypi.python.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz)
sha256sums=('a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50')
package() {
cd "$srcdir/funcsigs-$pkgver"

View File

@ -0,0 +1,17 @@
pkgname=python2-linecache2
pkgver=1.0.0
pkgrel=1
pkgdesc='Backports of the linecache module'
arch=('any')
url='http://pypi.python.org/pypi/linecache2'
license=('PSF')
depends=('python2')
makedepends=('python2-setuptools' 'python2-pbr')
source=("https://pypi.python.org/packages/source/l/${pkgname#*-}/${pkgname#*-}-${pkgver}.tar.gz")
sha256sums=('4b26ff4e7110db76eeb6f5a7b64a82623839d595c2038eeda662f2a2db78e97c')
package() {
cd ${pkgname#*-}-${pkgver}
python2 setup.py install --root="${pkgdir}" --optimize='1'
}

View File

@ -0,0 +1,17 @@
pkgname=python2-traceback2
pkgver=1.4.0
pkgrel=1
pkgdesc='Backports of the traceback module'
arch=('any')
url='http://pypi.python.org/pypi/traceback2'
license=('PSF')
depends=('python2-linecache2' 'python2-six')
makedepends=('python2-setuptools' 'python2-pbr')
source=("https://pypi.python.org/packages/source/t/${pkgname#*-}/${pkgname#*-}-${pkgver}.tar.gz")
sha256sums=('05acc67a09980c2ecfedd3423f7ae0104839eccb55fc645773e1caa0951c3030')
package() {
cd ${pkgname#*-}-${pkgver}
python2 setup.py install --root="${pkgdir}" --optimize='1'
}

32
python2-unittest2/LICENSE Normal file
View File

@ -0,0 +1,32 @@
Copyright (c) 2003-2010, Michael Foord
All rights reserved.
E-mail : fuzzyman AT voidspace DOT org DOT uk
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Michael Foord nor the name of Voidspace
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,30 @@
pkgname=python2-unittest2
_pkgname=unittest2
pkgver=1.1.0
pkgrel=1
pkgdesc="New features in unittest for Python 2"
url="http://www.voidspace.org.uk/python/articles/unittest2.shtml"
arch=('any')
license=('BSD')
depends=('python2-six' 'python2-traceback2')
makedepends=('python2-distribute')
source=(${pkgname}-${pkgver}.tar.gz::https://hg.python.org/unittest2/archive/${pkgver}.tar.gz
LICENSE)
sha512sums=('ccd701194994623422d5c0bdd88d89b279cbbc67cd96b3cfee7f48e1c32f87c154a3378771e2909afa89d9c13692173ccbd692312b1ad7b9d05cf8c115fcc14b'
'85242ed21eb191fa0bab16f3e390957f1c8b7bc3b79aefbea2d925feaa8248f33d6e22afaa7d1c07c5fcb5e800910aa2a1cb52d892c104337bbdb57a380373a2')
prepare() {
sed -i "s/'argparse', //" ${_pkgname}-${pkgver}/setup.py
}
build() {
cd ${_pkgname}-${pkgver}
python2 setup.py build
}
package() {
cd ${_pkgname}-${pkgver}
python2 setup.py install --skip-build -O1 --root="${pkgdir}"
install -Dm 644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm 644 README.txt "${pkgdir}/usr/share/doc/${pkgname}/README"
}