summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python-bunch.spec57
1 files changed, 57 insertions, 0 deletions
diff --git a/python-bunch.spec b/python-bunch.spec
new file mode 100644
index 0000000..090de79
--- /dev/null
+++ b/python-bunch.spec
@@ -0,0 +1,57 @@
+%{?scl:%scl_package python-bunch}
+%{!?scl:%global pkg_name %{name}}
+
+%global srcname bunch
+
+Name: %{?scl_prefix}python-bunch
+Version: 1.0.1
+Release: 11%{?dist}
+Summary: Python dictionary with attribute-style access
+
+Group: Development/Languages
+License: MIT
+URL: http://github.com/dsc/bunch
+Source0: https://pypi.python.org/packages/ef/bf/a4cf1779a4ffb4f610903fa08e15d1f4a8a2f4e3353a02afbe097c5bf4a8/bunch-1.0.1.tar.gz
+
+BuildArch: noarch
+BuildRequires: %{?scl_prefix}python-devel
+BuildRequires: %{?scl_prefix}python-setuptools
+
+%description
+python-bunch provides a python class which can perform as a dict whose keys are
+also accessible as attributes, similar to JavaScript objects. For instance::
+
+ >>> import bunch
+ >>> people = bunch.Bunch({'alice': 'here', 'bob': 'there'})
+ >>> print people['alice'], people.alice
+ here here
+
+The piece of python-bunch that sets it apart from similar modules found inside
+other projects is the bunchify() function which recursively converts from
+a dict to a Bunch::
+
+ >>> multi_level = {'array': ['scalar', {'mapping': 'to show recursion'} ]}
+ >>> bunch.bunchify(multi_level)
+ Bunch(array=['scalar', Bunch(mapping='to show recursion')])
+
+%prep
+%setup -q -n %{srcname}-%{version}
+
+%build
+%{?scl:scl enable %{scl} - << \EOF}
+PBR_VERSION=%{version} %{__python3} setup.py build
+%{?scl:EOF}
+
+%install
+%{?scl:scl enable %{scl} - << \EOF}
+PBR_VERSION=%{version} %{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+%{?scl:EOF}
+rm %{buildroot}%{python_sitelib}/bunch/test.*
+
+%files
+%{python_sitelib}/*
+
+
+%changelog
+* Fri Mar 02 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 1.0.1-11
+- Fedora package import