[packages/python3-pyudev] - python-pyudev.spec updated to 0.24.3 for python 3.7+
qboosh
qboosh at pld-linux.org
Tue Jul 1 20:56:11 CEST 2025
commit 6b00825bfb3d2447d7dba340bb2e4c3731fa7042
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Jul 1 20:57:37 2025 +0200
- python-pyudev.spec updated to 0.24.3 for python 3.7+
python-pyudev-mock.patch | 112 -------------------------------
python-pyudev.spec | 169 -----------------------------------------------
python3-pyudev.spec | 97 +++++++++++++++++++++++++++
3 files changed, 97 insertions(+), 281 deletions(-)
---
diff --git a/python-pyudev.spec b/python-pyudev.spec
deleted file mode 100644
index 0196463..0000000
--- a/python-pyudev.spec
+++ /dev/null
@@ -1,169 +0,0 @@
-#
-# Conditional build:
-%bcond_without doc # HTML documentation build
-%bcond_with tests # py.test tests [requires functional udev with device db]
-%bcond_without python2 # Python 2.x module
-%bcond_without python3 # Python 3.x module
-#
-%define module pyudev
-Summary: Pure Python binding for libudev
-Summary(pl.UTF-8): Czysto pythonowe wiązanie do libudev
-Name: python-%{module}
-Version: 0.22.0
-Release: 6
-License: LGPL v2.1+
-Group: Development/Languages/Python
-#Source0Download: https://pypi.org/simple/pyudev/
-Source0: https://files.pythonhosted.org/packages/source/p/pyudev/%{module}-%{version}.tar.gz
-# Source0-md5: 377eda61186c91e9440f01d76dbb4206
-Patch0: %{name}-mock.patch
-URL: http://pyudev.readthedocs.org/
-%if %{with python2}
-BuildRequires: python-devel >= 1:2.6
-BuildRequires: python-setuptools
-%if %{with tests}
-BuildRequires: python-docutils >= 0.9
-BuildRequires: python-hypothesis
-BuildRequires: python-mock >= 1.0
-BuildRequires: python-pytest >= 2.8
-BuildRequires: python-six
-%endif
-%endif
-%if %{with python3}
-BuildRequires: python3-devel >= 1:3.2
-BuildRequires: python3-setuptools
-%if %{with tests}
-BuildRequires: python3-docutils >= 0.9
-BuildRequires: python3-hypothesis
-BuildRequires: python3-pytest >= 2.8
-BuildRequires: python3-six
-%endif
-%endif
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
-%if %{with doc}
-# for tests 1.0b1 is required, but for docs generation 0.8 is sufficient
-BuildRequires: python-mock >= 0.8
-BuildRequires: python-sphinxcontrib-issuetracker >= 0.9
-BuildRequires: python-pytest >= 2.2
-BuildRequires: sphinx-pdg-2 >= 1.0.7
-%endif
-Requires: python-modules >= 1:2.6
-Requires: udev-libs >= 1:151
-BuildArch: noarch
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-pyudev is a LGPL licensed, pure Python binding for libudev, the device
-and hardware management and information library for Linux. It supports
-almost all libudev functionality, you can enumerate devices, query
-device properties and attributes or monitor devices, including
-asynchronous monitoring with threads, or within the event loops of Qt,
-GLib or wxPython.
-
-%description -l pl.UTF-8
-pyudev to wydane na licencji LGPL czysto pythonowe wiązanie do libudev
-- biblioteki zarządzania urządzeniami i sprzętem dla Linuksa.
-Obsługuje prawie całą funkcjonalność libudev, potrafi wyliczać
-urządzenia, odpytywać o właściwości i atrybuty urządzeń oraz
-monitorować urządzenia, włącznie z asynchronicznym monitorowaniem z
-użyciem wątków albo wewnątrz pętli zdarzeń Qt, GLiba czy wxPythona.
-
-%package -n python3-%{module}
-Summary: Pure Python binding for libudev
-Summary(pl.UTF-8): Czysto pythonowe wiązanie do libudev
-Group: Development/Languages/Python
-Requires: python3-modules >= 1:3.2
-
-%description -n python3-%{module}
-pyudev is a LGPL licensed, pure Python binding for libudev, the device
-and hardware management and information library for Linux. It supports
-almost all libudev functionality, you can enumerate devices, query
-device properties and attributes or monitor devices, including
-asynchronous monitoring with threads, or within the event loops of Qt,
-GLib or wxPython.
-
-%description -n python3-%{module} -l pl.UTF-8
-pyudev to wydane na licencji LGPL czysto pythonowe wiązanie do libudev
-- biblioteki zarządzania urządzeniami i sprzętem dla Linuksa.
-Obsługuje prawie całą funkcjonalność libudev, potrafi wyliczać
-urządzenia, odpytywać o właściwości i atrybuty urządzeń oraz
-monitorować urządzenia, włącznie z asynchronicznym monitorowaniem z
-użyciem wątków albo wewnątrz pętli zdarzeń Qt, GLiba czy wxPythona.
-
-%package apidocs
-Summary: API documentation for Python pyudev module
-Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyudev
-Group: Documentation
-
-%description apidocs
-API documentation for Python pyudev module.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API modułu Pythona pyudev.
-
-%prep
-%setup -q -n %{module}-%{version}
-%patch -P 0 -p1
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd):$(pwd)/build-2/lib \
-%{__python} -m pytest tests
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd):$(pwd)/build-3/lib \
-%{__python3} -m pytest tests
-%endif
-%endif
-
-%if %{with doc}
-PYTHONPATH=build-2/lib \
-sphinx-build-2 -b html -d doc/_doctrees doc doc/html
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc CHANGES.rst README.rst
-%{py_sitescriptdir}/pyudev
-%{py_sitescriptdir}/pyudev-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%doc CHANGES.rst README.rst
-%{py3_sitescriptdir}/pyudev
-%{py3_sitescriptdir}/pyudev-%{version}-py*.egg-info
-%endif
-
-%if %{with doc}
-%files apidocs
-%defattr(644,root,root,755)
-%doc doc/html/{_static,api,tests,*.html,*.js}
-%endif
diff --git a/python3-pyudev.spec b/python3-pyudev.spec
new file mode 100644
index 0000000..27b273b
--- /dev/null
+++ b/python3-pyudev.spec
@@ -0,0 +1,97 @@
+#
+# Conditional build:
+%bcond_with doc # HTML documentation build (not included in sdist)
+%bcond_with tests # pytest tests (missing files, requires functional udev with device db)
+#
+%define module pyudev
+Summary: Pure Python binding for libudev
+Summary(pl.UTF-8): Czysto pythonowe wiązanie do libudev
+Name: python3-%{module}
+Version: 0.24.3
+Release: 1
+License: LGPL v2.1+
+Group: Development/Languages/Python
+#Source0Download: https://pypi.org/simple/pyudev/
+Source0: https://files.pythonhosted.org/packages/source/p/pyudev/%{module}-%{version}.tar.gz
+# Source0-md5: 07bbe9111308d2509645705b8321c416
+URL: https://pyudev.readthedocs.io/
+BuildRequires: python3-devel >= 1:3.7
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-hypothesis
+BuildRequires: python3-pytest >= 2.8
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: python3-docutils
+BuildRequires: python3-pytest >= 2.2
+BuildRequires: sphinx-pdg-3 >= 1.0.7
+%endif
+Requires: python3-modules >= 1:3.7
+Requires: udev-libs >= 1:151
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+pyudev is a LGPL licensed, pure Python binding for libudev, the device
+and hardware management and information library for Linux. It supports
+almost all libudev functionality, you can enumerate devices, query
+device properties and attributes or monitor devices, including
+asynchronous monitoring with threads, or within the event loops of Qt,
+GLib or wxPython.
+
+%description -l pl.UTF-8
+pyudev to wydane na licencji LGPL czysto pythonowe wiązanie do libudev
+- biblioteki zarządzania urządzeniami i sprzętem dla Linuksa.
+Obsługuje prawie całą funkcjonalność libudev, potrafi wyliczać
+urządzenia, odpytywać o właściwości i atrybuty urządzeń oraz
+monitorować urządzenia, włącznie z asynchronicznym monitorowaniem z
+użyciem wątków albo wewnątrz pętli zdarzeń Qt, GLiba czy wxPythona.
+
+%package apidocs
+Summary: API documentation for Python pyudev module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyudev
+Group: Documentation
+
+%description apidocs
+API documentation for Python pyudev module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona pyudev.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+%build
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd):$(pwd)/build-3/lib \
+%{__python3} -m pytest tests
+%endif
+
+%if %{with doc}
+PYTHONPATH=build-3/lib \
+sphinx-build-3 -b html -d doc/_doctrees doc doc/html
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.rst
+%{py3_sitescriptdir}/pyudev
+%{py3_sitescriptdir}/pyudev-%{version}-py*.egg-info
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/html/{_static,api,tests,*.html,*.js}
+%endif
diff --git a/python-pyudev-mock.patch b/python-pyudev-mock.patch
deleted file mode 100644
index f929175..0000000
--- a/python-pyudev-mock.patch
+++ /dev/null
@@ -1,112 +0,0 @@
---- pyudev-0.21.0/tests/_device_tests/_device_tests.py.orig 2016-07-21 22:32:53.000000000 +0200
-+++ pyudev-0.21.0/tests/_device_tests/_device_tests.py 2017-04-16 12:44:06.869191990 +0200
-@@ -37,7 +37,10 @@ from hypothesis import settings
- from hypothesis import strategies
-
- import pytest
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from pyudev import Device
- from pyudev import Devices
---- pyudev-0.21.0/tests/_device_tests/_tags_tests.py.orig 2016-07-21 22:32:53.000000000 +0200
-+++ pyudev-0.21.0/tests/_device_tests/_tags_tests.py 2017-04-16 12:43:43.242525595 +0200
-@@ -31,7 +31,10 @@ from hypothesis import settings
- from hypothesis import strategies
-
- import pytest
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from pyudev import Devices
-
---- pyudev-0.22.0/tests/plugins/mock_libudev.py.orig 2020-02-09 12:46:31.756005870 +0100
-+++ pyudev-0.22.0/tests/plugins/mock_libudev.py 2020-02-09 12:48:09.762141592 +0100
-@@ -33,7 +33,10 @@
- from collections import namedtuple
-
- import pytest
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- Node = namedtuple('Node', 'name value next')
-
---- pyudev-0.21.0/tests/test_core.py.orig 2016-04-29 23:17:02.000000000 +0200
-+++ pyudev-0.21.0/tests/test_core.py 2017-04-16 12:41:32.362527088 +0200
-@@ -22,7 +22,10 @@ from __future__ import (print_function,
- import random
- import syslog
-
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from pyudev import udev_version
-
---- pyudev-0.22.0/tests/test_enumerate.py.orig 2020-02-09 12:46:31.759339185 +0100
-+++ pyudev-0.22.0/tests/test_enumerate.py 2020-02-09 12:47:35.475660671 +0100
-@@ -18,7 +18,10 @@
- from __future__ import (print_function, division, unicode_literals,
- absolute_import)
-
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from hypothesis import given
- from hypothesis import settings
---- pyudev-0.21.0/tests/test_monitor.py.orig 2016-07-21 22:32:53.000000000 +0200
-+++ pyudev-0.21.0/tests/test_monitor.py 2017-04-16 12:41:04.209194078 +0200
-@@ -25,7 +25,10 @@ from contextlib import contextmanager
- from select import select
-
- import pytest
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from pyudev import Monitor, MonitorObserver, Devices
-
---- pyudev-0.21.0/tests/test_observer_deprecated.py.orig 2016-07-21 22:32:53.000000000 +0200
-+++ pyudev-0.21.0/tests/test_observer_deprecated.py 2017-04-16 12:42:18.385859897 +0200
-@@ -19,7 +19,10 @@ from __future__ import (print_function,
- absolute_import)
-
- import pytest
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from pyudev import Monitor, Devices
-
---- pyudev-0.21.0/tests/test_observer.py.orig 2016-07-21 22:32:53.000000000 +0200
-+++ pyudev-0.21.0/tests/test_observer.py 2017-04-16 12:41:58.945860118 +0200
-@@ -21,7 +21,10 @@ from __future__ import (print_function,
- import random
-
- import pytest
--import mock
-+try:
-+ from unittest import mock
-+except ImportError:
-+ import mock
-
- from pyudev import Monitor, Devices
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-pyudev.git/commitdiff/6b00825bfb3d2447d7dba340bb2e4c3731fa7042
More information about the pld-cvs-commit
mailing list