[python-restkit] Initial import #806777
Bohuslav Kabrda
bkabrda at fedoraproject.org
Tue Mar 27 13:53:26 UTC 2012
commit d6b1109351446e9954c8eb066d4721b770690bc1
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date: Tue Mar 27 15:53:19 2012 +0200
Initial import #806777
.gitignore | 1 +
python-restkit.spec | 64 ++++++++++++++++++++
...disable-tests-needing-internet-connection.patch | 53 ++++++++++++++++
sources | 1 +
4 files changed, 119 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..b20e53b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/restkit-4.1.2.tar.gz
diff --git a/python-restkit.spec b/python-restkit.spec
new file mode 100644
index 0000000..95ea8c7
--- /dev/null
+++ b/python-restkit.spec
@@ -0,0 +1,64 @@
+%global pypi_name restkit
+
+Name: python-%{pypi_name}
+Version: 4.1.2
+Release: 2%{?dist}
+Summary: Restkit is an HTTP resource kit for Python
+License: MIT
+URL: http://benoitc.github.com/restkit/
+Source0: http://pypi.python.org/packages/source/r/restkit/restkit-4.1.2.tar.gz
+Patch0: restkit-disable-tests-needing-internet-connection.patch
+BuildArch: noarch
+
+Requires: python-socketpool
+Requires: python-http-parser >= 0.7.4
+Requires: python-webob
+
+BuildRequires: python-devel
+BuildRequires: python-setuptools
+BuildRequires: python-nose
+BuildRequires: python-socketpool
+BuildRequires: python-http-parser >= 0.7.4
+BuildRequires: python-webob
+
+%description
+Restkit is a full HTTP client using pure socket calls and its own
+HTTP parser. It's not based on httplib or urllib2.
+
+%prep
+%setup -q -n %{pypi_name}-%{version}
+# remove bundled egg-info
+rm -rf %{pypi_name}.egg-info
+
+%patch0 -p0
+
+%build
+%{__python} setup.py build
+
+
+%install
+%{__python} setup.py install -O1 --skip-build --root %{buildroot} --install-data %{_docdir}
+# remove zero-length file
+rm %{buildroot}%{_docdir}/%{pypi_name}/TODO.txt
+# strip shebang from non-executable file
+sed -i '1d' %{buildroot}%{python_sitelib}/%{pypi_name}/contrib/webob_api.py
+
+
+%check
+nosetests --exclude="009-test-oauth_filter"
+
+%files
+%doc %{_docdir}/%{pypi_name}/
+%{_bindir}/restcli
+%{python_sitelib}/restkit*
+# exclude the test files that get into %%{python_sitelib}
+%exclude %{python_sitelib}/tests
+
+%changelog
+* Tue Mar 27 2012 Bohuslav Kabrda <bkabrda at redhat.com> - 4.1.2-2
+- Remove IPython dependency (it is only optional).
+- Stripped the shebang from non-executable file.
+
+* Thu Mar 22 2012 Bohuslav Kabrda <bkabrda at redhat.com> - 4.1.2-1
+- Initial package.
+
diff --git a/restkit-disable-tests-needing-internet-connection.patch b/restkit-disable-tests-needing-internet-connection.patch
new file mode 100644
index 0000000..a8efeb9
--- /dev/null
+++ b/restkit-disable-tests-needing-internet-connection.patch
@@ -0,0 +1,53 @@
+--- tests/004-test-client.py.orig 2012-01-20 17:39:18.000000000 +0100
++++ tests/004-test-client.py 2012-03-23 11:51:14.079946644 +0100
+@@ -112,29 +112,29 @@
+ t.eq(r.body_string(), "ok")
+
+
+- at t.client_request('http://e-engura.com/images/logo.gif')
+-def test_007(u, c):
+- r = c.request(u)
+- print r.status
+- t.eq(r.status_int, 200)
+- fd, fname = tempfile.mkstemp(suffix='.gif')
+- f = os.fdopen(fd, "wb")
+- f.write(r.body_string())
+- f.close()
+- t.eq(imghdr.what(fname), 'gif')
++#@t.client_request('http://e-engura.com/images/logo.gif')
++#def test_007(u, c):
++# r = c.request(u)
++# print r.status
++# t.eq(r.status_int, 200)
++# fd, fname = tempfile.mkstemp(suffix='.gif')
++# f = os.fdopen(fd, "wb")
++# f.write(r.body_string())
++# f.close()
++# t.eq(imghdr.what(fname), 'gif')
+
+
+- at t.client_request('http://e-engura.com/images/logo.gif')
+-def test_008(u, c):
+- r = c.request(u)
+- t.eq(r.status_int, 200)
+- fd, fname = tempfile.mkstemp(suffix='.gif')
+- f = os.fdopen(fd, "wb")
+- with r.body_stream() as body:
+- for block in body:
+- f.write(block)
+- f.close()
+- t.eq(imghdr.what(fname), 'gif')
++#@t.client_request('http://e-engura.com/images/logo.gif')
++#def test_008(u, c):
++# r = c.request(u)
++# t.eq(r.status_int, 200)
++# fd, fname = tempfile.mkstemp(suffix='.gif')
++# f = os.fdopen(fd, "wb")
++# with r.body_stream() as body:
++# for block in body:
++# f.write(block)
++# f.close()
++# t.eq(imghdr.what(fname), 'gif')
+
+
+ @t.client_request('/redirect')
diff --git a/sources b/sources
index e69de29..d88964d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+6a405efbf109d0fca13095237c8aae6e restkit-4.1.2.tar.gz
More information about the scm-commits
mailing list