summaryrefslogtreecommitdiff
path: root/dev-python/pyudev
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/pyudev
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/pyudev')
-rw-r--r--dev-python/pyudev/Manifest6
-rw-r--r--dev-python/pyudev/files/pyudev-0.19.0-skip-non-deterministic-test.patch78
-rw-r--r--dev-python/pyudev/metadata.xml20
-rw-r--r--dev-python/pyudev/pyudev-0.20.0-r1.ebuild59
-rw-r--r--dev-python/pyudev/pyudev-0.21.0.ebuild56
5 files changed, 219 insertions, 0 deletions
diff --git a/dev-python/pyudev/Manifest b/dev-python/pyudev/Manifest
new file mode 100644
index 000000000000..ca116b226dd4
--- /dev/null
+++ b/dev-python/pyudev/Manifest
@@ -0,0 +1,6 @@
+AUX pyudev-0.19.0-skip-non-deterministic-test.patch 3497 BLAKE2B bfbbd7bcb401d807531321cb15c71a52b7b039a3c7ad5cd06e9c919e6b6ef232fb16419f0480ce89e316770db523bcd3e02edc7c4f259803f4a3c93e2b0edbbe SHA512 23c305242e4df0bd0d4cde458ca1ee129bef36f98f5b7c3b341c4866b7f21a51ffaf07aa56901aeb67ccb59a4ed6548d4799ae2c519e359b627b29e722119a4d
+DIST pyudev-0.20.0.tar.gz 93217 BLAKE2B 9426b3f012be0b1bcacb7f3ed8b33d7965a2a8d7c676f032a0f2f9e6013f52090ddf82434ba01411cc2886796d34f736dc3d2e1abd6f45ee7ad516e9d5f45f90 SHA512 e86a776a2b6d29f206cdd0057c6f9b1e705d981ec8c2de49259887647856531af68238b80751102a3ffc8cea6f234cc520d62c8bc2da686e453ed010da3ebb02
+DIST pyudev-0.21.0.tar.gz 89469 BLAKE2B 3bf9ac46442c5948d131932c7b62a59ef979755f2d55bcd0165fc1b69b865268051fdeab7605c8a1cb0694ce0f4b88f31a1e6a1893900a7300ddf6439734712e SHA512 ba5b6156768b65b9655d809b14378b01173643781b9c4017271e880cdfed442c44ac49eb26c970e4275b820e01678e3001870591fccf88dc713ec941e2b85d11
+EBUILD pyudev-0.20.0-r1.ebuild 1498 BLAKE2B ec887ed44b71a5e44d3a80780cc9f2cec7492dcfa727b69f5476485bc15ebff9def00e75cd0628b74118340ec3d82cbb2a23fd28e8269f9485da5bead7c84a36 SHA512 31295a078dd2b54f54c53eb65e919641cdd5dabb5f031f02ef6f47829c074e59e79e7e24e1cb8b51991463fe372802adfeb6469e4c6e15e96b29068cbd0711c3
+EBUILD pyudev-0.21.0.ebuild 1488 BLAKE2B 4647dcb6052011d23ca5c1b92a9b8fa39c10d9ce0688c9b7bfd118af522020bb5b25993d2e525acd050a5d2c3d9197cb5a75292468054a8ec7502ee408ec5c97 SHA512 87058cb2f7a6e2190e5547fea313815312b20cbbf5ede339dfd6941396b94a79c0261cfff31319d083598990934d8bbf4d02438f2b0e62c1cf64c864f99f0fe6
+MISC metadata.xml 652 BLAKE2B 15c561bbbbf2c96a44e6d0ff39e7d1cbef709b52800051d09add19b88318e7d4c9ceb09c0942e7b01ed3b836df1348ce7c84b0deb8db4dc6e5bcebe200ebc95e SHA512 bf46b85c588d646d7cc6179a059d9fb8143eebce038e64af50f3129056a71b65a63a3cd214924ca538e6793f48912dd0f824a7826b49abbfbb8b27a72214c89b
diff --git a/dev-python/pyudev/files/pyudev-0.19.0-skip-non-deterministic-test.patch b/dev-python/pyudev/files/pyudev-0.19.0-skip-non-deterministic-test.patch
new file mode 100644
index 000000000000..268d2bdf1b4c
--- /dev/null
+++ b/dev-python/pyudev/files/pyudev-0.19.0-skip-non-deterministic-test.patch
@@ -0,0 +1,78 @@
+diff --git a/tests/_device_tests/_attributes_tests.py b/tests/_device_tests/_attributes_tests.py
+index 54d8ae6..84e26c3 100644
+--- a/tests/_device_tests/_attributes_tests.py
++++ b/tests/_device_tests/_attributes_tests.py
+@@ -88,6 +88,7 @@ def test_non_iterable(self, a_device):
+ with pytest.raises(TypeError):
+ a_device.attributes['key']
+
++ @pytest.mark.skipif(True, reason='Non-deterministic')
+ @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
+ @settings(max_examples=5)
+ def test_asstring(self, a_context, device_datum):
+@@ -99,6 +100,7 @@ def test_asstring(self, a_context, device_datum):
+ assert is_unicode_string(device.attributes.asstring(key))
+ assert device.attributes.asstring(key) == value
+
++ @pytest.mark.skipif(True, reason='Non-deterministic')
+ @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
+ @settings(max_examples=5)
+ def test_asint(self, a_context, device_datum):
+@@ -115,6 +117,7 @@ def test_asint(self, a_context, device_datum):
+ else:
+ assert device.attributes.asint(key) == value
+
++ @pytest.mark.skipif(True, reason='Non-deterministic')
+ @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
+ @settings(max_examples=5)
+ def test_asbool(self, a_context, device_datum):
+diff --git a/tests/_device_tests/_device_tests.py b/tests/_device_tests/_device_tests.py
+index 92a767d..175c611 100644
+--- a/tests/_device_tests/_device_tests.py
++++ b/tests/_device_tests/_device_tests.py
+@@ -378,6 +378,7 @@ def test_getitem_nonexisting(self, a_device):
+ a_device['a non-existing property']
+ assert str(excinfo.value) == repr('a non-existing property')
+
++ @pytest.mark.skipif(True, reason='Non-deterministic')
+ @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
+ @settings(max_examples=5)
+ def test_asint(self, a_context, device_datum):
+@@ -391,6 +392,7 @@ def test_asint(self, a_context, device_datum):
+ else:
+ assert device.asint(property) == value
+
++ @pytest.mark.skipif(True, reason='Non-deterministic')
+ @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA))
+ @settings(max_examples=5)
+ def test_asbool(self, a_context, device_datum):
+diff --git a/tests/_device_tests/_devices_tests.py b/tests/_device_tests/_devices_tests.py
+index 8eb8069..b80e550 100644
+--- a/tests/_device_tests/_devices_tests.py
++++ b/tests/_device_tests/_devices_tests.py
+@@ -189,8 +189,8 @@ def test_from_device_file(self, a_context, device_datum):
+
+ _device_data = [d for d in _DEVICE_DATA if list(d.device_links)]
+ @pytest.mark.skipif(
+- len(_device_data) == 0,
+- reason='no device with a device node'
++ True,
++ reason='non deterministic'
+ )
+ @given(_CONTEXT_STRATEGY, strategies.sampled_from(_device_data))
+ @settings(max_examples=5, min_satisfying_examples=1)
+diff --git a/tests/test_discover.py b/tests/test_discover.py
+index dd336d5..c410a64 100644
+--- a/tests/test_discover.py
++++ b/tests/test_discover.py
+@@ -155,8 +155,8 @@ def test_name(self, a_device):
+
+ _devices = [d for d in _DEVICES if list(d.device_links)]
+ @pytest.mark.skipif(
+- len(_devices) == 0,
+- reason="no device with device links"
++ True,
++ reason='Non-deterministic'
+ )
+ @given(strategies.sampled_from(_devices))
+ @settings(max_examples=NUM_TESTS, min_satisfying_examples=1)
diff --git a/dev-python/pyudev/metadata.xml b/dev-python/pyudev/metadata.xml
new file mode 100644
index 000000000000..9c052c908df4
--- /dev/null
+++ b/dev-python/pyudev/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <longdescription lang="en">
+ pyudev is a Python binding to libudev, the hardware management library
+ and service found in modern linux systems.
+ </longdescription>
+ <use>
+ <flag name="pygobject">Install PyGobject bindings</flag>
+ <flag name="qt5">Install PyQt5 bindings</flag>
+ </use>
+ <upstream>
+ <remote-id type="pypi">pyudev</remote-id>
+ <remote-id type="github">pyudev/pyudev</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pyudev/pyudev-0.20.0-r1.ebuild b/dev-python/pyudev/pyudev-0.20.0-r1.ebuild
new file mode 100644
index 000000000000..1bc6bf6e811a
--- /dev/null
+++ b/dev-python/pyudev/pyudev-0.20.0-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python binding to libudev"
+HOMEPAGE="https://pyudev.readthedocs.io/en/latest/ https://github.com/pyudev/pyudev"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~arm64 x86"
+IUSE="pygobject test"
+
+RDEPEND="
+ dev-python/six[${PYTHON_USEDEP}]
+ virtual/udev
+ pygobject? ( dev-python/pygobject:2[$(python_gen_usedep 'python2*')] )"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
+ )"
+
+DOCS=( CHANGES.rst README.rst )
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.19.0-skip-non-deterministic-test.patch"
+)
+
+REQUIRED_USE="pygobject? ( || ( $(python_gen_useflags 'python2*') ) )"
+
+python_prepare_all() {
+ if use test; then
+ ewarn "If your PORTAGE_TMPDIR is longer in length then '/var/tmp/',"
+ ewarn "change it to /var/tmp to ensure tests will pass."
+ fi
+
+ # tests are known to pass then fail on alternate runs
+ # tests: fix run_path
+ sed -i -e "s|== \('/run/udev'\)|in (\1,'/dev/.udev')|g" \
+ tests/test_core.py || die
+
+ # test needs needs newer dev-cpp/gccxml
+ rm -f tests/test_libudev.py
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ py.test || die "Tests fail with ${EPYTHON}"
+}
diff --git a/dev-python/pyudev/pyudev-0.21.0.ebuild b/dev-python/pyudev/pyudev-0.21.0.ebuild
new file mode 100644
index 000000000000..17e8665f3f09
--- /dev/null
+++ b/dev-python/pyudev/pyudev-0.21.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python binding to libudev"
+HOMEPAGE="https://pyudev.readthedocs.io/en/latest/ https://github.com/pyudev/pyudev"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~arm64 ~mips x86"
+IUSE="pygobject qt5 test"
+REQUIRED_USE="pygobject? ( || ( $(python_gen_useflags 'python2*') ) )"
+
+RDEPEND="
+ dev-python/six[${PYTHON_USEDEP}]
+ virtual/udev
+ pygobject? ( dev-python/pygobject:2[$(python_gen_usedep 'python2*')] )
+ qt5? ( dev-python/PyQt5[${PYTHON_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
+ )"
+
+DOCS=( CHANGES.rst README.rst )
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.19.0-skip-non-deterministic-test.patch"
+)
+
+python_prepare_all() {
+ if use test; then
+ ewarn "If your PORTAGE_TMPDIR is longer in length then '/var/tmp/',"
+ ewarn "change it to /var/tmp to ensure tests will pass."
+ fi
+
+ # tests are known to pass then fail on alternate runs
+ # tests: fix run_path
+ sed -i -e "s|== \('/run/udev'\)|in (\1,'/dev/.udev')|g" \
+ tests/test_core.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ py.test -v || die "Tests fail with ${EPYTHON}"
+}