]> git.pld-linux.org Git - packages/python-wrapt.git/blame - python-wrapt.spec
- run tests with just built, not system wrapt
[packages/python-wrapt.git] / python-wrapt.spec
CommitLineData
1504bca3
JK
1#
2# Conditional build:
1c9fceac 3%bcond_without tests # unit tests
1504bca3
JK
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7%define module wrapt
dbb63cef
JB
8Summary: Python 2 module for decorators, wrappers and monkey patching
9Summary(pl.UTF-8): Moduł Pythona 2 do dekorowania, opakowywania i łatania w locie
1504bca3 10Name: python-%{module}
1c9fceac
JB
11# keep version compatible with python3-astroid.spec (2.9.x wants <1.14.0)
12Version: 1.13.3
20fb7971 13Release: 3
1504bca3
JK
14License: BSD
15Group: Libraries/Python
dbb63cef
JB
16#Source0Download: https://pypi.org/simple/wrapt/
17Source0: https://files.pythonhosted.org/packages/source/w/wrapt/%{module}-%{version}.tar.gz
1c9fceac 18# Source0-md5: 50efce974cc8a0d39fd274d74eb0fd1e
1504bca3
JK
19URL: https://github.com/GrahamDumpleton/wrapt
20BuildRequires: rpm-pythonprov
21BuildRequires: rpmbuild(macros) >= 1.714
22%if %{with python2}
dbb63cef 23BuildRequires: python-devel >= 1:2.7
1c9fceac 24BuildRequires: python-setuptools >= 1:38.3.0
1504bca3
JK
25%endif
26%if %{with python3}
1c9fceac
JB
27BuildRequires: python3-devel >= 1:3.5
28BuildRequires: python3-setuptools >= 1:38.3.0
1504bca3 29%endif
dbb63cef 30Requires: python-modules >= 1:2.7
1504bca3
JK
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34The aim of the wrapt module is to provide a transparent object proxy
35for Python, which can be used as the basis for the construction of
36function wrappers and decorator functions.
37
38The wrapt module focuses very much on correctness. It therefore goes
39way beyond existing mechanisms such as functools.wraps() to ensure
40that decorators preserve introspectability, signatures, type checking
41abilities etc. The decorators that can be constructed using this
42module will work in far more scenarios than typical decorators and
43provide more predictable and consistent behaviour.
44
dbb63cef
JB
45%description -l pl.UTF-8
46Celem modułu wrapt jest dostarczenie przezroczystego proxy obiektów
47dla Pythona. Można go używać jako podstawy do konstruowania opakowań
48funkcji lub funkcji dekoratorów.
49
50Moduł wrapt skupia się bardzo na poprawności - wykracza więc poza
51istniejące mechanizmy, tkaie jak functools.wraps(), aby zapewnić, że
52dekoratory zachowują introspekcje, sygnatury, możliwość sprawdzania
53typów itp. Dekoratory tworzone przy użyciu tego modułu będą działać w
54większej liczbie scenariuszy niż typowe dekoratory oraz zapewniać
55bardziej przewidywalne i spójne zachowanie.
56
1504bca3 57%package -n python3-%{module}
dbb63cef
JB
58Summary: Python 3 module for decorators, wrappers and monkey patching
59Summary(pl.UTF-8): Moduł Pythona 3 do dekorowania, opakowywania i łatania w locie
1504bca3 60Group: Libraries/Python
1c9fceac 61Requires: python3-modules >= 1:3.5
1504bca3
JK
62
63%description -n python3-%{module}
64The aim of the wrapt module is to provide a transparent object proxy
65for Python, which can be used as the basis for the construction of
66function wrappers and decorator functions.
67
68The wrapt module focuses very much on correctness. It therefore goes
69way beyond existing mechanisms such as functools.wraps() to ensure
70that decorators preserve introspectability, signatures, type checking
71abilities etc. The decorators that can be constructed using this
72module will work in far more scenarios than typical decorators and
73provide more predictable and consistent behaviour.
74
dbb63cef
JB
75%description -n python3-%{module} -l pl.UTF-8
76Celem modułu wrapt jest dostarczenie przezroczystego proxy obiektów
77dla Pythona. Można go używać jako podstawy do konstruowania opakowań
78funkcji lub funkcji dekoratorów.
79
80Moduł wrapt skupia się bardzo na poprawności - wykracza więc poza
81istniejące mechanizmy, tkaie jak functools.wraps(), aby zapewnić, że
82dekoratory zachowują introspekcje, sygnatury, możliwość sprawdzania
83typów itp. Dekoratory tworzone przy użyciu tego modułu będą działać w
84większej liczbie scenariuszy niż typowe dekoratory oraz zapewniać
85bardziej przewidywalne i spójne zachowanie.
86
1504bca3
JK
87%prep
88%setup -q -n %{module}-%{version}
89
90%build
91%if %{with python2}
92%py_build
1c9fceac
JB
93
94%if %{with tests}
95PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
f512b181 96PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
1c9fceac
JB
97%{__python} -m pytest tests
98%endif
1504bca3
JK
99%endif
100
101%if %{with python3}
102%py3_build
1c9fceac
JB
103
104%if %{with tests}
105PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
f512b181 106PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
1c9fceac
JB
107%{__python3} -m pytest tests
108%endif
1504bca3
JK
109%endif
110
111%install
112rm -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
125rm -rf $RPM_BUILD_ROOT
126
127%if %{with python2}
128%files
129%defattr(644,root,root,755)
dbb63cef 130%doc LICENSE README.rst
1504bca3
JK
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)
dbb63cef 140%doc LICENSE README.rst
1504bca3
JK
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.12997 seconds and 4 git commands to generate.