]> git.pld-linux.org Git - packages/python-wrapt.git/blob - python-wrapt.spec
25d25cba8c725b9770c2e3f6068ae0c89bb3e265
[packages/python-wrapt.git] / python-wrapt.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  wrapt
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)
12 Version:        1.13.3
13 Release:        3
14 License:        BSD
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
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-setuptools >= 1:38.3.0
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel >= 1:3.5
28 BuildRequires:  python3-setuptools >= 1:38.3.0
29 %endif
30 Requires:       python-modules >= 1:2.7
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
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.
37
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.
44
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.
49
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.
56
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
62
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.
67
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.
74
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.
79
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.
86
87 %prep
88 %setup -q -n %{module}-%{version}
89
90 %build
91 %if %{with python2}
92 %py_build
93
94 %if %{with tests}
95 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
96 %{__python} -m pytest tests
97 %endif
98 %endif
99
100 %if %{with python3}
101 %py3_build
102
103 %if %{with tests}
104 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
105 %{__python3} -m pytest tests
106 %endif
107 %endif
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111
112 %if %{with python2}
113 %py_install
114
115 %py_postclean
116 %endif
117
118 %if %{with python3}
119 %py3_install
120 %endif
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %if %{with python2}
126 %files
127 %defattr(644,root,root,755)
128 %doc LICENSE README.rst
129 %dir %{py_sitedir}/%{module}
130 %{py_sitedir}/%{module}/*.py[co]
131 %attr(755,root,root) %{py_sitedir}/%{module}/*.so
132 %{py_sitedir}/%{module}-%{version}-py*.egg-info
133 %endif
134
135 %if %{with python3}
136 %files -n python3-%{module}
137 %defattr(644,root,root,755)
138 %doc LICENSE README.rst
139 %dir %{py3_sitedir}/%{module}
140 %{py3_sitedir}/%{module}/*.py
141 %attr(755,root,root) %{py3_sitedir}/%{module}/*.so
142 %{py3_sitedir}/%{module}/__pycache__
143 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
144 %endif
This page took 0.082768 seconds and 2 git commands to generate.