]> git.pld-linux.org Git - packages/python-wrapt.git/blob - python-wrapt.spec
- run tests with just built, not system wrapt
[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 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
97 %{__python} -m pytest tests
98 %endif
99 %endif
100
101 %if %{with python3}
102 %py3_build
103
104 %if %{with tests}
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
107 %{__python3} -m pytest tests
108 %endif
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 %if %{with python2}
115 %py_install
116
117 %py_postclean
118 %endif
119
120 %if %{with python3}
121 %py3_install
122 %endif
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %if %{with python2}
128 %files
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
135 %endif
136
137 %if %{with python3}
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
146 %endif
This page took 0.128924 seconds and 4 git commands to generate.