Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pygit2/, dev-python/pygit2/files/
Date: Tue, 21 Nov 2017 17:48:19
Message-Id: 1511286472.5f724dc180b9228b5903da3f00e91c6e1a6a1fda.mgorny@gentoo
1 commit: 5f724dc180b9228b5903da3f00e91c6e1a6a1fda
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 21 07:23:12 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 21 17:47:52 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f724dc1
7
8 dev-python/pygit2: Bump to 0.26.1
9
10 dev-python/pygit2/Manifest | 1 +
11 .../files/pygit2-0.26.1-internet-tests.patch | 133 +++++++++++++++++++++
12 dev-python/pygit2/pygit2-0.26.1.ebuild | 30 +++++
13 3 files changed, 164 insertions(+)
14
15 diff --git a/dev-python/pygit2/Manifest b/dev-python/pygit2/Manifest
16 index 2c744d8c47a..e7cf7e20aaf 100644
17 --- a/dev-python/pygit2/Manifest
18 +++ b/dev-python/pygit2/Manifest
19 @@ -1,3 +1,4 @@
20 DIST pygit2-0.25.0.tar.gz 472116 SHA256 de0ed85fd840dfeb32bcaa94c643307551dc0d967c3714e49087e7edc0cdc571 SHA512 44f94869718111acbd4ad41bc4c37ac66557e979241dd5a7bb080cf091fec3fc3d5aa53a8a84eb37b2e6f89518b2ac69d058e1970b7cf98c35b8375807fd8f86 WHIRLPOOL 71d8eb87ef9cd2a1d77ecc1258d5d02f2d0075144fc81556e8a2c0b599202cf17b06c548767b956748feaa13d3ece0d3a664cfe95ab93004e345890805c58175
21 DIST pygit2-0.25.1.tar.gz 456580 SHA256 e8696033052fa0221114ee7f632d38777cc29e58230cd6a05de5725cd31b4a6a SHA512 19908c874d5c2469609a54893f37367480d27ff03583c38b474ebb125dc9db95dc60776a120bb05662938d6eb62d4bcef24f684688e97e3453ccc27e015736cd WHIRLPOOL 648aabcecde66fd5b1d3cf840c51693c237e75f9da7bb793e4e9c18537cb12e4b35d5dced17389bb24440a4c72f37175e1a0a5e44a9c69811c54cf60d11f7d3f
22 DIST pygit2-0.26.0.tar.gz 457263 SHA256 a7f06d61f25ab644c39e0e9bd4846a6cc4af81ae27f889473e6f0e9511226cb1 SHA512 e8626712a3b75aced14997dda0155f5c7be9a7e0e43aeb2c767c848fcbe711780137f663cc9ad5268cd85e2c61fd40be6853573f68b457cd5d46d6c32a644076 WHIRLPOOL 909d3d4f06c04107309b53653f5395f76de61195269ba753b7658725a27235ede94df48b74b547a2bafef7e20f8916c01f6d7d7f2e434965621364d51f4e32fa
23 +DIST pygit2-0.26.1.tar.gz 458526 BLAKE2B 703093a5a292e92c90987785065f3a1590addc09d72311f75b22caf6fe1a17be8fb16cf777189835204cb7dc4d2066e841d3d4327e2cc040c312e22a4c75a8ee SHA512 23585bc0f41458442889b5434347cbc11d6c729898864262426f84e5b9239164bb58c6e910d2381b25f1b8be271674c1a6960630a504c40accdd30e487d27a7d
24
25 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
26 new file mode 100644
27 index 00000000000..6b96eb40f3b
28 --- /dev/null
29 +++ b/dev-python/pygit2/files/pygit2-0.26.1-internet-tests.patch
30 @@ -0,0 +1,133 @@
31 +From 24a929d003f1b6b4899f41cb227293e8c4b62eb7 Mon Sep 17 00:00:00 2001
32 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
33 +Date: Tue, 21 Nov 2017 17:53:48 +0100
34 +Subject: [PATCH] Disable tests requiring network access
35 +
36 +---
37 + test/test_credentials.py | 3 +++
38 + test/test_repository.py | 1 +
39 + test/test_submodule.py | 4 ++++
40 + 3 files changed, 8 insertions(+)
41 +
42 +diff --git a/test/test_credentials.py b/test/test_credentials.py
43 +index 7921a41..e60383a 100644
44 +--- a/test/test_credentials.py
45 ++++ b/test/test_credentials.py
46 +@@ -70,39 +70,42 @@ class CredentialCreateTest(utils.NoRepoTestCase):
47 + username = "git"
48 +
49 + cred = KeypairFromAgent(username)
50 + self.assertEqual((username, None, None, None), cred.credential_tuple)
51 +
52 +
53 + class CredentialCallback(utils.RepoTestCase):
54 ++ @unittest.skip('requires Internet access')
55 + def test_callback(self):
56 + class MyCallbacks(pygit2.RemoteCallbacks):
57 + @staticmethod
58 + def credentials(url, username, allowed):
59 + self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
60 + raise Exception("I don't know the password")
61 +
62 + url = "https://github.com/github/github"
63 + remote = self.repo.create_remote("github", url)
64 +
65 + self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks()))
66 +
67 ++ @unittest.skip('requires Internet access')
68 + def test_bad_cred_type(self):
69 + class MyCallbacks(pygit2.RemoteCallbacks):
70 + @staticmethod
71 + def credentials(url, username, allowed):
72 + self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
73 + return Keypair("git", "foo.pub", "foo", "sekkrit")
74 +
75 + url = "https://github.com/github/github"
76 + remote = self.repo.create_remote("github", url)
77 + self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks()))
78 +
79 + class CallableCredentialTest(utils.RepoTestCase):
80 +
81 ++ @unittest.skip('requires Internet access')
82 + def test_user_pass(self):
83 + credentials = UserPass("libgit2", "libgit2")
84 + callbacks = pygit2.RemoteCallbacks(credentials=credentials)
85 +
86 + url = "https://bitbucket.org/libgit2/testgitrepository.git"
87 + remote = self.repo.create_remote("bb", url)
88 + remote.fetch(callbacks=callbacks)
89 +diff --git a/test/test_repository.py b/test/test_repository.py
90 +index 941851b..33f0571 100644
91 +--- a/test/test_repository.py
92 ++++ b/test/test_repository.py
93 +@@ -569,14 +569,15 @@ class CloneRepositoryTest(utils.NoRepoTestCase):
94 + return repo.remotes.create("custom_remote", url)
95 +
96 + repo = clone_repository(url, repo_path, repository=create_repository, remote=create_remote)
97 + self.assertFalse(repo.is_empty)
98 + self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references())
99 + self.assertIsNotNone(repo.remotes["custom_remote"])
100 +
101 ++ @unittest.skip('requires Internet access')
102 + def test_clone_with_credentials(self):
103 + repo = clone_repository(
104 + "https://bitbucket.org/libgit2/testgitrepository.git",
105 + self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2")))
106 +
107 + self.assertFalse(repo.is_empty)
108 +
109 +diff --git a/test/test_submodule.py b/test/test_submodule.py
110 +index f123b8b..df44e16 100644
111 +--- a/test/test_submodule.py
112 ++++ b/test/test_submodule.py
113 +@@ -49,14 +49,15 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase):
114 + self.assertIsNotNone(s)
115 +
116 + def test_listall_submodules(self):
117 + submodules = self.repo.listall_submodules()
118 + self.assertEqual(len(submodules), 1)
119 + self.assertEqual(submodules[0], SUBM_PATH)
120 +
121 ++ @unittest.skip('requires Internet access')
122 + def test_submodule_open(self):
123 + s = self.repo.lookup_submodule(SUBM_PATH)
124 + self.repo.init_submodules()
125 + self.repo.update_submodules()
126 + r = s.open()
127 + self.assertIsNotNone(r)
128 + self.assertEqual(str(r.head.target), SUBM_HEAD_SHA)
129 +@@ -69,28 +70,31 @@ class SubmoduleTest(utils.SubmoduleRepoTestCase):
130 + s = self.repo.lookup_submodule(SUBM_PATH)
131 + self.assertEqual(SUBM_PATH, s.path)
132 +
133 + def test_url(self):
134 + s = self.repo.lookup_submodule(SUBM_PATH)
135 + self.assertEqual(SUBM_URL, s.url)
136 +
137 ++ @unittest.skip('requires Internet access')
138 + def test_init_and_update(self):
139 + subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py')
140 + self.assertFalse(os.path.exists(subrepo_file_path))
141 + self.repo.init_submodules()
142 + self.repo.update_submodules()
143 + self.assertTrue(os.path.exists(subrepo_file_path))
144 +
145 ++ @unittest.skip('requires Internet access')
146 + def test_specified_update(self):
147 + subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py')
148 + self.assertFalse(os.path.exists(subrepo_file_path))
149 + self.repo.init_submodules(submodules=['submodule'])
150 + self.repo.update_submodules(submodules=['submodule'])
151 + self.assertTrue(os.path.exists(subrepo_file_path))
152 +
153 ++ @unittest.skip('requires Internet access')
154 + def test_oneshot_update(self):
155 + subrepo_file_path = os.path.join(self.repo_path, 'submodule', 'setup.py')
156 + self.assertFalse(os.path.exists(subrepo_file_path))
157 + self.repo.update_submodules(init=True)
158 + self.assertTrue(os.path.exists(subrepo_file_path))
159 +
160 + if __name__ == '__main__':
161 +--
162 +2.15.0
163 +
164
165 diff --git a/dev-python/pygit2/pygit2-0.26.1.ebuild b/dev-python/pygit2/pygit2-0.26.1.ebuild
166 new file mode 100644
167 index 00000000000..d121e89b721
168 --- /dev/null
169 +++ b/dev-python/pygit2/pygit2-0.26.1.ebuild
170 @@ -0,0 +1,30 @@
171 +# Copyright 1999-2017 Gentoo Foundation
172 +# Distributed under the terms of the GNU General Public License v2
173 +
174 +EAPI=6
175 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
176 +
177 +inherit distutils-r1 eapi7-ver
178 +
179 +DESCRIPTION="Python bindings for libgit2"
180 +HOMEPAGE="https://github.com/libgit2/pygit2 https://pypi.python.org/pypi/pygit2"
181 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
182 +
183 +LICENSE="GPL-2-with-linking-exception"
184 +SLOT="0"
185 +KEYWORDS="~amd64 ~x86"
186 +
187 +RDEPEND="
188 + =dev-libs/libgit2-$(ver_cut 1-2)*
189 + >=dev-python/cffi-1.0:=[${PYTHON_USEDEP}]
190 + dev-python/six[${PYTHON_USEDEP}]
191 +"
192 +DEPEND="${RDEPEND}"
193 +
194 +PATCHES=(
195 + "${FILESDIR}"/pygit2-0.26.1-internet-tests.patch
196 +)
197 +
198 +python_test() {
199 + esetup.py test --args='-v'
200 +}