diff --git a/.gitignore b/.gitignore index e95efa8..44d877b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,10 @@ /pygit2-0.21.2.tar.gz /pygit2-0.21.3.tar.gz /pygit2-0.21.4.tar.gz +/pygit2-0.22.0.tar.gz +/pygit2-0.22.1.tar.gz +/pygit2-0.23.1.tar.gz +/pygit2-0.23.3.tar.gz +/pygit2-0.24.0.tar.gz +/pygit2-0.24.1.tar.gz +/pygit2-0.24.2.tar.gz diff --git a/0001-Remove-remote-calling-unit-tests.patch b/0001-Remove-remote-calling-unit-tests.patch index d26182f..131fee7 100644 --- a/0001-Remove-remote-calling-unit-tests.patch +++ b/0001-Remove-remote-calling-unit-tests.patch @@ -1,56 +1,58 @@ -From c846d973b2797ad52fa6991f86f0794c8373d961 Mon Sep 17 00:00:00 2001 -From: Mathieu Bridon -Date: Fri, 19 Sep 2014 17:25:38 +0200 +From f1f5d489da6c0a710563d517b11c116ea41d90ec Mon Sep 17 00:00:00 2001 +From: Mathieu Bridon +Date: Wed, 21 Jan 2015 09:33:46 +0100 Subject: [PATCH] Remove remote-calling unit tests These can only fail when building in Koji, as the builder can't access the Internet. --- - test/test_credentials.py | 18 ------------------ - test/test_repository.py | 8 -------- - 2 files changed, 26 deletions(-) + test/test_credentials.py | 21 --------------------- + test/test_repository.py | 7 ------- + 2 files changed, 28 deletions(-) diff --git a/test/test_credentials.py b/test/test_credentials.py -index 3bdeb6f..22dbacc 100644 +index 92482d9..36263c0 100644 --- a/test/test_credentials.py +++ b/test/test_credentials.py -@@ -71,23 +71,5 @@ class CredentialCallback(utils.RepoTestCase): +@@ -81,26 +81,5 @@ class CredentialCallback(utils.RepoTestCase): - self.assertRaises(Exception, remote.fetch) + self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks())) - def test_bad_cred_type(self): -- def credentials_cb(url, username, allowed): -- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) -- return Keypair("git", "foo.pub", "foo", "sekkrit") +- class MyCallbacks(pygit2.RemoteCallbacks): +- @staticmethod +- def credentials(url, username, allowed): +- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) +- return Keypair("git", "foo.pub", "foo", "sekkrit") - -- remote = self.repo.create_remote("github", "https://github.com/github/github") -- remote.credentials = credentials_cb -- -- self.assertRaises(TypeError, remote.fetch) +- url = "https://github.com/github/github" +- remote = self.repo.create_remote("github", url) +- self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks())) - -class CallableCredentialTest(utils.RepoTestCase): - - def test_user_pass(self): -- remote = self.repo.create_remote("bb", "https://bitbucket.org/libgit2/testgitrepository.git") -- remote.credentials = UserPass("libgit2", "libgit2") +- credentials = UserPass("libgit2", "libgit2") +- callbacks = pygit2.RemoteCallbacks(credentials=credentials) - -- remote.fetch() +- url = "https://bitbucket.org/libgit2/testgitrepository.git" +- remote = self.repo.create_remote("bb", url) +- remote.fetch(callbacks=callbacks) - if __name__ == '__main__': unittest.main() diff --git a/test/test_repository.py b/test/test_repository.py -index 72a5e64..9cbca66 100644 +index 5590ea2..a2f16ca 100644 --- a/test/test_repository.py +++ b/test/test_repository.py -@@ -454,14 +454,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): - clone_into(repo, remote) - self.assertTrue('refs/remotes/origin/master' in repo.listall_references()) +@@ -527,13 +527,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): + self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references()) + self.assertIsNotNone(repo.remotes["custom_remote"]) - def test_clone_with_credentials(self): -- credentials = pygit2.UserPass("libgit2", "libgit2") - repo = clone_repository( - "https://bitbucket.org/libgit2/testgitrepository.git", -- self._temp_dir, credentials=credentials) +- self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2"))) - - self.assertFalse(repo.is_empty) - @@ -58,5 +60,5 @@ index 72a5e64..9cbca66 100644 # create a test case which isolates the remote test_repo = clone_repository('./test/data/testrepo.git', -- -2.1.0 +2.9.0 diff --git a/python-pygit2.spec b/python-pygit2.spec index 43ca8f6..d7395a9 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -2,53 +2,52 @@ %global with_python3 1 %endif -# Define modern python2 macros for el6. -%if 0%{?rhel} && 0%{?rhel} <= 6 -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -%endif - %global pkgname pygit2 Name: python-%{pkgname} -Version: 0.21.4 -Release: 3%{?dist} +Version: 0.24.2 +Release: 1%{?dist} Summary: Python 2.x bindings for libgit2 -URL: http://www.pygit2.org -Source: http://pypi.python.org/packages/source/p/%{pkgname}/%{pkgname}-%{version}.tar.gz + License: GPLv2 with linking exception +URL: http://www.pygit2.org +Source0: https://github.com/libgit2/%{pkgname}/archive/v%{version}/%{pkgname}-%{version}.tar.gz + +Patch0001: 0001-Remove-remote-calling-unit-tests.patch + BuildRequires: libgit2-devel BuildRequires: openssl-devel BuildRequires: python-cffi BuildRequires: python2-devel BuildRequires: python-nose BuildRequires: python-setuptools +BuildRequires: python-six Requires: python-cffi >= 1.6.0-5.el7 - -Patch0: 0001-Remove-remote-calling-unit-tests.patch +Requires: python-six %description -pygit2 is a set of Python bindings to the libgit2 library, which implements -the core of Git. Pygit2 works with Python 2.7, 3.1, 3.2, 3.3 and 3.4. +pygit2 is a set of Python bindings to the libgit2 library, which implements +the core of Git. %if 0%{?with_python3} %package -n python3-%{pkgname} Summary: Python 3.x bindings for libgit2 +%{?python_provide:%python_provide python3-%{pkgname}} BuildRequires: python3-cffi BuildRequires: python3-devel BuildRequires: python3-nose BuildRequires: python3-setuptools - +BuildRequires: python3-six Requires: python3-cffi +Requires: python3-six %description -n python3-%{pkgname} -pygit2 is a set of Python bindings to the libgit2 library, which implements -the core of Git. Pygit2 works with Python 2.7, 3.1, 3.2, 3.3 and 3.4. +pygit2 is a set of Python bindings to the libgit2 library, which implements +the core of Git. -This is the python3 subpackage. +Python 3 version. %endif @@ -56,44 +55,33 @@ This is the python3 subpackage. Summary: Documentation for %{name} BuildArch: noarch BuildRequires: python-sphinx -Requires: %{name} = %{version}-%{release} %description doc Documentation for %{name}. %prep -%setup -qn %{pkgname}-%{version} - -%patch0 -p1 - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif +%autosetup -n %{pkgname}-%{version} -p1 %build -CFLAGS="%{optflags}" %{__python2} setup.py build +%py2_build make -C docs html %if 0%{?with_python3} -pushd %{py3dir} -CFLAGS="%{optflags}" %{__python3} setup.py build -popd +%py3_build %endif %install -%{__python2} setup.py install --prefix=%{_prefix} -O1 --skip-build --root=%{buildroot} +%py2_install %if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --prefix=%{_prefix} -O1 --skip-build --root=%{buildroot} -popd +%py3_install %endif find %{_builddir} -name '.buildinfo' -delete + # Correct the permissions. find %{buildroot} -name '*.so' -exec chmod 755 {} ';' @@ -102,9 +90,7 @@ find %{buildroot} -name '*.so' -exec chmod 755 {} ';' %{__python2} setup.py test %if 0%{?with_python3} -pushd %{py3dir} %{__python3} setup.py test -popd %endif @@ -114,7 +100,6 @@ popd %{python2_sitearch}/%{pkgname}-%{version}-py%{python2_version}.egg-info %{python2_sitearch}/%{pkgname} %{python2_sitearch}/_%{pkgname}.so -%{python2_sitearch}/%{pkgname}_cffi_*.so %if 0%{?with_python3} %files -n python3-%{pkgname} @@ -123,14 +108,17 @@ popd %{python3_sitearch}/%{pkgname}-%{version}-py%{python3_version}.egg-info %{python3_sitearch}/%{pkgname} %{python3_sitearch}/_%{pkgname}.*.so -%{python3_sitearch}/%{pkgname}_cffi_*.so %endif %files doc +%license COPYING %doc docs/_build/html/* %changelog +* Thu Apr 13 2017 Pete Walter - 0.24.2-1 +- Update to 0.24.2 + * Fri Feb 10 2017 Kevin Fenzi - 0.21.4-3 - Rebuild for python-cffi update in rhel. Fixes bug #1400668 diff --git a/sources b/sources index 439b191..cbd8d8e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8a3d02eded2bef2e0af18172814eec32 pygit2-0.21.4.tar.gz +8c3b4893f3e3ae2937101e69863146fe pygit2-0.24.2.tar.gz