summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@jelmer.uk>2021-09-18 16:55:32 +0100
committerJelmer Vernooij <jelmer@jelmer.uk>2021-09-18 16:55:32 +0100
commit0b86ad611d5a568500b64d048a8a9ed71873fbf0 (patch)
treef78ddd4d512e2bff84d08e8766942a97937ae507
parentb2c210eba6cd2537ddba02102921af5663bf168d (diff)
parent90cc92891309e192f6c6ba2665badac12619a1ed (diff)
downloadpython-fastimport-git-0b86ad611d5a568500b64d048a8a9ed71873fbf0.tar.gz
New upstream release.
-rw-r--r--.bzrignore1
-rw-r--r--.github/workflows/pythonpackage.yml2
-rw-r--r--.gitignore7
-rw-r--r--.testr.conf3
-rw-r--r--MANIFEST.in4
-rw-r--r--Makefile29
-rw-r--r--NEWS17
-rw-r--r--PKG-INFO16
-rw-r--r--debian/changelog5
-rw-r--r--fastimport.egg-info/PKG-INFO23
-rw-r--r--fastimport.egg-info/SOURCES.txt42
-rw-r--r--fastimport.egg-info/dependency_links.txt1
-rw-r--r--fastimport.egg-info/top_level.txt1
-rw-r--r--fastimport/__init__.py2
-rw-r--r--fastimport/commands.py16
-rw-r--r--fastimport/helpers.py21
-rw-r--r--fastimport/parser.py2
-rw-r--r--fastimport/processors/filter_processor.py2
-rw-r--r--fastimport/py.typed0
-rw-r--r--fastimport/tests/test_commands.py73
-rw-r--r--releaser.conf15
-rw-r--r--setup.cfg5
-rwxr-xr-xsetup.py7
-rw-r--r--tox.ini6
24 files changed, 218 insertions, 82 deletions
diff --git a/.bzrignore b/.bzrignore
new file mode 100644
index 0000000..a9b310f
--- /dev/null
+++ b/.bzrignore
@@ -0,0 +1 @@
+.testrepository
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml
index 2ba86ce..ea6ebb0 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/pythonpackage.yml
@@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
- python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy3]
+ python-version: [3.5, 3.6, 3.7, 3.8, 3.9, pypy3]
fail-fast: false
steps:
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..da11618
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+build
+*.pyc
+*~
+MANIFEST
+dist
+.tox
+*.swp
diff --git a/.testr.conf b/.testr.conf
new file mode 100644
index 0000000..89dc755
--- /dev/null
+++ b/.testr.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+test_command=PYTHONPATH=. python -m subunit.run $IDLIST
+test_id_list_default=fastimport.tests.test_suite
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..555f88a
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,4 @@
+include AUTHORS
+include NEWS
+include COPYING
+include README.md
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13653b5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+PYTHON = python3
+FLAKE8 ?= flake8
+SETUP = $(PYTHON) setup.py
+TESTRUNNER ?= unittest
+RUNTEST = PYTHONPATH=.:$(PYTHONPATH) $(PYTHON) -m $(TESTRUNNER)
+
+DESTDIR=/
+
+all: build
+
+build::
+ $(SETUP) build
+
+install::
+ $(SETUP) install --root="$(DESTDIR)"
+
+check:: build
+ $(RUNTEST) fastimport.tests.test_suite
+
+check-pypy:: clean
+ $(MAKE) check PYTHON=pypy
+
+check-all: check check-pypy
+
+clean::
+ $(SETUP) clean --all
+
+style:
+ $(FLAKE8) --exclude=build,.git,.tox
diff --git a/NEWS b/NEWS
index 23e84c6..ae382ab 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,20 @@
+0.9.14 2021-08-23
+
+0.9.13 2021-06-09
+
+0.9.12 2021-05-02
+
+0.9.11 2021-04-12
+
+0.9.10 2021-04-11
+
+ * Declare python 3.5 requirement in setup.py. (Jelmer Vernooij)
+
+0.9.9 2021-04-10
+
+ * Drop various other python2 helpers, test on newer versions of Python.
+ (Jelmer Vernooij)
+
0.9.8 2018-04-15
* Fix version number. (Jelmer Vernooij)
diff --git a/PKG-INFO b/PKG-INFO
index a4d372a..65fccfb 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,19 +1,23 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: fastimport
-Version: 0.9.8
+Version: 0.9.14
Summary: VCS fastimport/fastexport parser
Home-page: https://github.com/jelmer/python-fastimport
-Author: Jelmer Vernooij
-Author-email: jelmer@jelmer.uk
+Author: Canonical Ltd
+Author-email: bazaar@lists.canonical.com
+Maintainer: Jelmer Vernooij
+Maintainer-email: jelmer@jelmer.uk
License: GNU GPL v2 or later
Description: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: POSIX
Classifier: Topic :: Software Development :: Version Control
+Requires-Python: >=3.5
diff --git a/debian/changelog b/debian/changelog
index 43fa9b2..d903a85 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-python-fastimport (0.9.8-6) UNRELEASED; urgency=medium
+python-fastimport (0.9.14-1) UNRELEASED; urgency=medium
* Drop pypy support, add pypy3 package.
* Update fields Vcs-Browser, Vcs-Git for maintainer Debian Python Modules
@@ -8,8 +8,9 @@ python-fastimport (0.9.8-6) UNRELEASED; urgency=medium
* Update standards version to 4.5.0, no changes needed.
* Update watch file format version to 4.
* Re-export upstream signing key without extra signatures.
+ * New upstream release.
- -- Jelmer Vernooij <jelmer@debian.org> Mon, 01 Jun 2020 23:02:03 +0000
+ -- Jelmer Vernooij <jelmer@debian.org> Sat, 18 Sep 2021 16:55:08 -0000
python-fastimport (0.9.8-5) unstable; urgency=medium
diff --git a/fastimport.egg-info/PKG-INFO b/fastimport.egg-info/PKG-INFO
new file mode 100644
index 0000000..65fccfb
--- /dev/null
+++ b/fastimport.egg-info/PKG-INFO
@@ -0,0 +1,23 @@
+Metadata-Version: 1.2
+Name: fastimport
+Version: 0.9.14
+Summary: VCS fastimport/fastexport parser
+Home-page: https://github.com/jelmer/python-fastimport
+Author: Canonical Ltd
+Author-email: bazaar@lists.canonical.com
+Maintainer: Jelmer Vernooij
+Maintainer-email: jelmer@jelmer.uk
+License: GNU GPL v2 or later
+Description: UNKNOWN
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Operating System :: POSIX
+Classifier: Topic :: Software Development :: Version Control
+Requires-Python: >=3.5
diff --git a/fastimport.egg-info/SOURCES.txt b/fastimport.egg-info/SOURCES.txt
new file mode 100644
index 0000000..7f518f5
--- /dev/null
+++ b/fastimport.egg-info/SOURCES.txt
@@ -0,0 +1,42 @@
+.bzrignore
+.gitignore
+.testr.conf
+AUTHORS
+COPYING
+MANIFEST.in
+Makefile
+NEWS
+README.md
+releaser.conf
+setup.cfg
+setup.py
+tox.ini
+.github/workflows/pythonpackage.yml
+bin/fast-import-filter
+bin/fast-import-info
+bin/fast-import-query
+fastimport/__init__.py
+fastimport/commands.py
+fastimport/dates.py
+fastimport/errors.py
+fastimport/helpers.py
+fastimport/parser.py
+fastimport/processor.py
+fastimport/py.typed
+fastimport/reftracker.py
+fastimport.egg-info/PKG-INFO
+fastimport.egg-info/SOURCES.txt
+fastimport.egg-info/dependency_links.txt
+fastimport.egg-info/top_level.txt
+fastimport/processors/__init__.py
+fastimport/processors/filter_processor.py
+fastimport/processors/info_processor.py
+fastimport/processors/query_processor.py
+fastimport/tests/__init__.py
+fastimport/tests/test_commands.py
+fastimport/tests/test_dates.py
+fastimport/tests/test_errors.py
+fastimport/tests/test_filter_processor.py
+fastimport/tests/test_helpers.py
+fastimport/tests/test_info_processor.py
+fastimport/tests/test_parser.py \ No newline at end of file
diff --git a/fastimport.egg-info/dependency_links.txt b/fastimport.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/fastimport.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/fastimport.egg-info/top_level.txt b/fastimport.egg-info/top_level.txt
new file mode 100644
index 0000000..e8d5432
--- /dev/null
+++ b/fastimport.egg-info/top_level.txt
@@ -0,0 +1 @@
+fastimport
diff --git a/fastimport/__init__.py b/fastimport/__init__.py
index 0b37616..c062341 100644
--- a/fastimport/__init__.py
+++ b/fastimport/__init__.py
@@ -30,4 +30,4 @@ it can be used by other projects. Use it like so:
processor.process(parser.parse())
"""
-__version__ = (0, 9, 8)
+__version__ = (0, 9, 14)
diff --git a/fastimport/commands.py b/fastimport/commands.py
index 6278c78..39119c6 100644
--- a/fastimport/commands.py
+++ b/fastimport/commands.py
@@ -22,12 +22,10 @@ from __future__ import division
import re
import stat
-import sys
from .helpers import (
newobject as object,
utf8_bytes_string,
- repr_bytes,
)
@@ -70,10 +68,7 @@ class ImportCommand(object):
return repr(self)
def __repr__(self):
- if sys.version_info[0] == 2:
- return self.__bytes__()
- else:
- return bytes(self).decode('utf8')
+ return bytes(self).decode('utf8')
def __bytes__(self):
raise NotImplementedError(
@@ -239,7 +234,7 @@ class CommitCommand(ImportCommand):
else:
if include_file_contents:
filecommands = b''.join(
- [b'\n' + repr_bytes(c) for c in self.iter_files()])
+ [b'\n' + bytes(c) for c in self.iter_files()])
else:
filecommands = b''.join(
[b'\n' + str(c) for c in self.iter_files()])
@@ -470,11 +465,8 @@ def check_path(path):
if path is None or path == b'' or path.startswith(b'/'):
raise ValueError("illegal path '%s'" % path)
- if (
- (sys.version_info[0] >= 3 and not isinstance(path, bytes)) and
- (sys.version_info[0] == 2 and not isinstance(path, str))
- ):
- raise TypeError("illegale type for path '%r'" % path)
+ if not isinstance(path, bytes):
+ raise TypeError("illegal type for path '%r'" % path)
return path
diff --git a/fastimport/helpers.py b/fastimport/helpers.py
index e252d09..b1451f7 100644
--- a/fastimport/helpers.py
+++ b/fastimport/helpers.py
@@ -14,7 +14,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Miscellaneous useful stuff."""
-import sys
def _common_path_and_rest(l1, l2, common=[]):
@@ -104,24 +103,10 @@ def is_inside_any(dir_list, fname):
def utf8_bytes_string(s):
"""Convert a string to a bytes string (if necessary, encode in utf8)"""
- if sys.version_info[0] == 2:
- if isinstance(s, str):
- return s
- else:
- return s.encode('utf8')
- else:
- if isinstance(s, str):
- return bytes(s, encoding='utf8')
- else:
- return s
-
-
-def repr_bytes(obj):
- """Return a bytes representation of the object"""
- if sys.version_info[0] == 2:
- return repr(obj)
+ if isinstance(s, str):
+ return bytes(s, encoding='utf8')
else:
- return bytes(obj)
+ return s
class newobject(object):
diff --git a/fastimport/parser.py b/fastimport/parser.py
index 0a88d84..ceee1b4 100644
--- a/fastimport/parser.py
+++ b/fastimport/parser.py
@@ -649,7 +649,7 @@ def _unquote_c_string(s):
codecs.decode(match.group(0), 'unicode-escape')
)
- if sys.version_info[0] >= 3 and isinstance(s, bytes):
+ if isinstance(s, bytes):
return ESCAPE_SEQUENCE_BYTES_RE.sub(decode_match, s)
else:
return ESCAPE_SEQUENCE_RE.sub(decode_match, s)
diff --git a/fastimport/processors/filter_processor.py b/fastimport/processors/filter_processor.py
index 91c54f1..a252990 100644
--- a/fastimport/processors/filter_processor.py
+++ b/fastimport/processors/filter_processor.py
@@ -157,7 +157,7 @@ class FilterProcessor(processor.ImportProcessor):
def _print_command(self, cmd):
"""Wrapper to avoid adding unnecessary blank lines."""
- text = helpers.repr_bytes(cmd)
+ text = bytes(cmd)
self.outf.write(text)
if not text.endswith(b'\n'):
self.outf.write(b'\n')
diff --git a/fastimport/py.typed b/fastimport/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fastimport/py.typed
diff --git a/fastimport/tests/test_commands.py b/fastimport/tests/test_commands.py
index 8075661..dabd6a7 100644
--- a/fastimport/tests/test_commands.py
+++ b/fastimport/tests/test_commands.py
@@ -18,7 +18,6 @@
from unittest import TestCase
from fastimport.helpers import (
- repr_bytes,
utf8_bytes_string,
)
@@ -31,18 +30,18 @@ class TestBlobDisplay(TestCase):
def test_blob(self):
c = commands.BlobCommand(b"1", b"hello world")
- self.assertEqual(b"blob\nmark :1\ndata 11\nhello world", repr_bytes(c))
+ self.assertEqual(b"blob\nmark :1\ndata 11\nhello world", bytes(c))
def test_blob_no_mark(self):
c = commands.BlobCommand(None, b"hello world")
- self.assertEqual(b"blob\ndata 11\nhello world", repr_bytes(c))
+ self.assertEqual(b"blob\ndata 11\nhello world", bytes(c))
class TestCheckpointDisplay(TestCase):
def test_checkpoint(self):
c = commands.CheckpointCommand()
- self.assertEqual(b'checkpoint', repr_bytes(c))
+ self.assertEqual(b'checkpoint', bytes(c))
class TestCommitDisplay(TestCase):
@@ -60,7 +59,7 @@ class TestCommitDisplay(TestCase):
b"data 12\n"
b"release v1.0\n"
b"from :aaa",
- repr_bytes(c))
+ bytes(c))
def test_commit_unicode_committer(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -80,7 +79,7 @@ class TestCommitDisplay(TestCase):
b'refs/heads/master', b'bbb', None, committer,
b'release v1.0', b':aaa', None, None)
- self.assertEqual(commit_utf8, repr_bytes(c))
+ self.assertEqual(commit_utf8, bytes(c))
def test_commit_no_mark(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -94,7 +93,7 @@ class TestCommitDisplay(TestCase):
b"data 12\n"
b"release v1.0\n"
b"from :aaa",
- repr_bytes(c))
+ bytes(c))
def test_commit_no_from(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -108,7 +107,7 @@ class TestCommitDisplay(TestCase):
b"committer Joe Wong <joe@example.com> 1234567890 -0600\n"
b"data 12\n"
b"release v1.0",
- repr_bytes(c))
+ bytes(c))
def test_commit_with_author(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -125,7 +124,7 @@ class TestCommitDisplay(TestCase):
b"data 12\n"
b"release v1.0\n"
b"from :aaa",
- repr_bytes(c))
+ bytes(c))
def test_commit_with_merges(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -142,7 +141,7 @@ class TestCommitDisplay(TestCase):
b"from :aaa\n"
b"merge :bbb\n"
b"merge :ccc",
- repr_bytes(c))
+ bytes(c))
def test_commit_with_filecommands(self):
file_cmds = iter([
@@ -166,7 +165,7 @@ class TestCommitDisplay(TestCase):
b"M 644 inline NEWS\n"
b"data 14\n"
b"blah blah blah",
- repr_bytes(c))
+ bytes(c))
def test_commit_with_more_authors(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -190,7 +189,7 @@ class TestCommitDisplay(TestCase):
b"data 12\n"
b"release v1.0\n"
b"from :aaa",
- repr_bytes(c))
+ bytes(c))
def test_commit_with_properties(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -212,7 +211,7 @@ class TestCommitDisplay(TestCase):
b"from :aaa\n"
b"property greeting 5 hello\n"
b"property planet 5 world",
- repr_bytes(c))
+ bytes(c))
def test_commit_with_int_mark(self):
# user tuple is (name, email, secs-since-epoch, secs-offset-from-utc)
@@ -234,7 +233,7 @@ class TestCommitDisplay(TestCase):
b"from :aaa\n"
b"property greeting 5 hello\n"
b"property planet 5 world",
- repr_bytes(c))
+ bytes(c))
class TestCommitCopy(TestCase):
@@ -256,13 +255,13 @@ class TestCommitCopy(TestCase):
c2 = self.c.copy()
self.assertFalse(self.c is c2)
- self.assertEqual(repr_bytes(self.c), repr_bytes(c2))
+ self.assertEqual(bytes(self.c), bytes(c2))
def test_replace_attr(self):
c2 = self.c.copy(mark=b'ccc')
self.assertEqual(
- repr_bytes(self.c).replace(b'mark :bbb', b'mark :ccc'),
- repr_bytes(c2)
+ bytes(self.c).replace(b'mark :bbb', b'mark :ccc'),
+ bytes(c2)
)
def test_invalid_attribute(self):
@@ -273,29 +272,29 @@ class TestFeatureDisplay(TestCase):
def test_feature(self):
c = commands.FeatureCommand(b"dwim")
- self.assertEqual(b"feature dwim", repr_bytes(c))
+ self.assertEqual(b"feature dwim", bytes(c))
def test_feature_with_value(self):
c = commands.FeatureCommand(b"dwim", b"please")
- self.assertEqual(b"feature dwim=please", repr_bytes(c))
+ self.assertEqual(b"feature dwim=please", bytes(c))
class TestProgressDisplay(TestCase):
def test_progress(self):
c = commands.ProgressCommand(b"doing foo")
- self.assertEqual(b"progress doing foo", repr_bytes(c))
+ self.assertEqual(b"progress doing foo", bytes(c))
class TestResetDisplay(TestCase):
def test_reset(self):
c = commands.ResetCommand(b"refs/tags/v1.0", b":xxx")
- self.assertEqual(b"reset refs/tags/v1.0\nfrom :xxx\n", repr_bytes(c))
+ self.assertEqual(b"reset refs/tags/v1.0\nfrom :xxx\n", bytes(c))
def test_reset_no_from(self):
c = commands.ResetCommand(b'refs/remotes/origin/master', None)
- self.assertEqual(b'reset refs/remotes/origin/master', repr_bytes(c))
+ self.assertEqual(b'reset refs/remotes/origin/master', bytes(c))
class TestTagDisplay(TestCase):
@@ -311,7 +310,7 @@ class TestTagDisplay(TestCase):
b"tagger Joe Wong <joe@example.com> 1234567890 -0600\n"
b"data 11\n"
b"create v1.0",
- repr_bytes(c))
+ bytes(c))
def test_tag_no_from(self):
tagger = (b'Joe Wong', b'joe@example.com', 1234567890, -6 * 3600)
@@ -322,73 +321,73 @@ class TestTagDisplay(TestCase):
b"tagger Joe Wong <joe@example.com> 1234567890 -0600\n"
b"data 11\n"
b"create v1.0",
- repr_bytes(c))
+ bytes(c))
class TestFileModifyDisplay(TestCase):
def test_filemodify_file(self):
c = commands.FileModifyCommand(b'foo/bar', 0o100644, b':23', None)
- self.assertEqual(b'M 644 :23 foo/bar', repr_bytes(c))
+ self.assertEqual(b'M 644 :23 foo/bar', bytes(c))
def test_filemodify_file_executable(self):
c = commands.FileModifyCommand(b'foo/bar', 0o100755, b':23', None)
- self.assertEqual(b'M 755 :23 foo/bar', repr_bytes(c))
+ self.assertEqual(b'M 755 :23 foo/bar', bytes(c))
def test_filemodify_file_internal(self):
c = commands.FileModifyCommand(
b'foo/bar', 0o100644, None, b'hello world')
self.assertEqual(
- b'M 644 inline foo/bar\ndata 11\nhello world', repr_bytes(c))
+ b'M 644 inline foo/bar\ndata 11\nhello world', bytes(c))
def test_filemodify_symlink(self):
c = commands.FileModifyCommand(b'foo/bar', 0o120000, None, b'baz')
self.assertEqual(
- b'M 120000 inline foo/bar\ndata 3\nbaz', repr_bytes(c))
+ b'M 120000 inline foo/bar\ndata 3\nbaz', bytes(c))
def test_filemodify_treeref(self):
c = commands.FileModifyCommand(
b'tree-info', 0o160000, b'revision-id-info', None)
self.assertEqual(
- b'M 160000 revision-id-info tree-info', repr_bytes(c))
+ b'M 160000 revision-id-info tree-info', bytes(c))
class TestFileDeleteDisplay(TestCase):
def test_filedelete(self):
c = commands.FileDeleteCommand(b'foo/bar')
- self.assertEqual(b'D foo/bar', repr_bytes(c))
+ self.assertEqual(b'D foo/bar', bytes(c))
class TestFileCopyDisplay(TestCase):
def test_filecopy(self):
c = commands.FileCopyCommand(b'foo/bar', b'foo/baz')
- self.assertEqual(b'C foo/bar foo/baz', repr_bytes(c))
+ self.assertEqual(b'C foo/bar foo/baz', bytes(c))
def test_filecopy_quoted(self):
# Check the first path is quoted if it contains spaces
c = commands.FileCopyCommand(b'foo/b a r', b'foo/b a z')
- self.assertEqual(b'C "foo/b a r" foo/b a z', repr_bytes(c))
+ self.assertEqual(b'C "foo/b a r" foo/b a z', bytes(c))
class TestFileRenameDisplay(TestCase):
def test_filerename(self):
c = commands.FileRenameCommand(b'foo/bar', b'foo/baz')
- self.assertEqual(b'R foo/bar foo/baz', repr_bytes(c))
+ self.assertEqual(b'R foo/bar foo/baz', bytes(c))
def test_filerename_quoted(self):
# Check the first path is quoted if it contains spaces
c = commands.FileRenameCommand(b'foo/b a r', b'foo/b a z')
- self.assertEqual(b'R "foo/b a r" foo/b a z', repr_bytes(c))
+ self.assertEqual(b'R "foo/b a r" foo/b a z', bytes(c))
class TestFileDeleteAllDisplay(TestCase):
def test_filedeleteall(self):
c = commands.FileDeleteAllCommand()
- self.assertEqual(b'deleteall', repr_bytes(c))
+ self.assertEqual(b'deleteall', bytes(c))
class TestNotesDisplay(TestCase):
@@ -396,7 +395,7 @@ class TestNotesDisplay(TestCase):
def test_noteonly(self):
c = commands.NoteModifyCommand(b'foo', b'A basic note')
self.assertEqual(
- b'N inline :foo\ndata 12\nA basic note', repr_bytes(c))
+ b'N inline :foo\ndata 12\nA basic note', bytes(c))
def test_notecommit(self):
committer = (b'Ed Mund', b'ed@example.org', 1234565432, 0)
@@ -463,7 +462,7 @@ Notes added by 'git notes add'
N inline :1
data 10
Test test
-""", b''.join([repr_bytes(s) for s in commits]))
+""", b''.join([bytes(s) for s in commits]))
class TestPathChecking(TestCase):
diff --git a/releaser.conf b/releaser.conf
new file mode 100644
index 0000000..6135caf
--- /dev/null
+++ b/releaser.conf
@@ -0,0 +1,15 @@
+name: "python-fastimport"
+news_file: "NEWS"
+timeout_days: 5
+tag_name: "fastimport-$VERSION"
+verify_command: "make check"
+update_version {
+ path: "setup.py"
+ match: "^version = \".*\"$"
+ new_line: "version = \"$VERSION\""
+}
+update_version {
+ path: "fastimport/__init__.py"
+ match: "^__version__ = \((.*)\)$"
+ new_line: "__version__ = $TUPLED_VERSION"
+}
diff --git a/setup.cfg b/setup.cfg
index fe62be2..008d962 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -3,3 +3,8 @@ description-file = README.md
[bdist_wheel]
universal = 1
+
+[egg_info]
+tag_build =
+tag_date = 0
+
diff --git a/setup.py b/setup.py
index 363f073..353f0fd 100755
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
-from distutils.core import setup
+from setuptools import setup
-version = "0.9.8"
+version = "0.9.14"
setup(name="fastimport",
description="VCS fastimport/fastexport parser",
@@ -13,6 +13,8 @@ setup(name="fastimport",
license="GNU GPL v2 or later",
url="https://github.com/jelmer/python-fastimport",
packages=['fastimport', 'fastimport.tests', 'fastimport.processors'],
+ test_suite="fastimport.tests.test_suite",
+ python_requires=">=3.5",
scripts=[
'bin/fast-import-query',
'bin/fast-import-filter',
@@ -22,7 +24,6 @@ setup(name="fastimport",
'Development Status :: 4 - Beta',
'License :: OSI Approved :: GNU General Public License v2 '
'or later (GPLv2+)',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..b69c512
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,6 @@
+[tox]
+skipsdist = True
+envlist = py35,py36,py37,py38,py39,py310
+
+[testenv]
+commands = python -m unittest fastimport.tests.test_suite