[python-xmltodict] Initial commit (#891992)

Ralph Bean ralph at fedoraproject.org
Mon Jan 7 15:03:03 UTC 2013


commit 93d480b84d43018237926012bf7ff9170d04141c
Author: Ralph Bean <rbean at redhat.com>
Date:   Mon Jan 7 10:02:49 2013 -0500

    Initial commit (#891992)

 .gitignore            |    1 +
 python-xmltodict.spec |  150 +++++++++++++++++++++++++++++++++++++++++++++++++
 sources               |    1 +
 3 files changed, 152 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..3af3326 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/xmltodict-0.4.2.tar.gz
diff --git a/python-xmltodict.spec b/python-xmltodict.spec
new file mode 100644
index 0000000..5b6d3fa
--- /dev/null
+++ b/python-xmltodict.spec
@@ -0,0 +1,150 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%{!?py3ver: %global py3ver %(%{__python3} -c "import sys ; print(sys.version[:3])")}
+%endif
+%{!?py2ver: %global py2ver %(%{__python} -c "import sys ; print sys.version[:3]")}
+
+
+%global modname xmltodict
+
+Name:               python-xmltodict
+Version:            0.4.2
+Release:            1%{?dist}
+Summary:            Makes working with XML feel like you are working with JSON
+
+Group:              Development/Libraries
+License:            MIT
+URL:                http://pypi.python.org/pypi/xmltodict
+Source0:            http://pypi.python.org/packages/source/x/%{modname}/%{modname}-%{version}.tar.gz
+
+BuildArch:          noarch
+
+BuildRequires:      python2-devel
+BuildRequires:      python-nose
+
+%if 0%{?with_python3}
+BuildRequires:      python3-devel
+BuildRequires:      python3-nose
+%endif
+
+%description
+xmltodict is a Python module that makes working with XML feel like you are
+working with JSON.  It's very fast (Expat-based) and has a streaming mode
+with a small memory footprint, suitable for big XML dumps like Discogs or
+Wikipedia.
+
+    >>> doc = xmltodict.parse("""
+    ... <mydocument has="an attribute">
+    ...   <and>
+    ...     <many>elements</many>
+    ...     <many>more elements</many>
+    ...   </and>
+    ...   <plus a="complex">
+    ...     element as well
+    ...   </plus>
+    ... </mydocument>
+    ... """)
+    >>>
+    >>> doc['mydocument']['@has']
+    u'an attribute'
+    >>> doc['mydocument']['and']['many']
+    [u'elements', u'more elements']
+    >>> doc['mydocument']['plus']['@a']
+    u'complex'
+    >>> doc['mydocument']['plus']['#text']
+    u'element as well'
+
+
+%if 0%{?with_python3}
+%package -n python3-xmltodict
+Summary:            Makes working with XML feel like you are working with JSON
+Group:              Development/Libraries
+
+Requires:   python3
+
+%description -n python3-xmltodict
+xmltodict is a Python module that makes working with XML feel like you are
+working with JSON.  It's very fast (Expat-based) and has a streaming mode
+with a small memory footprint, suitable for big XML dumps like Discogs or
+Wikipedia.
+
+    >>> doc = xmltodict.parse("""
+    ... <mydocument has="an attribute">
+    ...   <and>
+    ...     <many>elements</many>
+    ...     <many>more elements</many>
+    ...   </and>
+    ...   <plus a="complex">
+    ...     element as well
+    ...   </plus>
+    ... </mydocument>
+    ... """)
+    >>>
+    >>> doc['mydocument']['@has']
+    u'an attribute'
+    >>> doc['mydocument']['and']['many']
+    [u'elements', u'more elements']
+    >>> doc['mydocument']['plus']['@a']
+    u'complex'
+    >>> doc['mydocument']['plus']['#text']
+    u'element as well'
+%endif
+
+%prep
+%setup -q -n %{modname}-%{version}
+
+# Remove bundled egg-info in case it exists
+rm -rf %{modname}.egg-info
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
+
+%build
+%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
+
+
+%install
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
+popd
+%endif
+%{__python} setup.py install -O1 --skip-build --root=%{buildroot}
+
+%check
+nosetests-%{py2ver}
+%if 0%{?with_python3}
+pushd %{py3dir}
+nosetests-%{py3ver}
+popd
+%endif
+
+%files
+%doc README.md LICENSE PKG-INFO
+%{python_sitelib}/%{modname}.py*
+%{python_sitelib}/%{modname}-%{version}*
+
+%if 0%{?with_python3}
+%files -n python3-xmltodict
+%doc README.md LICENSE PKG-INFO
+%{python3_sitelib}/%{modname}.py
+%{python3_sitelib}/%{modname}-%{version}-*
+%{python3_sitelib}/__pycache__/%{modname}*
+%endif
+
+%changelog
+* Fri Jan 04 2013 Ralph Bean <rbean at redhat.com> - 0.4.2-1
+- Latest upstream
+- Included README and LICENSE
+- Running tests now
+- https://github.com/martinblech/xmltodict/pull/11
+- Added Requires python3 to the python3 subpackage.
+
+* Fri Jan 04 2013 Ralph Bean <rbean at redhat.com> - 0.4.1-1
+- Initial packaging for Fedora
diff --git a/sources b/sources
index e69de29..2252d45 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+29e60a42a3df1694b7456b8245184650  xmltodict-0.4.2.tar.gz


More information about the scm-commits mailing list