Date: Friday, May 24, 2019 @ 19:09:52 Author: ffy00 Revision: 469659 archrelease: copy trunk to community-any
Added: python-pyudev/repos/community-any/ python-pyudev/repos/community-any/0001-tests-fix-tests-for-pytest-4.0.patch (from rev 469658, python-pyudev/trunk/0001-tests-fix-tests-for-pytest-4.0.patch) python-pyudev/repos/community-any/PKGBUILD (from rev 469658, python-pyudev/trunk/PKGBUILD) -------------------------------------------+ 0001-tests-fix-tests-for-pytest-4.0.patch | 64 +++++++++++++++++++++++++ PKGBUILD | 70 ++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) Copied: python-pyudev/repos/community-any/0001-tests-fix-tests-for-pytest-4.0.patch (from rev 469658, python-pyudev/trunk/0001-tests-fix-tests-for-pytest-4.0.patch) =================================================================== --- community-any/0001-tests-fix-tests-for-pytest-4.0.patch (rev 0) +++ community-any/0001-tests-fix-tests-for-pytest-4.0.patch 2019-05-24 19:09:52 UTC (rev 469659) @@ -0,0 +1,64 @@ +From cc04bc5ca08e4761b41c5cf220889c4233f157a0 Mon Sep 17 00:00:00 2001 +From: FFY00 <filipe.la...@gmail.com> +Date: Fri, 24 May 2019 19:08:41 +0100 +Subject: [PATCH] tests: fix tests for pytest 4.0 + +--- + tests/plugins/mock_libudev.py | 6 ++++-- + tests/plugins/privileged.py | 5 +++-- + tests/plugins/travis.py | 5 +++-- + 3 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/tests/plugins/mock_libudev.py b/tests/plugins/mock_libudev.py +index aefeb31..0bde07b 100644 +--- a/tests/plugins/mock_libudev.py ++++ b/tests/plugins/mock_libudev.py +@@ -32,6 +32,7 @@ + from contextlib import contextmanager + from collections import namedtuple + ++import pytest + import mock + + Node = namedtuple('Node', 'name value next') +@@ -93,5 +94,6 @@ def libudev_list(libudev, function, items): + EXPOSED_FUNCTIONS = [libudev_list] + + +-def pytest_namespace(): +- return dict((f.__name__, f) for f in EXPOSED_FUNCTIONS) ++def pytest_configure(): ++ for f in EXPOSED_FUNCTIONS: ++ setattr(pytest, f.__name__, f) +diff --git a/tests/plugins/privileged.py b/tests/plugins/privileged.py +index 92328b9..c636980 100644 +--- a/tests/plugins/privileged.py ++++ b/tests/plugins/privileged.py +@@ -71,5 +71,6 @@ def unload_dummy(): + EXPOSED_FUNCTIONS = [load_dummy, unload_dummy] + + +-def pytest_namespace(): +- return dict((f.__name__, f) for f in EXPOSED_FUNCTIONS) ++def pytest_configure(): ++ for f in EXPOSED_FUNCTIONS: ++ setattr(pytest, f.__name__, f) +diff --git a/tests/plugins/travis.py b/tests/plugins/travis.py +index 46466c2..15a780e 100644 +--- a/tests/plugins/travis.py ++++ b/tests/plugins/travis.py +@@ -38,8 +38,9 @@ def is_on_travis_ci(): + EXPOSED_FUNCTIONS = [is_on_travis_ci] + + +-def pytest_namespace(): +- return dict((f.__name__, f) for f in EXPOSED_FUNCTIONS) ++def pytest_configure(): ++ for f in EXPOSED_FUNCTIONS: ++ setattr(pytest, f.__name__, f) + + + def pytest_runtest_setup(item): +-- +2.21.0 + Copied: python-pyudev/repos/community-any/PKGBUILD (from rev 469658, python-pyudev/trunk/PKGBUILD) =================================================================== --- community-any/PKGBUILD (rev 0) +++ community-any/PKGBUILD 2019-05-24 19:09:52 UTC (rev 469659) @@ -0,0 +1,70 @@ +# Maintainer: Filipe Laíns (FFY00) <la...@archlinux.org> +# Contributor: Andrea Scarpino <and...@archlinux.org> +# Contributor: examon <examon.mail[at]gmail[dot]com> +# Contributor: Sebastian Wiesner <lunaryorn googlemail com> +# Contributor: Dwight Schauer <dscha...@ti.com> + +_pkgname=pyudev +pkgname=python-$_pkgname +pkgver=0.21.0 +pkgrel=6 +arch=('any') +url='https://github.com/pyudev/pyudev' +license=('LGPL') +pkgdesc='Python bindings to libudev' +depends=('python-six' 'systemd') +makedepends=('python-setuptools' 'python-sphinx' 'python-mock') +checkdepends=('python-pytest-runner' 'python-docutils' 'python-mock' 'python-hypothesis') +optdepends=('python-pyqt5: PyQt integration' + 'pyside2: PySide integration' + 'python-gobject2: Glib integration' + 'python-wxpython: WX integration') +source=("$_pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" + '0001-tests-fix-tests-for-pytest-4.0.patch') +sha512sums=('c6cc8786c69de2a07eeae39cb57e33db6ca5fea83c38fdab277070bf052c97bd053911ab08a11fe65cb56c463492111e74451801390d89dc7f00fd00e68bba19' + '5abbf38f0d7e171ff46823144a027de8ff0ce3a800642d17655f577af04460bf78eecc320a3099ef6d7808def6350ec8350307f0023157df3d0e3feccd484756') + +prepare() { + cd $_pkgname-$pkgver + + # pytest-runner doesn't understand norecursedirs + sed -i '/norecursedirs/d' setup.cfg + echo -e '[pytest]\nnorecursedirs = .* _* build' > pytest.ini + + # Fix tests for pytest >= 4.0 + patch -p1 < ../0001-tests-fix-tests-for-pytest-4.0.patch + + # Remove failing tests (we can't test udev inside makepkg) + rm tests/test_{util,discover,device,monitor,enumerate,observer}.py + + # Fix documentation build + sed -i "s|os.path.join(doc_directory, os.pardir)|os.path.join(doc_directory, os.pardir, 'src')| + s|b'autodoc-process-docstring'|'autodoc-process-docstring'|" doc/conf.py +} + +build() { + cd $_pkgname-$pkgver + + python setup.py build + + # Generate documentation + sphinx-apidoc -f -e -o doc src/pyudev + sphinx-build -a -b html doc doc/html +} + +check() { + cd $_pkgname-$pkgver + + python setup.py pytest +} + +package() { + cd $_pkgname-$pkgver + + python setup.py install --root "$pkgdir" --skip-build -O1 + + # Install documentation + install -dm 755 "$pkgdir"/usr/share/doc/$pkgname + cp -r -a --no-preserve=ownership doc/html "$pkgdir"/usr/share/doc/$pkgname +} +