[python-dropbox] Initial commit (#982336)

Miro Hrončok churchyard at fedoraproject.org
Thu Jul 18 14:47:07 UTC 2013


commit 2c5bb06a96b6f70c63bd54c764c48e9df7793dea
Author: Miro Hrončok <miro at hroncok.cz>
Date:   Thu Jul 18 16:46:37 2013 +0200

    Initial commit (#982336)

 .gitignore                |    1 +
 dropbox-setup-tests.patch |   57 ++++++++++++++++++++++++
 python-dropbox.spec       |  104 +++++++++++++++++++++++++++++++++++++++++++++
 sources                   |    1 +
 4 files changed, 163 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..87c9974 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/dropbox-python-sdk-1.6.zip
diff --git a/dropbox-setup-tests.patch b/dropbox-setup-tests.patch
new file mode 100644
index 0000000..bd1138b
--- /dev/null
+++ b/dropbox-setup-tests.patch
@@ -0,0 +1,57 @@
+diff --git a/setup.py b/setup.py
+index 58a0ae1..f61ef8a 100755
+--- a/setup.py
++++ b/setup.py
+@@ -37,7 +37,7 @@ setup(name='dropbox',
+       author='Dropbox, Inc.',
+       author_email='support-api at dropbox.com',
+       url='http://www.dropbox.com/',
+-      packages=['dropbox', 'tests'],
++      packages=['dropbox'],
+       install_requires=INSTALL_REQUIRES,
+       package_data={'dropbox': ['trusted-certs.crt'],
+                     'tests' : ['server.crt', 'server.key']},
+diff --git a/tests/test_client.py b/tests/test_client.py
+index 87b0b0b..b74c31d 100755
+--- a/tests/test_client.py
++++ b/tests/test_client.py
+@@ -292,7 +292,7 @@ class TestClientOAuth1(BaseClientTests, unittest.TestCase):
+         sess.set_token(cls.access_key, cls.access_secret)
+ 
+ class TestClientOAuth2(BaseClientTests, unittest.TestCase):
+-    Session = session.DropboxSessionOAuth2
++    Session = session.DropboxOAuth2Session
+ 
+     @classmethod
+     def _configure_session(cls, sess):
+diff --git a/tests/test_session.py b/tests/test_session.py
+index bca077a..f0b34f6 100644
+--- a/tests/test_session.py
++++ b/tests/test_session.py
+@@ -3,7 +3,7 @@ import unittest
+ import urllib
+ import urlparse
+ 
+-from dropbox.session import DropboxSession, DropboxSessionOAuth2
++from dropbox.session import DropboxSession, DropboxOAuth2Session
+ 
+ class ConfigurableSessionTest(unittest.TestCase):
+     def _create_generic_session(self, rest_client, consumer_key='a',
+@@ -14,7 +14,7 @@ class OAuth1Mixin(ConfigurableSessionTest):
+     Session = DropboxSession
+ 
+ class OAuth2Mixin(ConfigurableSessionTest):
+-    Session = DropboxSessionOAuth2
++    Session = DropboxOAuth2Session
+ 
+ class BaseTestClientUsage(object):
+     def test_API_CONTENT_HOST(self):
+@@ -69,7 +69,7 @@ class TestClientUsageOAuth1(OAuth1Mixin, BaseTestClientUsage):
+         self.assertEqual(a.request_token.secret, request_token[1])
+ 
+ class TestClientUsageOAuth2(OAuth2Mixin, BaseTestClientUsage):
+-    Session = DropboxSessionOAuth2
++    Session = DropboxOAuth2Session
+ 
+     def test_build_authorize_url(self):
+         sess = self._create_generic_session(mock.Mock())
diff --git a/python-dropbox.spec b/python-dropbox.spec
new file mode 100644
index 0000000..aaeebbb
--- /dev/null
+++ b/python-dropbox.spec
@@ -0,0 +1,104 @@
+%global with_python3 1
+%global pypi_name dropbox
+Name:           python-%{pypi_name}
+Version:        1.6
+Release:        3%{?dist}
+Summary:        Official Dropbox REST API Client
+License:        MIT
+
+URL:            https://www.dropbox.com/developers/core/sdks
+Source0:        https://www.dropbox.com/static/developers/%{pypi_name}-python-sdk-%{version}.zip
+
+# Don't install tests
+# Correct a mistake in tests
+Patch0:         %{pypi_name}-setup-tests.patch
+
+BuildArch:      noarch
+
+BuildRequires:  python2-devel
+BuildRequires:  python-mock
+BuildRequires:  python-setuptools
+
+%if 0%{with_python3}
+BuildRequires:  python-tools
+BuildRequires:  python3-devel
+BuildRequires:  python3-mock
+BuildRequires:  python3-setuptools
+%endif
+
+%description
+A Python library that for Dropbox's HTTP-based Core API.
+
+%if 0%{?with_python3}
+%package -n python3-%{pypi_name}
+Summary:        Official Dropbox REST API Client
+
+%description -n python3-%{pypi_name}
+A Python library that for Dropbox's HTTP-based Core API.
+%endif # with_python3
+
+%prep
+%setup -q -n %{pypi_name}-python-sdk-%{version}
+%patch0 -p1
+rm -rf %{pypi_name}.egg-info
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|'
+%endif # with_python3
+chmod -x example/*.py example/*/*.py
+
+%build
+%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
+%install
+%{__python} setup.py install --skip-build --root %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif # with_python3
+
+%check
+# some of the test are erroring
+# I believe it's because the tests are wrong written
+%{__python} setup.py test || :
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test || :
+popd
+%endif # with_python3
+
+%files
+%doc README CHANGELOG LICENSE example
+%{python_sitelib}/%{pypi_name}
+%{python_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+
+%if 0%{?with_python3}
+%files -n python3-%{pypi_name}
+# examples don't work with Python 3 (even when 2to3ed)
+%doc README CHANGELOG LICENSE
+%{python3_sitelib}/%{pypi_name}
+%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
+%endif # with_python3
+
+%changelog
+* Wed Jul 17 2013 Miro Hrončok <mhroncok at redhat.com> - 1.6-3
+- Use source package from dropbox.org
+- Added LICENSE
+- chmod -x examples
+- Added BR python-mock
+
+* Wed Jul 10 2013 Miro Hrončok <mhroncok at redhat.com> - 1.6-2
+- Removed duplicate BR python3-setuptools
+- Delete bundled egg-info
+
+* Mon Jul 08 2013 Miro Hrončok <mhroncok at redhat.com> - 1.6-1
+- First package
+
diff --git a/sources b/sources
index e69de29..2411e4b 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+707b0239aa3c711be4fa356a756a632e  dropbox-python-sdk-1.6.zip


More information about the scm-commits mailing list