]> git.pld-linux.org Git - SPECS.git/blob - python-chai.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / python-chai.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define module  chai
8 Summary:        Easy to use mocking/stub/spy framework
9 Name:           python-%{module}
10 Version:        1.0.0
11 Release:        9
12 License:        BSD
13 Group:          Development/Libraries
14 Source0:        http://pypi.python.org/packages/source/c/%{module}/%{module}-%{version}.tar.gz
15 # Source0-md5:  fce8d1deb08ef6c1fb2b56eea7ae7b67
16 URL:            http://pypi.python.org/pypi/chai
17 BuildRequires:  rpmbuild(macros) >= 1.710
18 BuildRequires:  python-devel
19 BuildRequires:  python-nose
20 BuildRequires:  python-setuptools
21 BuildRequires:  rpm-pythonprov
22 %if %{with python3}
23 BuildRequires:  python3-devel
24 BuildRequires:  python3-nose
25 BuildRequires:  python3-setuptools
26 %endif
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 Chai provides a very easy to use API for mocking/stubbing your Python
32 objects, patterned after the Mocha <http://mocha.rubyforge.org/>
33 library for Ruby.
34
35 %package -n python3-%{module}
36 Summary:        Easy to use mocking/stub framework
37 Group:          Development/Libraries
38
39 %description -n python3-%{module}
40 Chai provides a very easy to use API for mocking/stubbing your python
41 objects, patterned after the Mocha <http://mocha.rubyforge.org/>
42 library for Ruby.
43
44 %prep
45 %setup -q -n %{module}-%{version}
46
47 # Remove bundled egg-info in case it exists
48 rm -r %{module}.egg-info
49
50 %build
51 %if %{with python2}
52 %py_build %{?with_tests:test}
53 %endif
54
55 %if %{with python3}
56 # Remove python2 compatibility files
57 # Makes tests fail and are not needed on python3
58 rm chai/python2.py
59 rm tests/comparator_py2.py
60 # signature mismatch
61 rm tests/stub_test.py
62
63 %py3_build %{?with_tests:test}
64 %endif
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 %if %{with python2}
69 %py_install
70
71 %py_postclean
72 %endif
73
74 %if %{with python3}
75 %py3_install
76 %endif
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 %files
82 %defattr(644,root,root,755)
83 %doc README.rst LICENSE.txt
84 %{py_sitescriptdir}/chai
85 %{py_sitescriptdir}/chai-%{version}-py*.egg-info
86
87 %if %{with python3}
88 %files -n python3-%{module}
89 %defattr(644,root,root,755)
90 %doc README.rst LICENSE.txt
91 %{py3_sitescriptdir}/chai
92 %{py3_sitescriptdir}/chai-%{version}-py*.egg-info
93 %endif
This page took 0.120735 seconds and 3 git commands to generate.