diff --git a/.gitignore b/.gitignore index e69de29..5e9bf8a 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/0.4.3.tar.gz diff --git a/python-etcd-0.4.3-auth-test-fail-workaround.patch b/python-etcd-0.4.3-auth-test-fail-workaround.patch new file mode 100644 index 0000000..608f37a --- /dev/null +++ b/python-etcd-0.4.3-auth-test-fail-workaround.patch @@ -0,0 +1,25 @@ +commit 927fdb160e9b197ee24ce05e8289f5d2def526dc +Author: Matthew Barnes +Date: Sun Mar 6 20:23:58 2016 -0500 + + Work around EtcdRoleTest failure in test_read() + +diff --git a/src/etcd/tests/test_auth.py b/src/etcd/tests/test_auth.py +index fc6ce70..14475f9 100644 +--- a/src/etcd/tests/test_auth.py ++++ b/src/etcd/tests/test_auth.py +@@ -127,7 +127,13 @@ class EtcdRoleTest(TestEtcdAuthBase): + except: + self.fail('Reading an existing role failed') + +- self.assertEquals(r.acls, {'*': 'RW'}) ++ # XXX The ACL path result changed from '*' to '/*' at some point ++ # between etcd-2.2.2 and 2.2.5. They're equivalent so allow ++ # for both. ++ if '/*' in r.acls: ++ self.assertEquals(r.acls, {'/*': 'RW'}) ++ else: ++ self.assertEquals(r.acls, {'*': 'RW'}) + # We can actually skip most other read tests as they are common + # with EtcdUser + diff --git a/python-etcd.spec b/python-etcd.spec new file mode 100644 index 0000000..28664eb --- /dev/null +++ b/python-etcd.spec @@ -0,0 +1,97 @@ +%global srcname python-etcd + +Name: %{srcname} +Version: 0.4.3 +Release: 1%{?dist} +Summary: A python client library for etcd + +License: MIT +URL: http://pypi.python.org/pypi/%{srcname} + +# Using the github URL because the tarball file at pypi excludes +# the license file. But github tarball files are named awkwardly. +Source0: https://github.com/jplana/%{srcname}/archive/%{version}.tar.gz + +#VCS: git:https://github.com/jplana/python-etcd + +BuildArch: noarch + +BuildRequires: python2-devel +BuildRequires: python-dns +BuildRequires: python-mock +BuildRequires: python-nose +BuildRequires: pyOpenSSL + +BuildRequires: python3-devel +BuildRequires: python3-dns +BuildRequires: python3-mock +BuildRequires: python3-nose +BuildRequires: python3-pyOpenSSL + +# Needed for tests +BuildRequires: etcd + +Patch1: python-etcd-0.4.3-auth-test-fail-workaround.patch + +%description +Client library for interacting with an etcd service, providing Python +access to the full etcd REST API. Includes authentication, accessing +and manipulating shared content, managing cluster members, and leader +election. + +%package -n python2-%{srcname} +Summary: %summary +Requires: etcd +Requires: python-dns +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +Client library for interacting with an etcd service, providing Python +access to the full etcd REST API. Includes authentication, accessing +and manipulating shared content, managing cluster members, and leader +election. + +%package -n python3-%{srcname} +Summary: %summary +Requires: etcd +Requires: python3-dns +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +Client library for interacting with an etcd service, providing Python +access to the full etcd REST API. Includes authentication, accessing +and manipulating shared content, managing cluster members, and leader +election. + +%prep +%autosetup -p1 + +%build +%py2_build +%py3_build + +%install +%py2_install +%py3_install + +%check +%{__python2} setup.py test + +# This seems to require a newer python3-mock than what's currently available +# in F23, and even Rawhide. If I let it download mock-1.3.0 from the Python +# Package Index (pypi) then tests pass. +#%%{__python3} setup.py test + +%files -n python2-%{srcname} +%doc README.rst +%license LICENSE.txt +%{python2_sitelib}/* + +%files -n python3-%{srcname} +%doc README.rst +%license LICENSE.txt +%{python3_sitelib}/* + +%changelog +* Mon Feb 22 2016 Matthew Barnes - 0.4.3-1 +- Initial packaging. diff --git a/sources b/sources index e69de29..aaac7fe 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +f7ae93c7578f82abd550e4053d929431 0.4.3.tar.gz