dev-python/pygit2: Bump to 0.26.1
authorMichał Górny <mgorny@gentoo.org>
Tue, 21 Nov 2017 07:23:12 +0000 (08:23 +0100)
committerMichał Górny <mgorny@gentoo.org>
Tue, 21 Nov 2017 17:47:52 +0000 (18:47 +0100)
dev-python/pygit2/Manifest
dev-python/pygit2/files/pygit2-0.26.1-internet-tests.patch [new file with mode: 0644]
dev-python/pygit2/pygit2-0.26.1.ebuild [new file with mode: 0644]

index 2c744d8c47a026666d96305cbccbf247fbe8b071..e7cf7e20aafdabfd1fbbfb2542856316e7c0abc4 100644 (file)
@@ -1,3 +1,4 @@
 DIST pygit2-0.25.0.tar.gz 472116 SHA256 de0ed85fd840dfeb32bcaa94c643307551dc0d967c3714e49087e7edc0cdc571 SHA512 44f94869718111acbd4ad41bc4c37ac66557e979241dd5a7bb080cf091fec3fc3d5aa53a8a84eb37b2e6f89518b2ac69d058e1970b7cf98c35b8375807fd8f86 WHIRLPOOL 71d8eb87ef9cd2a1d77ecc1258d5d02f2d0075144fc81556e8a2c0b599202cf17b06c548767b956748feaa13d3ece0d3a664cfe95ab93004e345890805c58175
 DIST pygit2-0.25.1.tar.gz 456580 SHA256 e8696033052fa0221114ee7f632d38777cc29e58230cd6a05de5725cd31b4a6a SHA512 19908c874d5c2469609a54893f37367480d27ff03583c38b474ebb125dc9db95dc60776a120bb05662938d6eb62d4bcef24f684688e97e3453ccc27e015736cd WHIRLPOOL 648aabcecde66fd5b1d3cf840c51693c237e75f9da7bb793e4e9c18537cb12e4b35d5dced17389bb24440a4c72f37175e1a0a5e44a9c69811c54cf60d11f7d3f
 DIST pygit2-0.26.0.tar.gz 457263 SHA256 a7f06d61f25ab644c39e0e9bd4846a6cc4af81ae27f889473e6f0e9511226cb1 SHA512 e8626712a3b75aced14997dda0155f5c7be9a7e0e43aeb2c767c848fcbe711780137f663cc9ad5268cd85e2c61fd40be6853573f68b457cd5d46d6c32a644076 WHIRLPOOL 909d3d4f06c04107309b53653f5395f76de61195269ba753b7658725a27235ede94df48b74b547a2bafef7e20f8916c01f6d7d7f2e434965621364d51f4e32fa
+DIST pygit2-0.26.1.tar.gz 458526 BLAKE2B 703093a5a292e92c90987785065f3a1590addc09d72311f75b22caf6fe1a17be8fb16cf777189835204cb7dc4d2066e841d3d4327e2cc040c312e22a4c75a8ee SHA512 23585bc0f41458442889b5434347cbc11d6c729898864262426f84e5b9239164bb58c6e910d2381b25f1b8be271674c1a6960630a504c40accdd30e487d27a7d
diff --git a/dev-python/pygit2/files/pygit2-0.26.1-internet-tests.patch b/dev-python/pygit2/files/pygit2-0.26.1-internet-tests.patch
new file mode 100644 (file)
index 0000000..6b96eb4
--- /dev/null
@@ -0,0 +1,133 @@
+From 24a929d003f1b6b4899f41cb227293e8c4b62eb7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 21 Nov 2017 17:53:48 +0100
+Subject: [PATCH] Disable tests requiring network access
+
+---
+ test/test_credentials.py | 3 +++
+ test/test_repository.py  | 1 +
+ test/test_submodule.py   | 4 ++++
+ 3 files changed, 8 insertions(+)
+
+diff --git a/test/test_credentials.py b/test/test_credentials.py
+index 7921a41..e60383a 100644
+--- a/test/test_credentials.py
++++ b/test/test_credentials.py
+@@ -70,39 +70,42 @@ class CredentialCreateTest(utils.NoRepoTestCase):
+         username = "git"
+  
+         cred = KeypairFromAgent(username)
+         self.assertEqual((username, None, None, None), cred.credential_tuple)
+ class CredentialCallback(utils.RepoTestCase):
++    @unittest.skip('requires Internet access')
+     def test_callback(self):
+         class MyCallbacks(pygit2.RemoteCallbacks):
+             @staticmethod
+             def credentials(url, username, allowed):
+                 self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
+                 raise Exception("I don't know the password")
+         url = "https://github.com/github/github"
+         remote = self.repo.create_remote("github", url)
+         self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks()))
++    @unittest.skip('requires Internet access')
+     def test_bad_cred_type(self):
+         class MyCallbacks(pygit2.RemoteCallbacks):
+             @staticmethod
+             def credentials(url, username, allowed):
+                 self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
+                 return Keypair("git", "foo.pub", "foo", "sekkrit")
+         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):
++    @unittest.skip('requires Internet access')
+     def test_user_pass(self):
+         credentials = UserPass("libgit2", "libgit2")
+         callbacks = pygit2.RemoteCallbacks(credentials=credentials)
+         url = "https://bitbucket.org/libgit2/testgitrepository.git"
+         remote = self.repo.create_remote("bb", url)
+         remote.fetch(callbacks=callbacks)
+diff --git a/test/test_repository.py b/test/test_repository.py
+index 941851b..33f0571 100644
+--- a/test/test_repository.py
++++ b/test/test_repository.py
+@@ -569,14 +569,15 @@ class CloneRepositoryTest(utils.NoRepoTestCase):
+             return repo.remotes.create("custom_remote", url)
+         repo = clone_repository(url, repo_path, repository=create_repository, remote=create_remote)
+         self.assertFalse(repo.is_empty)
+         self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references())
+         self.assertIsNotNone(repo.remotes["custom_remote"])
++    @unittest.skip('requires Internet access')
+     def test_clone_with_credentials(self):
+         repo = clone_repository(
+             "https://bitbucket.org/libgit2/testgitrepository.git",
+             self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2")))
+         self.assertFalse(repo.is_empty)
+diff --git a/test/test_submodule.py b/test/test_submodule.py
+index f123b8b..df44e16 100644
+--- a/test/test_submodule.py
++++ b/test/test_submodule.py
+@@ -49,14 +49,15 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase):
+         self.assertIsNotNone(s)
+     def test_listall_submodules(self):
+         submodules = self.repo.listall_submodules()
+         self.assertEqual(len(submodules), 1)
+         self.assertEqual(submodules[0], SUBM_PATH)
++    @unittest.skip('requires Internet access')
+     def test_submodule_open(self):
+         s = self.repo.lookup_submodule(SUBM_PATH)
+         self.repo.init_submodules()
+         self.repo.update_submodules()
+         r = s.open()
+         self.assertIsNotNone(r)
+         self.assertEqual(str(r.head.target), SUBM_HEAD_SHA)
+@@ -69,28 +70,31 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase):
+         s = self.repo.lookup_submodule(SUBM_PATH)
+         self.assertEqual(SUBM_PATH, s.path)
+     def test_url(self):
+         s = self.repo.lookup_submodule(SUBM_PATH)
+         self.assertEqual(SUBM_URL, s.url)
++    @unittest.skip('requires Internet access')
+     def test_init_and_update(self):
+         subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py')
+         self.assertFalse(os.path.exists(subrepo_file_path))
+         self.repo.init_submodules()
+         self.repo.update_submodules()
+         self.assertTrue(os.path.exists(subrepo_file_path))
++    @unittest.skip('requires Internet access')
+     def test_specified_update(self):
+         subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py')
+         self.assertFalse(os.path.exists(subrepo_file_path))
+         self.repo.init_submodules(submodules=['submodule'])
+         self.repo.update_submodules(submodules=['submodule'])
+         self.assertTrue(os.path.exists(subrepo_file_path))
++    @unittest.skip('requires Internet access')
+     def test_oneshot_update(self):
+         subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py')
+         self.assertFalse(os.path.exists(subrepo_file_path))
+         self.repo.update_submodules(init=True)
+         self.assertTrue(os.path.exists(subrepo_file_path))
+ if __name__ == '__main__':
+-- 
+2.15.0
+
diff --git a/dev-python/pygit2/pygit2-0.26.1.ebuild b/dev-python/pygit2/pygit2-0.26.1.ebuild
new file mode 100644 (file)
index 0000000..d121e89
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1 eapi7-ver
+
+DESCRIPTION="Python bindings for libgit2"
+HOMEPAGE="https://github.com/libgit2/pygit2 https://pypi.python.org/pypi/pygit2"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2-with-linking-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+       =dev-libs/libgit2-$(ver_cut 1-2)*
+       >=dev-python/cffi-1.0:=[${PYTHON_USEDEP}]
+       dev-python/six[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/pygit2-0.26.1-internet-tests.patch
+)
+
+python_test() {
+       esetup.py test --args='-v'
+}