]> git.pld-linux.org Git - packages/python-sure.git/blob - python-sure.spec
- updated to 2.0.0
[packages/python-sure.git] / python-sure.spec
1 # NOTE: sure.cli and sure.stubs are python3-only
2 #
3 # Conditional build:
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module          sure
9 Summary:        Utility belt for automated testing in Python for Python
10 Summary(pl.UTF-8):      Narzędzia do automatycznego testowania w Pythonie
11 Name:           python-%{module}
12 Version:        2.0.0
13 Release:        1
14 License:        GPL v3+
15 Group:          Libraries/Python
16 #Source0Download; https://pypi.org/simple/sure/
17 Source0:        https://files.pythonhosted.org/packages/source/s/sure/%{module}-%{version}.tar.gz
18 # Source0-md5:  2944861acf83042a291ffb1190a56292
19 Patch0:         %{name}-mock.patch
20 URL:            https://github.com/gabrielfalcao/sure
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.7
23 BuildRequires:  python-mock >= 2.0.0
24 BuildRequires:  python-nose
25 BuildRequires:  python-setuptools
26 BuildRequires:  python-six >= 1.16.0
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-devel >= 1:3.4
30 BuildRequires:  python3-nose
31 BuildRequires:  python3-setuptools
32 BuildRequires:  python3-six >= 1.16.0
33 %endif
34 BuildRequires:  rpm-pythonprov
35 BuildRequires:  rpmbuild(macros) >= 1.714
36 Requires:       python-modules >= 1:2.7
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 A testing library for Python with powerful and flexible assertions.
42 Sure is heavily inspired by should.js.
43
44 %description -l pl.UTF-8
45 Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure
46 jest znacząco zainspirowany should.js.
47
48 %package -n python3-%{module}
49 Summary:        Utility belt for automated testing in python for python
50 Summary(pl.UTF-8):      Narzędzia do automatycznego testowania w Pythonie
51 Group:          Libraries/Python
52 Requires:       python3-modules >= 1:3.4
53
54 %description -n python3-%{module}
55 A testing library for Python with powerful and flexible assertions.
56 Sure is heavily inspired by should.js.
57
58 %description -n python3-%{module} -l pl.UTF-8
59 Biblioteka testów dla Pythona z bardzo elastycznymi asercjami. Sure
60 jest znacząco zainspirowany should.js.
61
62 %prep
63 %setup -q -n %{module}-%{version}
64 %patch0 -p1
65
66 %build
67 %if %{with python2}
68 %py_build %{?with_tests:test}
69 %endif
70
71 %if %{with python3}
72 %py3_build %{?with_tests:test}
73 %endif
74
75 %install
76 rm -rf $RPM_BUILD_ROOT
77
78 %if %{with python2}
79 %py_install
80
81 # sure.cli is python3-only (uses f"..." syntax), so this entry point is invalid
82 %{__rm} $RPM_BUILD_ROOT%{_bindir}/sure
83
84 %py_postclean
85 %endif
86
87 %if %{with python3}
88 %py3_install
89
90 %{__mv} $RPM_BUILD_ROOT%{_bindir}/sure{,-3}
91 %endif
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %if %{with python2}
97 %files
98 %defattr(644,root,root,755)
99 %doc README.rst
100 %{py_sitescriptdir}/sure
101 %{py_sitescriptdir}/sure-%{version}-py*.egg-info
102 %endif
103
104 %if %{with python3}
105 %files -n python3-%{module}
106 %defattr(644,root,root,755)
107 %doc README.rst
108 %attr(755,root,root) %{_bindir}/sure-3
109 %{py3_sitescriptdir}/sure
110 %{py3_sitescriptdir}/sure-%{version}-py*.egg-info
111 %endif
This page took 0.064926 seconds and 3 git commands to generate.