Dulwich.io dulwich / 50aa77c
New upstream version 0.17.3 Jelmer Vernooij 2 years ago
16 changed file(s) with 127 addition(s) and 45 deletion(s). Raw diff Collapse all Expand all
00 language: python
11 sudo: false
2 cache: pip
3
4 python:
5 - 2.7
6 - 3.3
7 - 3.4
8 - 3.5
9 - 3.5-dev
10 - 3.6
11 - 3.6-dev
12 - 3.7-dev
13 - pypy3.3-5.2-alpha1
14
215 env:
3 global: TEST_RUNNER=unittest PYTHONHASHSEED=random
16 - PYTHONHASHSEED=random
17 TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
18
419 matrix:
520 include:
6 - python: "2.7"
7 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
8 - python: "pypy"
9 env: TEST_REQUIRE="fastimport"
10 - python: "3.4"
11 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
12 - python: "3.5"
13 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
14 - python: "3.5-dev"
15 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
16 - python: "3.6"
17 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
18 - python: "3.6-dev"
19 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
20 - python: "3.7-dev"
21 env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
22 cache:
23 directories:
24 - $HOME/.cache/pip
21 - python: pypy
22 env: TEST_REQUIRE=fastimport
23
24 install:
25 - travis_retry pip install -U pip coverage codecov $TEST_REQUIRE
26
2527 script:
26 - pip install pip --upgrade
27 - pip install $TEST_REQUIRE
28
2928 # Test without c extensions
30 - python -m $TEST_RUNNER dulwich.tests.test_suite
29 - python -m coverage run -p --source=dulwich -m unittest dulwich.tests.test_suite
3130
3231 # Test with c extensions
3332 - python setup.py build_ext -i
34 - python -m $TEST_RUNNER dulwich.tests.test_suite
33 - python -m coverage run -p --source=dulwich -m unittest dulwich.tests.test_suite
3534
35 after_success:
36 - python -m coverage combine
37 - codecov
0 0.17.3 2017-03-20
1
2 PLATFORM SUPPORT
3
4 * List Python 3.3 as supported. (Jelmer Vernooij, #513)
5
6 BUG FIXES
7
8 * Fix compatibility with pypy 3. (Jelmer Vernooij)
9
10 0.17.2 2017-03-19
11
12 BUG FIXES
13
14 * Add workaround for
15 https://bitbucket.org/pypy/pypy/issues/2499/cpyext-pystring_asstring-doesnt-work,
16 fixing Dulwich when used with C extensions on pypy < 5.6. (Victor Stinner)
17
18 * Properly quote config values with a '#' character in them.
19 (Jelmer Vernooij, #511)
20
021 0.17.1 2017-03-01
122
223 IMPROVEMENTS
00 Metadata-Version: 1.1
11 Name: dulwich
2 Version: 0.17.1
2 Version: 0.17.3
33 Summary: Python Git Library
44 Home-page: https://www.dulwich.io/
55 Author: Jelmer Vernooij
2020 Classifier: Development Status :: 4 - Beta
2121 Classifier: License :: OSI Approved :: Apache Software License
2222 Classifier: Programming Language :: Python :: 2.7
23 Classifier: Programming Language :: Python :: 3.3
2324 Classifier: Programming Language :: Python :: 3.4
2425 Classifier: Programming Language :: Python :: 3.5
26 Classifier: Programming Language :: Python :: 3.6
2527 Classifier: Programming Language :: Python :: Implementation :: CPython
2628 Classifier: Programming Language :: Python :: Implementation :: PyPy
2729 Classifier: Operating System :: POSIX
4646 Supported versions of Python
4747 ----------------------------
4848
49 At the moment, Dulwich supports (and is tested on) CPython 2.7, 3.4, 3.5 and Pypy.
49 At the moment, Dulwich supports (and is tested on) CPython 2.7, 3.3, 3.4, 3.5, 3.6 and Pypy.
2121
2222 """Python implementation of the Git file formats and protocols."""
2323
24 __version__ = (0, 17, 1)
24 __version__ = (0, 17, 3)
3737 #define PyInt_AsLong PyLong_AsLong
3838 #define PyInt_AS_LONG PyLong_AS_LONG
3939 #define PyString_AS_STRING PyBytes_AS_STRING
40 #define PyString_AsString PyBytes_AsString
4140 #define PyString_AsStringAndSize PyBytes_AsStringAndSize
4241 #define PyString_Check PyBytes_Check
4342 #define PyString_CheckExact PyBytes_CheckExact
2323 #if PY_MAJOR_VERSION >= 3
2424 #define PyInt_FromLong PyLong_FromLong
2525 #define PyString_AS_STRING PyBytes_AS_STRING
26 #define PyString_AsString PyBytes_AsString
26 #define PyString_AS_STRING PyBytes_AS_STRING
2727 #define PyString_Check PyBytes_Check
2828 #define PyString_CheckExact PyBytes_CheckExact
2929 #define PyString_FromStringAndSize PyBytes_FromStringAndSize
132132 Py_DECREF(py_delta);
133133 return NULL;
134134 }
135 out = (uint8_t *)PyString_AsString(ret);
135 out = (uint8_t *)PyString_AS_STRING(ret);
136136 while (index < delta_len) {
137137 uint8_t cmd = delta[index];
138138 index++;
237237 Py_DECREF(file_sha);
238238 return NULL;
239239 }
240 cmp = memcmp(PyString_AsString(file_sha), sha, 20);
240 cmp = memcmp(PyString_AS_STRING(file_sha), sha, 20);
241241 Py_DECREF(file_sha);
242242 if (cmp < 0)
243243 start = i + 1;
173173 if (value.startswith(b" ") or
174174 value.startswith(b"\t") or
175175 value.endswith(b" ") or
176 b'#' in value or
176177 value.endswith(b"\t")):
177178 return b'"' + _escape_value(value) + b'"'
178179 return _escape_value(value)
364365 elif value is False:
365366 value = b"false"
366367 else:
367 value = _escape_value(value)
368 value = _format_string(value)
368369 f.write(b"\t" + key + b" = " + value + b"\n")
369370
370371
171171 """
172172 conf = ConfigParser()
173173 if file:
174 conf.readfp(file)
174 try:
175 conf.read_file(file, path)
176 except AttributeError:
177 # read_file only exists in Python3
178 conf.readfp(file)
175179 return conf
176180 confpath = None
177181 if not path:
11251125 __slots__ = ('_parents', '_encoding', '_extra', '_author_timezone_neg_utc',
11261126 '_commit_timezone_neg_utc', '_commit_time',
11271127 '_author_time', '_author_timezone', '_commit_timezone',
1128 '_author', '_committer', '_parents', '_extra',
1129 '_encoding', '_tree', '_message', '_mergetag', '_gpgsig')
1128 '_author', '_committer', '_tree', '_message',
1129 '_mergetag', '_gpgsig')
11301130
11311131 def __init__(self):
11321132 super(Commit, self).__init__()
172172 self.assertEqual(ConfigFile({(b'alias', ): {
173173 b'who': b"!who() {git log --no-merges --pretty=format:'%an - %ae' $@ | sort | uniq -c | sort -rn;};who"}}), cf)
174174
175 def test_set_hash_gets_quoted(self):
176 c = ConfigFile()
177 c.set(b"xandikos", b"color", b"#665544")
178 f = BytesIO()
179 c.write_to_file(f)
180 self.assertEqual(b"[xandikos]\n\tcolor = \"#665544\"\n", f.getvalue())
181
175182
176183 class ConfigDictTests(TestCase):
177184
197197 ApplyDeltaError,
198198 apply_delta, b'', b'\x00\x80\x02\xb0\x11\x11')
199199
200 def test_pypy_issue(self):
201 # Test for https://github.com/jelmer/dulwich/issues/509 /
202 # https://bitbucket.org/pypy/pypy/issues/2499/cpyext-pystring_asstring-doesnt-work
203 chunks = [
204 b'tree 03207ccf58880a748188836155ceed72f03d65d6\n'
205 b'parent 408fbab530fd4abe49249a636a10f10f44d07a21\n'
206 b'author Victor Stinner <victor.stinner@gmail.com> 1421355207 +0100\n'
207 b'committer Victor Stinner <victor.stinner@gmail.com> 1421355207 +0100\n'
208 b'\n'
209 b'Backout changeset 3a06020af8cf\n'
210 b'\nStreamWriter: close() now clears the reference to the transport\n'
211 b'\nStreamWriter now raises an exception if it is closed: write(), writelines(),\n'
212 b'write_eof(), can_write_eof(), get_extra_info(), drain().\n']
213 delta = [
214 b'\xcd\x03\xad\x03]tree ff3c181a393d5a7270cddc01ea863818a8621ca8\n'
215 b'parent 20a103cc90135494162e819f98d0edfc1f1fba6b\x91]7\x0510738'
216 b'\x91\x99@\x0b10738 +0100\x93\x04\x01\xc9']
217 res = apply_delta(chunks, delta)
218 expected = [
219 b'tree ff3c181a393d5a7270cddc01ea863818a8621ca8\n'
220 b'parent 20a103cc90135494162e819f98d0edfc1f1fba6b',
221 b'\nauthor Victor Stinner <victor.stinner@gmail.com> 14213',
222 b'10738',
223 b' +0100\ncommitter Victor Stinner <victor.stinner@gmail.com> 14213',
224 b'10738 +0100',
225 b'\n\nStreamWriter: close() now clears the reference to the transport\n\n'
226 b'StreamWriter now raises an exception if it is closed: write(), writelines(),\n'
227 b'write_eof(), can_write_eof(), get_extra_info(), drain().\n']
228 self.assertEqual(b''.join(expected), b''.join(res))
229
200230
201231 class TestPackData(PackTests):
202232 """Tests getting the data from the packfile."""
400400 """
401401
402402 repo_dir = os.path.join(self.mkdtemp())
403 self.addCleanup(shutil.rmtree, repo_dir)
403404 r = Repo.init(repo_dir)
404 self.addCleanup(shutil.rmtree, repo_dir)
405 self.addCleanup(r.close)
405406
406407 pre_commit = os.path.join(r.controldir(), 'hooks', 'pre-commit')
407408
440441 """
441442
442443 repo_dir = self.mkdtemp()
444 self.addCleanup(shutil.rmtree, repo_dir)
443445 r = Repo.init(repo_dir)
444 self.addCleanup(shutil.rmtree, repo_dir)
446 self.addCleanup(r.close)
445447
446448 commit_msg = os.path.join(r.controldir(), 'hooks', 'commit-msg')
447449
472474 self.skipTest('shell hook tests requires POSIX shell')
473475
474476 repo_dir = self.mkdtemp()
477 self.addCleanup(shutil.rmtree, repo_dir)
475478
476479 r = Repo.init(repo_dir)
477 self.addCleanup(shutil.rmtree, repo_dir)
480 self.addCleanup(r.close)
478481
479482 (fd, path) = tempfile.mkstemp(dir=repo_dir)
480483 os.close(fd)
524527 author=b'Test Author <test@nodomain.com>',
525528 commit_timestamp=12345, commit_timezone=0,
526529 author_timestamp=12345, author_timezone=0)
527 self.assertEqual(len(warnings_list), 1, warnings_list)
528 self.assertIsInstance(warnings_list[-1], UserWarning)
529 self.assertTrue("post-commit hook failed: " in str(warnings_list[-1]))
530 expected_warning = UserWarning(
531 'post-commit hook failed: Hook post-commit exited with '
532 'non-zero status',)
533 for w in warnings_list:
534 if (type(w) == type(expected_warning) and
535 w.args == expected_warning.args):
536 break
537 else:
538 raise AssertionError('Expected warning %r not in %r' %
539 (expected_warning, warnings_list))
530540 self.assertEqual([commit_sha], r[commit_sha2].parents)
531541
532542 def test_as_dict(self):
548558 worktree_temp_dir = tempfile.mkdtemp()
549559 self.addCleanup(shutil.rmtree, worktree_temp_dir)
550560 r = Repo.init(temp_dir)
561 self.addCleanup(r.close)
551562 root_sha = r.do_commit(
552563 b'empty commit',
553564 committer=b'Test Committer <test@nodomain.com>',
556567 author_timestamp=12345, author_timezone=0)
557568 r.refs[b'refs/heads/master'] = root_sha
558569 w = Repo._init_new_working_directory(worktree_temp_dir, r)
570 self.addCleanup(w.close)
559571 new_sha = w.do_commit(
560572 b'new commit',
561573 committer=b'Test Committer <test@nodomain.com>',
00 Metadata-Version: 1.1
11 Name: dulwich
2 Version: 0.17.1
2 Version: 0.17.3
33 Summary: Python Git Library
44 Home-page: https://www.dulwich.io/
55 Author: Jelmer Vernooij
2020 Classifier: Development Status :: 4 - Beta
2121 Classifier: License :: OSI Approved :: Apache Software License
2222 Classifier: Programming Language :: Python :: 2.7
23 Classifier: Programming Language :: Python :: 3.3
2324 Classifier: Programming Language :: Python :: 3.4
2425 Classifier: Programming Language :: Python :: 3.5
26 Classifier: Programming Language :: Python :: 3.6
2527 Classifier: Programming Language :: Python :: Implementation :: CPython
2628 Classifier: Programming Language :: Python :: Implementation :: PyPy
2729 Classifier: Operating System :: POSIX
88 from distutils.core import setup, Extension
99 from distutils.core import Distribution
1010
11 dulwich_version_string = '0.17.1'
11 dulwich_version_string = '0.17.3'
1212
1313 include_dirs = []
1414 # Windows MSVC support
9090 'Development Status :: 4 - Beta',
9191 'License :: OSI Approved :: Apache Software License',
9292 'Programming Language :: Python :: 2.7',
93 'Programming Language :: Python :: 3.3',
9394 'Programming Language :: Python :: 3.4',
9495 'Programming Language :: Python :: 3.5',
96 'Programming Language :: Python :: 3.6',
9597 'Programming Language :: Python :: Implementation :: CPython',
9698 'Programming Language :: Python :: Implementation :: PyPy',
9799 'Operating System :: POSIX',
00 [tox]
11 downloadcache = {toxworkdir}/cache/
2 envlist = py27, pypy, py27-noext, pypy-noext, py34, py34-noext, py35, py35-noext, py36, py36-noext
2 envlist = py27, pypy, py27-noext, pypy-noext, py33, py33-noext, py34, py34-noext, py35, py35-noext, py36, py36-noext
33
44 [testenv]
55