diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-12-05 02:47:11 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-12-05 02:47:11 +0000 |
commit | 2771f79232c273bc2a57d23bf335dd81ccf6af28 (patch) | |
tree | c8af0fd04194aed03cf067d44e53c7edd3e9ab84 /dev-python/pyudev | |
parent | e9d044d4b9b71200a96adfa280848858c0f468c9 (diff) |
gentoo resync : 05.12.2021
Diffstat (limited to 'dev-python/pyudev')
-rw-r--r-- | dev-python/pyudev/Manifest | 2 | ||||
-rw-r--r-- | dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch | 98 | ||||
-rw-r--r-- | dev-python/pyudev/pyudev-0.22.0-r1.ebuild | 51 |
3 files changed, 151 insertions, 0 deletions
diff --git a/dev-python/pyudev/Manifest b/dev-python/pyudev/Manifest index 37156c93664c..27df83cf62f5 100644 --- a/dev-python/pyudev/Manifest +++ b/dev-python/pyudev/Manifest @@ -1,3 +1,5 @@ +AUX pyudev-0.22-fix-hypothesis.patch 4582 BLAKE2B 8fc2f27890b68baa5e5771ab2d992ac41c9a7e51e63c11d5d317ba9a9dbc90f018e29d1d4ff292596cc3103e1a09a9140c5c76c2647cd0a4fe87eae747d5fcb4 SHA512 b1c6e08e95ed8f31d106820b888aadde7844a7e2c64277245108f9af74ea9be8606d70ebbfd18287993cb0c84b76972941499f0efbda7079b22e889b0bb8eda0 DIST pyudev-0.22.0.tar.gz 85077 BLAKE2B 66c78aa4d3bea5ceae3660a93e5bd1733629bb5228d67d8e647abb8c237a2786c1061b07e034be5467f5bcab58d95ba30f91d74bdc54cd8253dff69be3ad4a80 SHA512 a09ed479a54a1772a6af68cb975fef792068c2de3655e20223905bc3f574fd32bd3dbe6b97062eee3ab5f08a8b041ad3ea86dfb68c839ea44e29d65ec1686670 +EBUILD pyudev-0.22.0-r1.ebuild 1260 BLAKE2B 6574500f71c0ce4db398759d9ece14d21b97d900cb4a240d5f3a6fb2a5ec07368f4e4507955e35e9d3098afdfb0a3d7870e73465b6663bb8ccfc6fdf372421ec SHA512 92eab46e1f11612bc46d749bb016b9b9d180412ff7e990d2614c9a6adef8610124a1782c8960535e90eee72eb0da7e65f82ed967a7aa85d4453e7d2c6262f6a9 EBUILD pyudev-0.22.0.ebuild 1270 BLAKE2B 75c78e4b24b4f85af76edd0684a31d074a32f389569f7b8e66c56171d8661db2216bf4d3d9725cd9c05c2399d1b3697808b8940bea1f230f128ed034d51fd50b SHA512 01ec90457800da048f09f4edca75ca4b88075af8d5e4ea3cd2f1bb6c2425991091f957cb0a0cc1f26072d0dce9980f9ea7e447574fb9e4bdef4e5e35accf15bf MISC metadata.xml 594 BLAKE2B 5b620e46403b2c1a572c3a208669c2c64c166812031f139d1f6ffc15fc4aa094b2d3f02848e2893d6870942c89bc94434419921b6188903a2e7d80b2af8b8280 SHA512 575efd0013afd252bc9617995db85987ccd11712932c8b2b542db683864606eb5cd52c9b37fa2430b05182c16ba712dac1434fffc1fc405c4ef6dad41c4eb9f2 diff --git a/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch b/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch new file mode 100644 index 000000000000..5a6b27324d82 --- /dev/null +++ b/dev-python/pyudev/files/pyudev-0.22-fix-hypothesis.patch @@ -0,0 +1,98 @@ +diff --git a/tests/_device_tests/_attributes_tests.py b/tests/_device_tests/_attributes_tests.py +index 23fa6da..7baf043 100644 +--- a/tests/_device_tests/_attributes_tests.py ++++ b/tests/_device_tests/_attributes_tests.py +@@ -50,7 +50,7 @@ class TestAttributes(object): + """ + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_getitem(self, a_context, device_datum): + """ + Test that attribute value exists and is instance of bytes. +@@ -60,7 +60,7 @@ def test_getitem(self, a_context, device_datum): + for key in device_datum.attributes.keys()) + + @given(strategies.sampled_from(_DEVICES)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_getitem_nonexisting(self, a_device): + """ + Test behavior when corresponding value is non-existant. +@@ -87,7 +87,7 @@ def test_non_iterable(self, a_device): + a_device.attributes['key'] + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_asstring(self, a_context, device_datum): + """ + Test that attribute exists for actual device and is unicode. +@@ -97,7 +97,7 @@ def test_asstring(self, a_context, device_datum): + for key in device_datum.attributes.keys()) + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=10) ++ @settings(max_examples=10, deadline=30000) + def test_asint(self, a_context, device_datum): + """ + Test that integer result is an int or ValueError raised. +@@ -111,7 +111,7 @@ def test_asint(self, a_context, device_datum): + device.attributes.asint(key) + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_asbool(self, a_context, device_datum): + """ + Test that bool result is a bool or ValueError raised. +diff --git a/tests/_device_tests/_device_tests.py b/tests/_device_tests/_device_tests.py +index b9a84c6..2ce6751 100644 +--- a/tests/_device_tests/_device_tests.py ++++ b/tests/_device_tests/_device_tests.py +@@ -352,7 +352,7 @@ def test_key_subset(self, a_context, device_datum): + frozenset(device.properties.keys()) + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=1) ++ @settings(max_examples=1, deadline=30000) + def test_getitem(self, a_context, device_datum): + device = Devices.from_path(a_context, device_datum.device_path) + for prop in device_datum.properties: +@@ -372,7 +372,7 @@ def test_getitem(self, a_context, device_datum): + @pytest.mark.skipif( + len(_device_data) == 0, reason='no device with a DEVNAME property') + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_device_data)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_getitem_devname(self, a_context, device_datum): + device = Devices.from_path(a_context, device_datum.device_path) + data_devname = os.path.join(a_context.device_path, +@@ -382,7 +382,7 @@ def test_getitem_devname(self, a_context, device_datum): + assert device_devname == data_devname + + @given(strategies.sampled_from(_DEVICES)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_getitem_nonexisting(self, a_device): + with pytest.raises(KeyError) as excinfo: + # pylint: disable=pointless-statement +@@ -390,7 +390,7 @@ def test_getitem_nonexisting(self, a_device): + assert str(excinfo.value) == repr('a non-existing property') + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_asint(self, a_context, device_datum): + device = Devices.from_path(a_context, device_datum.device_path) + for prop, value in device_datum.properties.items(): +@@ -403,7 +403,7 @@ def test_asint(self, a_context, device_datum): + assert device.properties.asint(prop) == value + + @given(_CONTEXT_STRATEGY, strategies.sampled_from(_DEVICE_DATA)) +- @settings(max_examples=5) ++ @settings(max_examples=5, deadline=30000) + def test_asbool(self, a_context, device_datum): + """ + Test that values of 1 and 0 get properly interpreted as bool diff --git a/dev-python/pyudev/pyudev-0.22.0-r1.ebuild b/dev-python/pyudev/pyudev-0.22.0-r1.ebuild new file mode 100644 index 000000000000..622a38c9c9c9 --- /dev/null +++ b/dev-python/pyudev/pyudev-0.22.0-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{7..10} ) + +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="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="qt5" + +RDEPEND=" + dev-python/six[${PYTHON_USEDEP}] + virtual/udev + 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}] + )" + +DOCS=( CHANGES.rst README.rst ) + +PATCHES=( + "${FILESDIR}/pyudev-0.22-fix-hypothesis.patch" +) + +distutils_enable_tests pytest + +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 +} |