summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcell Meszaros2022-07-02 06:06:33 +0200
committerMarcell Meszaros2022-07-02 06:06:33 +0200
commit912ddf2d03fc6a54b9a7a1591be5794090b8ceca (patch)
treece91651402e1aa840d3df362d2b47a9b8c5f8023
parentf18de2cfb684e9c80c586d01bd440ea2ef15b3d8 (diff)
downloadaur-912ddf2d03fc6a54b9a7a1591be5794090b8ceca.tar.gz
import python2-pytest-timeout 1.4.2-4 (adapted from [community])
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD75
2 files changed, 67 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 752a209a6332..2946177e3b6c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,16 @@
pkgbase = python2-pytest-timeout
- pkgdesc = py.test plugin to abort hanging tests
- pkgver = 0.5
- pkgrel = 1
- url = https://bitbucket.org/flub/pytest-timeout
+ pkgdesc = Pytest plugin to abort hanging tests (legacy Python 2 version)
+ pkgver = 1.4.2
+ pkgrel = 4
+ url = https://pypi.org/project/pytest-timeout/1.4.2/
arch = any
license = MIT
+ checkdepends = python2-pexpect
+ checkdepends = python2-pytest
makedepends = python2-setuptools
- depends = python2
- depends = python2-pytest
- options = !emptydirs
- source = https://pypi.python.org/packages/source/p/pytest-timeout/pytest-timeout-0.5.tar.gz
- md5sums = 0c44e5e03b15131498a86169000cb050
- sha256sums = c42b4106158b43500ea6a433dfee26d1068943ff6673a41e85ea367e38810673
+ source = https://files.pythonhosted.org/packages/source/p/pytest-timeout/pytest-timeout-1.4.2.tar.gz
+ sha256sums = 20b3113cf6e4e80ce2d403b6fb56e9e1b871b510259206d40ff8d609f48bda76
pkgname = python2-pytest-timeout
-
+ depends = python2
+ depends = python2-pytest
diff --git a/PKGBUILD b/PKGBUILD
index 80a1b5c782b0..e18b35273e7b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,68 @@
-# Maintainer: Andy Weidenbaum <archbaum@gmail.com>
+# Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu >
+# Contributor: Felix Yan <felixonmars@archlinux.org>
+# Contributor: Andy Weidenbaum <archbaum@gmail.com>
-pkgname=python2-pytest-timeout
-pkgver=0.5
-pkgrel=1
-pkgdesc="py.test plugin to abort hanging tests"
+pkgname='python2-pytest-timeout'
+_name="${pkgname#python2-}"
+pkgver=1.4.2
+pkgrel=4
+pkgdesc='Pytest plugin to abort hanging tests (legacy Python 2 version)'
arch=('any')
-depends=('python2' 'python2-pytest')
-makedepends=('python2-setuptools')
-url="https://bitbucket.org/flub/pytest-timeout"
+url="https://pypi.org/project/${_name}/${pkgver}/"
license=('MIT')
-options=(!emptydirs)
-source=(https://pypi.python.org/packages/source/p/${pkgname#python2-}/${pkgname#python2-}-$pkgver.tar.gz)
-md5sums=('0c44e5e03b15131498a86169000cb050')
-sha256sums=('c42b4106158b43500ea6a433dfee26d1068943ff6673a41e85ea367e38810673')
+makedepends=('python2-setuptools')
+checkdepends=(
+ 'python2-pexpect'
+ 'python2-pytest'
+)
+_tarname="${_name}-${pkgver}"
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_tarname}.tar.gz")
+sha256sums=('20b3113cf6e4e80ce2d403b6fb56e9e1b871b510259206d40ff8d609f48bda76')
-build() {
- cd "$srcdir/${pkgname#python2-}-$pkgver"
+prepare() {
+ cd "${_tarname}"
+
+ if [[ -d 'tmp_install' ]]; then
+ echo "Cleaning the previous 'tmp_install' directory"
+ rm -rfv 'tmp_install'
+ fi
- msg2 'Building...'
+ echo "Changing hashbangs in *.py files to refer to 'python2'"
+ sed -e '1s|#![ ]*/[a-zA-Z0-9./_ ]*python.*|#!/usr/bin/env python2|' \
+ -i $(find . -name '*.py')
+}
+
+build() {
+ cd "${_tarname}"
python2 setup.py build
}
+check() {
+ cd "${_tarname}"
+ (
+ # lookup path, i.e. "/usr/lib/python3.8"
+ local python_stdlib_basepath="$(python2 -c "from sysconfig import get_path; print(get_path('stdlib'))")"
+
+ # Hack entry points by installing it
+ python2 setup.py install --root="${PWD}/tmp_install" --optimize=1 --skip-build
+
+ export LC_ALL=C.UTF-8
+ export PYTHONDONTWRITEBYTECODE=1
+ export PYTHONPATH="${PWD}/tmp_install/${python_stdlib_basepath/\//}/site-packages:${PYTHONPATH}"
+
+ py.test2 --verbose --cache-clear -k 'not cov'
+ )
+}
+
package() {
- cd "$srcdir/${pkgname#python2-}-$pkgver"
+ depends=(
+ 'python2'
+ 'python2-pytest'
+ )
+
+ cd "${_tarname}"
+ python2 setup.py install --root="${pkgdir}" --prefix='/usr' --optimize=1 --skip-build
- msg2 'Installing...'
- python2 setup.py install --root="$pkgdir" --optimize=1
+ install --verbose -Dm 644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install --verbose -Dm 644 'README.rst' -t "${pkgdir}/usr/share/doc/${pkgname}"
}