]>
Commit | Line | Data |
---|---|---|
57784c4e ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | ||
5 | %define module bunch | |
6 | Summary: Python dictionary with attribute-style access | |
7 | Name: python-bunch | |
8 | Version: 1.0.1 | |
af600d8b | 9 | Release: 2 |
57784c4e ER |
10 | License: MIT |
11 | Group: Development/Languages | |
12 | Source0: http://pypi.python.org/packages/source/b/bunch/bunch-%{version}.tar.gz | |
13 | # Source0-md5: 0a829d64e95ed96defbcae2bf9061bb0 | |
14 | URL: http://github.com/dsc/bunch | |
15 | BuildRequires: dos2unix | |
57784c4e ER |
16 | BuildRequires: python-nose |
17 | BuildRequires: python-setuptools | |
3390ca0d | 18 | BuildRequires: rpm-pythonprov |
57784c4e ER |
19 | BuildArch: noarch |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
21 | ||
22 | %description | |
23 | python-bunch provides a Python class which can perform as a dict whose | |
24 | keys are also accessible as attributes, similar to JavaScript objects. | |
25 | ||
26 | The piece of python-bunch that sets it apart from similar modules | |
27 | found inside other projects is the bunchify() function which | |
28 | recursively converts from a dict to a Bunch. | |
29 | ||
30 | %prep | |
31 | %setup -q -n %{module}-%{version} | |
32 | dos2unix LICENSE.txt README.rst | |
33 | ||
34 | %build | |
1aec34b1 | 35 | %py_build |
57784c4e ER |
36 | |
37 | %if %{with tests} | |
38 | PYTHONPATH=build/lib nosetests-%{py_ver} --with-doctest | |
39 | PYTHONPATH=build/lib %{__python} build/lib/bunch/test.py | |
40 | %endif | |
41 | ||
42 | %install | |
43 | rm -rf $RPM_BUILD_ROOT | |
1aec34b1 | 44 | %py_install |
57784c4e ER |
45 | |
46 | rm $RPM_BUILD_ROOT%{py_sitescriptdir}/bunch/test.* | |
47 | ||
48 | %py_postclean | |
49 | ||
50 | %clean | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | ||
53 | ||
54 | %files | |
55 | %defattr(644,root,root,755) | |
56 | %doc LICENSE.txt README.rst | |
57 | %{py_sitescriptdir}/bunch | |
58 | %{py_sitescriptdir}/bunch-%{version}-py*.egg-info |