3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Python 2 module for decorators, wrappers and monkey patching
9 Summary(pl.UTF-8): Moduł Pythona 2 do dekorowania, opakowywania i łatania w locie
10 Name: python-%{module}
11 # keep version compatible with python3-astroid.spec (2.9.x wants <1.14.0)
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/wrapt/
17 Source0: https://files.pythonhosted.org/packages/source/w/wrapt/%{module}-%{version}.tar.gz
18 # Source0-md5: 50efce974cc8a0d39fd274d74eb0fd1e
19 URL: https://github.com/GrahamDumpleton/wrapt
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-devel >= 1:2.7
24 BuildRequires: python-setuptools >= 1:38.3.0
27 BuildRequires: python3-devel >= 1:3.5
28 BuildRequires: python3-setuptools >= 1:38.3.0
30 Requires: python-modules >= 1:2.7
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 The aim of the wrapt module is to provide a transparent object proxy
35 for Python, which can be used as the basis for the construction of
36 function wrappers and decorator functions.
38 The wrapt module focuses very much on correctness. It therefore goes
39 way beyond existing mechanisms such as functools.wraps() to ensure
40 that decorators preserve introspectability, signatures, type checking
41 abilities etc. The decorators that can be constructed using this
42 module will work in far more scenarios than typical decorators and
43 provide more predictable and consistent behaviour.
45 %description -l pl.UTF-8
46 Celem modułu wrapt jest dostarczenie przezroczystego proxy obiektów
47 dla Pythona. Można go używać jako podstawy do konstruowania opakowań
48 funkcji lub funkcji dekoratorów.
50 Moduł wrapt skupia się bardzo na poprawności - wykracza więc poza
51 istniejące mechanizmy, tkaie jak functools.wraps(), aby zapewnić, że
52 dekoratory zachowują introspekcje, sygnatury, możliwość sprawdzania
53 typów itp. Dekoratory tworzone przy użyciu tego modułu będą działać w
54 większej liczbie scenariuszy niż typowe dekoratory oraz zapewniać
55 bardziej przewidywalne i spójne zachowanie.
57 %package -n python3-%{module}
58 Summary: Python 3 module for decorators, wrappers and monkey patching
59 Summary(pl.UTF-8): Moduł Pythona 3 do dekorowania, opakowywania i łatania w locie
60 Group: Libraries/Python
61 Requires: python3-modules >= 1:3.5
63 %description -n python3-%{module}
64 The aim of the wrapt module is to provide a transparent object proxy
65 for Python, which can be used as the basis for the construction of
66 function wrappers and decorator functions.
68 The wrapt module focuses very much on correctness. It therefore goes
69 way beyond existing mechanisms such as functools.wraps() to ensure
70 that decorators preserve introspectability, signatures, type checking
71 abilities etc. The decorators that can be constructed using this
72 module will work in far more scenarios than typical decorators and
73 provide more predictable and consistent behaviour.
75 %description -n python3-%{module} -l pl.UTF-8
76 Celem modułu wrapt jest dostarczenie przezroczystego proxy obiektów
77 dla Pythona. Można go używać jako podstawy do konstruowania opakowań
78 funkcji lub funkcji dekoratorów.
80 Moduł wrapt skupia się bardzo na poprawności - wykracza więc poza
81 istniejące mechanizmy, tkaie jak functools.wraps(), aby zapewnić, że
82 dekoratory zachowują introspekcje, sygnatury, możliwość sprawdzania
83 typów itp. Dekoratory tworzone przy użyciu tego modułu będą działać w
84 większej liczbie scenariuszy niż typowe dekoratory oraz zapewniać
85 bardziej przewidywalne i spójne zachowanie.
88 %setup -q -n %{module}-%{version}
95 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
96 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
97 %{__python} -m pytest tests
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
107 %{__python3} -m pytest tests
112 rm -rf $RPM_BUILD_ROOT
125 rm -rf $RPM_BUILD_ROOT
129 %defattr(644,root,root,755)
130 %doc LICENSE README.rst
131 %dir %{py_sitedir}/%{module}
132 %{py_sitedir}/%{module}/*.py[co]
133 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
134 %{py_sitedir}/%{module}-%{version}-py*.egg-info
138 %files -n python3-%{module}
139 %defattr(644,root,root,755)
140 %doc LICENSE README.rst
141 %dir %{py3_sitedir}/%{module}
142 %{py3_sitedir}/%{module}/*.py
143 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
144 %{py3_sitedir}/%{module}/__pycache__
145 %{py3_sitedir}/%{module}-%{version}-py*.egg-info