diff --git a/GitPython.egg-info/PKG-INFO b/GitPython.egg-info/PKG-INFO index 14bbf7e..b97d100 100644 --- a/GitPython.egg-info/PKG-INFO +++ b/GitPython.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: GitPython -Version: 2.1.8 +Version: 2.1.9 Summary: Python Git Library Home-page: https://github.com/gitpython-developers/GitPython Author: Sebastian Thiel, Michael Trier @@ -19,12 +19,10 @@ Classifier: Operating System :: MacOS :: MacOS X Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Requires: gitdb2 (>=2.0.0) -Requires-Python: >=2.6, !=3.0.*, !=3.1.*, !=3.2.* +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* diff --git a/GitPython.egg-info/SOURCES.txt b/GitPython.egg-info/SOURCES.txt index cccc380..d981c78 100644 --- a/GitPython.egg-info/SOURCES.txt +++ b/GitPython.egg-info/SOURCES.txt @@ -29,7 +29,6 @@ git/db.py git/diff.py git/exc.py -git/odict.py git/remote.py git/util.py git/index/__init__.py diff --git a/PKG-INFO b/PKG-INFO index 14bbf7e..b97d100 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: GitPython -Version: 2.1.8 +Version: 2.1.9 Summary: Python Git Library Home-page: https://github.com/gitpython-developers/GitPython Author: Sebastian Thiel, Michael Trier @@ -19,12 +19,10 @@ Classifier: Operating System :: MacOS :: MacOS X Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Requires: gitdb2 (>=2.0.0) -Requires-Python: >=2.6, !=3.0.*, !=3.1.*, !=3.2.* +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* diff --git a/README.md b/README.md index ad428e6..8e9d212 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ the `GIT_PYTHON_GIT_EXECUTABLE=` environment variable. * Git (1.7.x or newer) -* Python 2.7 to 3.6, while python 2.6 is supported on a *best-effort basis*. +* Python 2.7 to 3.6. The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`. The installer takes care of installing them for you. @@ -67,10 +67,6 @@ For *Windows*, we do regularly test it on [Appveyor CI](https://www.appveyor.com/) but not all test-cases pass - you may help improve them by exploring [Issue #525](https://github.com/gitpython-developers/GitPython/issues/525). - -#### Python 2.6 - -Python 2.6 is supported on best-effort basis; which means that it is likely to deteriorate over time. ### RUNNING TESTS @@ -132,19 +128,18 @@ this project: ``` -curl https://pypi.python.org/packages/7e/13/2a556eb97dcf498c915e5e04bb82bf74e07bb8b7337ca2be49bfd9fb6313/GitPython-2.1.5-py2.py3-none-any.whl\#md5\=d3ecb26cb22753f4414f75f721f6f626z > gitpython.whl -curl https://pypi.python.org/packages/7e/13/2a556eb97dcf498c915e5e04bb82bf74e07bb8b7337ca2be49bfd9fb6313/GitPython-2.1.5-py2.py3-none-any.whl.asc > gitpython-signature.asc +curl https://pypi.python.org/packages/5b/38/0433c06feebbfbb51d644129dbe334031c33d55af0524326266f847ae907/GitPython-2.1.8-py2.py3-none-any.whl#md5=6b73ae86ee2dbab6da8652b2d875013a > gitpython.whl +curl https://pypi.python.org/packages/5b/38/0433c06feebbfbb51d644129dbe334031c33d55af0524326266f847ae907/GitPython-2.1.8-py2.py3-none-any.whl.asc > gitpython-signature.asc gpg --verify gitpython-signature.asc gitpython.whl ``` which outputs ``` -gpg: Signature made Sat Jun 10 20:22:49 2017 CEST using RSA key ID 3B07188F -gpg: Good signature from "Sebastian Thiel (In Rust I trust!) " [unknown] -gpg: WARNING: This key is not certified with a trusted signature! -gpg: There is no indication that the signature belongs to the owner. -Primary key fingerprint: 4477 ADC5 977D 7C60 D2A7 E378 9FEE 1C6A 3B07 188F +gpg: Signature made Mon Dec 11 17:34:17 2017 CET +gpg: using RSA key C3BC52BD76E2C23BAC6EC06A665F99FA9D99966C +gpg: issuer "byronimo@gmail.com" +gpg: Good signature from "Sebastian Thiel (I do trust in Rust!) " [ultimate] ``` You can verify that the keyid indeed matches the release-signature key provided in this @@ -164,16 +159,10 @@ ``` gpg --import ./release-verification-key.asc -gpg --edit-key 9FEE1C6A3B07188F +gpg --edit-key 88710E60 + > sign > save -``` - -Afterwards verifying the tarball will yield the following: -``` -$ gpg --verify gitpython-signature.asc gitpython.whl -gpg: Signature made Sat Jun 10 20:22:49 2017 CEST using RSA key ID 3B07188F -gpg: Good signature from "Sebastian Thiel (In Rust I trust!) " [ultimate] ``` ### LICENSE diff --git a/VERSION b/VERSION index ebf14b4..63a1a1c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.8 +2.1.9 diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 70f66a7..5f24c83 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -2,11 +2,21 @@ Changelog ========= +2.1.9 - Dropping support for Python 2.6 +======================================= + +see the following for (most) details: +https://github.com/gitpython-developers/gitpython/milestone/24?closed=1 + +or run have a look at the difference between tags v2.1.8 and v2.1.9: +https://github.com/gitpython-developers/GitPython/compare/2.1.8...2.1.9 + + 2.1.8 - bugfixes ==================================== -See the following for (most) details: -https://github.com/gitpython-developers/GitPython/milestone/23?closed=1 +see the following for (most) details: +https://github.com/gitpython-developers/gitpython/milestone/23?closed=1 or run have a look at the difference between tags v2.1.7 and v2.1.8: https://github.com/gitpython-developers/GitPython/compare/2.1.7...2.1.8 @@ -161,13 +171,13 @@ with large repositories. * CRITICAL: fixed incorrect `Commit` object serialization when authored or commit date had timezones which were not divisiblej by 3600 seconds. This would happen if the timezone was something like `+0530` for instance. -* A list of all additional fixes can be found `on github `_ +* A list of all additional fixes can be found `on GitHub `_ * CRITICAL: `Tree.cache` was removed without replacement. It is technically impossible to change individual trees and expect their serialization results to be consistent with what *git* expects. Instead, use the `IndexFile` facilities to adjust the content of the staging area, and write it out to the respective tree objects using `IndexFile.write_tree()` instead. 1.0.1 - Fixes ============= -* A list of all issues can be found `on github `_ +* A list of all issues can be found `on GitHub `_ 1.0.0 - Notes ============= @@ -191,7 +201,7 @@ - Those who support **GUI on windows** will now have to set `git.Git.USE_SHELL = True` to get the previous behaviour. -* A list of all issues can be found `on github `_ +* A list of all issues can be found `on GitHub `_ 0.3.6 - Features @@ -207,11 +217,11 @@ * Repo.working_tree_dir now returns None if it is bare. Previously it raised AssertionError. * IndexFile.add() previously raised AssertionError when paths where used with bare repository, now it raises InvalidGitRepositoryError -* Added `Repo.merge_base()` implementation. See the `respective issue on github `_ +* Added `Repo.merge_base()` implementation. See the `respective issue on GitHub `_ * `[include]` sections in git configuration files are now respected * Added `GitConfigParser.rename_section()` * Added `Submodule.rename()` -* A list of all issues can be found `on github `_ +* A list of all issues can be found `on GitHub `_ 0.3.5 - Bugfixes ================ diff --git a/doc/source/intro.rst b/doc/source/intro.rst index bfc5a77..48f898b 100644 --- a/doc/source/intro.rst +++ b/doc/source/intro.rst @@ -14,8 +14,6 @@ ============ * `Python`_ 2.7 or newer - Since GitPython 2.0.0. Please note that python 2.6 is still reasonably well supported, but might - deteriorate over time. Support is provided on a best-effort basis only. * `Git`_ 1.7.0 or newer It should also work with older versions, but it may be that some operations involving remotes will not work as expected. @@ -75,12 +73,6 @@ Another way assure proper cleanup of resources is to factor out GitPython into a separate process which can be dropped periodically. -Best-effort for Python 2.6 and Windows support ----------------------------------------------- - -This means that support for these platforms is likely to worsen over time -as they are kept alive solely by their users, or not. - Getting Started =============== @@ -124,7 +116,7 @@ Issue Tracker ============= -The issue tracker is hosted by github: +The issue tracker is hosted by GitHub: https://github.com/gitpython-developers/GitPython/issues diff --git a/doc/source/roadmap.rst b/doc/source/roadmap.rst index f93d5e6..a573df3 100644 --- a/doc/source/roadmap.rst +++ b/doc/source/roadmap.rst @@ -2,7 +2,7 @@ ####### Roadmap ####### -The full list of milestones including associated tasks can be found on github: +The full list of milestones including associated tasks can be found on GitHub: https://github.com/gitpython-developers/GitPython/issues Select the respective milestone to filter the list of issues accordingly. diff --git a/git/__init__.py b/git/__init__.py index b05ad12..649f09e 100644 --- a/git/__init__.py +++ b/git/__init__.py @@ -12,13 +12,13 @@ import os.path as osp -__version__ = '2.1.8' +__version__ = '2.1.9' #{ Initialization def _init_externals(): """Initialize external projects by putting them into the path""" - if __version__ == '2.1.8': + if __version__ == '2.1.9': sys.path.insert(0, osp.join(osp.dirname(__file__), 'ext', 'gitdb')) try: diff --git a/git/cmd.py b/git/cmd.py index 13c0140..0f797e2 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -17,6 +17,7 @@ import subprocess import sys import threading +from collections import OrderedDict from textwrap import dedent from git.compat import ( @@ -31,7 +32,6 @@ is_win, ) from git.exc import CommandError -from git.odict import OrderedDict from git.util import is_cygwin_git, cygpath, expand_path from .exc import ( @@ -44,10 +44,10 @@ ) -execute_kwargs = set(('istream', 'with_extended_output', - 'with_exceptions', 'as_process', 'stdout_as_string', - 'output_stream', 'with_stdout', 'kill_after_timeout', - 'universal_newlines', 'shell', 'env')) +execute_kwargs = {'istream', 'with_extended_output', 'with_exceptions', + 'as_process', 'stdout_as_string', 'output_stream', + 'with_stdout', 'kill_after_timeout', 'universal_newlines', + 'shell', 'env'} log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) @@ -125,7 +125,7 @@ def slots_to_dict(self, exclude=()): - return dict((s, getattr(self, s)) for s in self.__slots__ if s not in exclude) + return {s: getattr(self, s) for s in self.__slots__ if s not in exclude} def dict_to_slots_and__excluded_are_none(self, d, excluded=()): @@ -143,8 +143,7 @@ ## CREATE_NEW_PROCESS_GROUP is needed to allow killing it afterwards, # see https://docs.python.org/3/library/subprocess.html#subprocess.Popen.send_signal PROC_CREATIONFLAGS = (CREATE_NO_WINDOW | subprocess.CREATE_NEW_PROCESS_GROUP - if is_win and sys.version_info >= (2, 7) - else 0) + if is_win else 0) class Git(LazyMixin): @@ -486,10 +485,10 @@ def readlines(self, size=-1): if self._nbr == self._size: - return list() + return [] # leave all additional logic to our readline method, we just check the size - out = list() + out = [] nbr = 0 while True: line = self.readline() @@ -895,7 +894,7 @@ def transform_kwargs(self, split_single_char_options=True, **kwargs): """Transforms Python style kwargs into git command line options.""" - args = list() + args = [] kwargs = OrderedDict(sorted(kwargs.items(), key=lambda x: x[0])) for k, v in kwargs.items(): if isinstance(v, (list, tuple)): @@ -914,7 +913,7 @@ return [arg_list.encode(defenc)] return [str(arg_list)] - outlist = list() + outlist = [] for arg in arg_list: if isinstance(arg_list, (list, tuple)): outlist.extend(cls.__unpack_args(arg)) @@ -973,8 +972,8 @@ :return: Same as ``execute``""" # Handle optional arguments prior to calling transform_kwargs # otherwise these'll end up in args, which is bad. - exec_kwargs = dict((k, v) for k, v in kwargs.items() if k in execute_kwargs) - opts_kwargs = dict((k, v) for k, v in kwargs.items() if k not in execute_kwargs) + exec_kwargs = {k: v for k, v in kwargs.items() if k in execute_kwargs} + opts_kwargs = {k: v for k, v in kwargs.items() if k not in execute_kwargs} insert_after_this_arg = opts_kwargs.pop('insert_kwargs_after', None) diff --git a/git/config.py b/git/config.py index 3310db8..68d65ae 100644 --- a/git/config.py +++ b/git/config.py @@ -12,6 +12,7 @@ import logging import os import re +from collections import OrderedDict from git.compat import ( string_types, @@ -21,7 +22,6 @@ with_metaclass, PY3 ) -from git.odict import OrderedDict from git.util import LockFile import os.path as osp diff --git a/git/diff.py b/git/diff.py index 28c10e4..d7221ac 100644 --- a/git/diff.py +++ b/git/diff.py @@ -61,7 +61,7 @@ :note: Subclasses require a repo member as it is the case for Object instances, for practical reasons we do not derive from Object.""" - __slots__ = tuple() + __slots__ = () # standin indicating you want to diff against the index class Index(object): @@ -106,7 +106,7 @@ :note: On a bare repository, 'other' needs to be provided as Index or as as Tree/Commit, or a git command error will occur""" - args = list() + args = [] args.append("--abbrev=40") # we need full shas args.append("--full-index") # get full index paths, not only filenames diff --git a/git/index/base.py b/git/index/base.py index a9e3a3c..14a3117 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -8,7 +8,6 @@ import os from stat import S_ISLNK import subprocess -import sys import tempfile from git.compat import ( @@ -18,7 +17,6 @@ force_bytes, defenc, mviter, - is_win ) from git.exc import ( GitCommandError, @@ -121,20 +119,14 @@ ok = True except OSError: # in new repositories, there may be no index, which means we are empty - self.entries = dict() + self.entries = {} return finally: if not ok: lfd.rollback() # END exception handling - # Here it comes: on windows in python 2.5, memory maps aren't closed properly - # Hence we are in trouble if we try to delete a file that is memory mapped, - # which happens during read-tree. - # In this case, we will just read the memory in directly. - # Its insanely bad ... I am disappointed ! - allow_mmap = (is_win or sys.version_info[1] > 5) - stream = file_contents_ro(fd, stream=True, allow_mmap=allow_mmap) + stream = file_contents_ro(fd, stream=True, allow_mmap=True) try: self._deserialize(stream) @@ -324,7 +316,7 @@ if len(treeish) == 0 or len(treeish) > 3: raise ValueError("Please specify between 1 and 3 treeish, got %i" % len(treeish)) - arg_list = list() + arg_list = [] # ignore that working tree and index possibly are out of date if len(treeish) > 1: # drop unmerged entries when reading our index and merging @@ -471,9 +463,9 @@ are at stage 3 will not have a stage 3 entry. """ is_unmerged_blob = lambda t: t[0] != 0 - path_map = dict() + path_map = {} for stage, blob in self.iter_blobs(is_unmerged_blob): - path_map.setdefault(blob.path, list()).append((stage, blob)) + path_map.setdefault(blob.path, []).append((stage, blob)) # END for each unmerged blob for l in mviter(path_map): l.sort() @@ -576,8 +568,8 @@ def _preprocess_add_items(self, items): """ Split the items into two lists of path strings and BaseEntries. """ - paths = list() - entries = list() + paths = [] + entries = [] for item in items: if isinstance(item, string_types): @@ -610,7 +602,7 @@ @unbare_repo @git_working_dir def _entries_for_paths(self, paths, path_rewriter, fprogress, entries): - entries_added = list() + entries_added = [] if path_rewriter: for path in paths: if osp.isabs(path): @@ -742,7 +734,7 @@ # automatically # paths can be git-added, for everything else we use git-update-index paths, entries = self._preprocess_add_items(items) - entries_added = list() + entries_added = [] # This code needs a working tree, therefore we try not to run it unless required. # That way, we are OK on a bare repository as well. # If there are no paths, the rewriter has nothing to do either @@ -809,7 +801,7 @@ def _items_to_rela_paths(self, items): """Returns a list of repo-relative paths from the given items which may be absolute or relative paths, entries or blobs""" - paths = list() + paths = [] for item in items: if isinstance(item, (BaseIndexEntry, (Blob, Submodule))): paths.append(self._to_relative_path(item.path)) @@ -858,7 +850,7 @@ been removed effectively. This is interesting to know in case you have provided a directory or globs. Paths are relative to the repository. """ - args = list() + args = [] if not working_tree: args.append("--cached") args.append("--") @@ -897,7 +889,7 @@ :raise ValueError: If only one item was given GitCommandError: If git could not handle your request""" - args = list() + args = [] if skip_errors: args.append('-k') @@ -910,7 +902,7 @@ # first execute rename in dryrun so the command tells us what it actually does # ( for later output ) - out = list() + out = [] mvlines = self.repo.git.mv(args, paths, **kwargs).splitlines() # parse result - first 0:n/2 lines are 'checking ', the remaining ones @@ -1041,9 +1033,9 @@ # line contents: stderr = stderr.decode(defenc) # git-checkout-index: this already exists - failed_files = list() - failed_reasons = list() - unknown_lines = list() + failed_files = [] + failed_reasons = [] + unknown_lines = [] endings = (' already exists', ' is not in the cache', ' does not exist at stage', ' is unmerged') for line in stderr.splitlines(): if not line.startswith("git checkout-index: ") and not line.startswith("git-checkout-index: "): @@ -1106,7 +1098,7 @@ proc = self.repo.git.checkout_index(args, **kwargs) # FIXME: Reading from GIL! make_exc = lambda: GitCommandError(("git-checkout-index",) + tuple(args), 128, proc.stderr.read()) - checked_out_files = list() + checked_out_files = [] for path in paths: co_path = to_native_path_linux(self._to_relative_path(path)) diff --git a/git/index/fun.py b/git/index/fun.py index c01a32b..c8912dd 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -187,7 +187,7 @@ * content_sha is a 20 byte sha on all cache file contents""" version, num_entries = read_header(stream) count = 0 - entries = dict() + entries = {} read = stream.read tell = stream.tell @@ -236,7 +236,7 @@ :param sl: slice indicating the range we should process on the entries list :return: tuple(binsha, list(tree_entry, ...)) a tuple of a sha and a list of tree entries being a tuple of hexsha, mode, name""" - tree_items = list() + tree_items = [] tree_items_append = tree_items.append ci = sl.start end = sl.stop @@ -295,7 +295,7 @@ :param tree_shas: 1, 2 or 3 trees as identified by their binary 20 byte shas If 1 or two, the entries will effectively correspond to the last given tree If 3 are given, a 3 way merge is performed""" - out = list() + out = [] out_append = out.append # one and two way is the same for us, as we don't have to handle an existing diff --git a/git/objects/blob.py b/git/objects/blob.py index 322f699..897f892 100644 --- a/git/objects/blob.py +++ b/git/objects/blob.py @@ -20,7 +20,7 @@ file_mode = 0o100644 link_mode = 0o120000 - __slots__ = tuple() + __slots__ = () @property def mime_type(self): diff --git a/git/objects/commit.py b/git/objects/commit.py index f29fbaa..b7d27d9 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -316,7 +316,7 @@ parent_commits = [repo.head.commit] except ValueError: # empty repositories have no head commit - parent_commits = list() + parent_commits = [] # END handle parent commits else: for p in parent_commits: @@ -450,7 +450,7 @@ readline = stream.readline self.tree = Tree(self.repo, hex_to_bin(readline().split()[1]), Tree.tree_id << 12, '') - self.parents = list() + self.parents = [] next_line = None while True: parent_line = readline() diff --git a/git/objects/fun.py b/git/objects/fun.py index d5b3f90..38dce0a 100644 --- a/git/objects/fun.py +++ b/git/objects/fun.py @@ -50,7 +50,7 @@ space_ord = ord(' ') len_data = len(data) i = 0 - out = list() + out = [] while i < len_data: mode = 0 @@ -132,18 +132,18 @@ :param path_prefix: a prefix to be added to the returned paths on this level, set it '' for the first iteration :note: The ordering of the returned items will be partially lost""" - trees_data = list() + trees_data = [] nt = len(tree_shas) for tree_sha in tree_shas: if tree_sha is None: - data = list() + data = [] else: data = tree_entries_from_data(odb.stream(tree_sha).read()) # END handle muted trees trees_data.append(data) # END for each sha to get data for - out = list() + out = [] out_append = out.append # find all matching entries and recursively process them together if the match @@ -193,7 +193,7 @@ * [1] mode as int * [2] path relative to the repository :param path_prefix: prefix to prepend to the front of all returned paths""" - entries = list() + entries = [] data = tree_entries_from_data(odb.stream(tree_sha).read()) # unpacking/packing is faster than accessing individual items diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 3315121..f37da34 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -3,10 +3,7 @@ import logging import os import stat -try: - from unittest import SkipTest -except ImportError: - from unittest2 import SkipTest +from unittest import SkipTest import uuid import git @@ -63,7 +60,7 @@ CLONE, FETCH, UPDWKTREE = [1 << x for x in range(RemoteProgress._num_op_codes, RemoteProgress._num_op_codes + 3)] _num_op_codes = RemoteProgress._num_op_codes + 3 - __slots__ = tuple() + __slots__ = () BEGIN = UpdateProgress.BEGIN @@ -142,7 +139,7 @@ try: return type(self).list_items(item.module()) except InvalidGitRepositoryError: - return list() + return [] # END handle intermediate items @classmethod diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py index fbd658d..f2035e5 100644 --- a/git/objects/submodule/root.py +++ b/git/objects/submodule/root.py @@ -22,7 +22,7 @@ 1 << x for x in range(UpdateProgress._num_op_codes, UpdateProgress._num_op_codes + 4)] _num_op_codes = UpdateProgress._num_op_codes + 4 - __slots__ = tuple() + __slots__ = () BEGIN = RootUpdateProgress.BEGIN @@ -38,7 +38,7 @@ """A (virtual) Root of all submodules in the given repository. It can be used to more easily traverse all submodules of the master repository""" - __slots__ = tuple() + __slots__ = () k_root_name = '__ROOT__' diff --git a/git/objects/tree.py b/git/objects/tree.py index ed7c243..d6134e3 100644 --- a/git/objects/tree.py +++ b/git/objects/tree.py @@ -189,7 +189,7 @@ def _get_intermediate_items(cls, index_object): if index_object.type == "tree": return tuple(index_object._iter_convert_to_object(index_object._cache)) - return tuple() + return () def _set_cache_(self, attr): if attr == "_cache": diff --git a/git/objects/util.py b/git/objects/util.py index 5c085ae..f630f96 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -153,7 +153,7 @@ offset = utctz_to_altz(offset) # now figure out the date and time portion - split time - date_formats = list() + date_formats = [] splitter = -1 if ',' in string_date: date_formats.append("%a, %d %b %Y") @@ -248,7 +248,7 @@ into one direction. Subclasses only need to implement one function. Instances of the Subclass must be hashable""" - __slots__ = tuple() + __slots__ = () @classmethod def _get_intermediate_items(cls, item): @@ -344,7 +344,7 @@ class Serializable(object): """Defines methods to serialize and deserialize objects from and into a data stream""" - __slots__ = tuple() + __slots__ = () def _serialize(self, stream): """Serialize the data of this object into the given data stream diff --git a/git/odict.py b/git/odict.py deleted file mode 100644 index f003d14..0000000 --- a/git/odict.py +++ /dev/null @@ -1,10 +0,0 @@ -try: - from collections import OrderedDict -except ImportError: - try: - from ordereddict import OrderedDict - except ImportError: - import warnings - warnings.warn("git-python needs the ordereddict module installed in python below 2.6 and below.") - warnings.warn("Using standard dictionary as substitute, and cause reordering when writing git config") - OrderedDict = dict diff --git a/git/refs/head.py b/git/refs/head.py index 9ad890d..4b0abb0 100644 --- a/git/refs/head.py +++ b/git/refs/head.py @@ -20,7 +20,7 @@ HEAD reference.""" _HEAD_NAME = 'HEAD' _ORIG_HEAD_NAME = 'ORIG_HEAD' - __slots__ = tuple() + __slots__ = () def __init__(self, repo, path=_HEAD_NAME): if path != self._HEAD_NAME: diff --git a/git/refs/log.py b/git/refs/log.py index 1c085ef..fc96268 100644 --- a/git/refs/log.py +++ b/git/refs/log.py @@ -32,7 +32,7 @@ """Named tuple allowing easy access to the revlog data fields""" _re_hexsha_only = re.compile('^[0-9A-Fa-f]{40}$') - __slots__ = tuple() + __slots__ = () def __repr__(self): """Representation of ourselves in git reflog format""" @@ -48,13 +48,13 @@ """:return: a string suitable to be placed in a reflog file""" act = self.actor time = self.time - return u"{0} {1} {2} <{3}> {4!s} {5}\t{6}\n".format(self.oldhexsha, - self.newhexsha, - act.name, - act.email, - time[0], - altz_to_utctz_str(time[1]), - self.message) + return u"{} {} {} <{}> {!s} {}\t{}\n".format(self.oldhexsha, + self.newhexsha, + act.name, + act.email, + time[0], + altz_to_utctz_str(time[1]), + self.message) @property def oldhexsha(self): diff --git a/git/refs/reference.py b/git/refs/reference.py index 734ed8b..aaa9b63 100644 --- a/git/refs/reference.py +++ b/git/refs/reference.py @@ -27,7 +27,7 @@ """Represents a named reference to any object. Subclasses may apply restrictions though, i.e. Heads can only point to commits.""" - __slots__ = tuple() + __slots__ = () _points_to_commits_only = False _resolve_ref_on_create = True _common_path_default = "refs" diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 8efeafc..a8ca653 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -444,7 +444,7 @@ pack_file_path = cls._get_packed_refs_path(repo) try: with open(pack_file_path, 'rb') as reader: - new_lines = list() + new_lines = [] made_change = False dropped_last_line = False for line in reader: diff --git a/git/refs/tag.py b/git/refs/tag.py index 37ee124..8f88c52 100644 --- a/git/refs/tag.py +++ b/git/refs/tag.py @@ -17,7 +17,7 @@ if tagref.tag is not None: print(tagref.tag.message)""" - __slots__ = tuple() + __slots__ = () _common_path_default = "refs/tags" @property diff --git a/git/remote.py b/git/remote.py index 813566a..8aec68e 100644 --- a/git/remote.py +++ b/git/remote.py @@ -542,7 +542,7 @@ if ' Push URL:' in line: yield line.split(': ')[-1] except GitCommandError as ex: - if any([msg in str(ex) for msg in ['correct access rights', 'cannot run ssh']]): + if any(msg in str(ex) for msg in ['correct access rights', 'cannot run ssh']): # If ssh is not setup to access this repository, see issue 694 result = Git().execute( ['git', 'config', '--get', 'remote.%s.url' % self.name] @@ -663,7 +663,7 @@ # lines which are no progress are fetch info lines # this also waits for the command to finish # Skip some progress lines that don't provide relevant information - fetch_info_lines = list() + fetch_info_lines = [] # Basically we want all fetch info lines which appear to be in regular form, and thus have a # command character. Everything else we ignore, cmds = set(FetchInfo._flag_map.keys()) diff --git a/git/repo/base.py b/git/repo/base.py index a477bf3..26c7c7e 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -485,15 +485,15 @@ def iter_commits(self, rev=None, paths='', **kwargs): """A list of Commit objects representing the history of a given ref/commit - :parm rev: + :param rev: revision specifier, see git-rev-parse for viable options. If None, the active branch will be used. - :parm paths: + :param paths: is an optional path or a list of paths to limit the returned commits to Commits that do not contain that path or the paths will not be returned. - :parm kwargs: + :param kwargs: Arguments to be passed to git-rev-list - common ones are max_count and skip @@ -519,7 +519,7 @@ raise ValueError("Please specify at least two revs, got only %i" % len(rev)) # end handle input - res = list() + res = [] try: lines = self.git.merge_base(*rev, **kwargs).splitlines() except GitCommandError as err: @@ -580,12 +580,12 @@ alts = f.read().decode(defenc) return alts.strip().splitlines() else: - return list() + return [] def _set_alternates(self, alts): """Sets the alternates - :parm alts: + :param alts: is the array of string paths representing the alternates at which git should look for objects, i.e. /home/user/repo/.git/objects @@ -664,7 +664,7 @@ **kwargs) # Untracked files preffix in porcelain mode prefix = "?? " - untracked_files = list() + untracked_files = [] for line in proc.stdout: line = line.decode(defenc) if not line.startswith(prefix): @@ -695,7 +695,7 @@ Unlike .blame(), this does not return the actual file's contents, only a stream of BlameEntry tuples. - :parm rev: revision specifier, see git-rev-parse for viable options. + :param rev: revision specifier, see git-rev-parse for viable options. :return: lazy iterator of BlameEntry tuples, where the commit indicates the commit to blame for the line, and range indicates a span of line numbers in the resulting file. @@ -704,7 +704,7 @@ should get a continuous range spanning all line numbers in the file. """ data = self.git.blame(rev, '--', file, p=True, incremental=True, stdout_as_string=False, **kwargs) - commits = dict() + commits = {} stream = (line for line in data.split(b'\n') if line) while True: @@ -716,7 +716,7 @@ if hexsha not in commits: # Now read the next few lines and build up a dict of properties # for this commit - props = dict() + props = {} while True: line = next(stream) if line == b'boundary': @@ -757,7 +757,7 @@ def blame(self, rev, file, incremental=False, **kwargs): """The blame information for the given file at the given revision. - :parm rev: revision specifier, see git-rev-parse for viable options. + :param rev: revision specifier, see git-rev-parse for viable options. :return: list: [git.Commit, list: []] A list of tuples associating a Commit object with a list of lines that @@ -767,8 +767,8 @@ return self.blame_incremental(rev, file, **kwargs) data = self.git.blame(rev, '--', file, p=True, stdout_as_string=False, **kwargs) - commits = dict() - blames = list() + commits = {} + blames = [] info = None keepends = True @@ -871,7 +871,7 @@ or None in which case the repository will be created in the current working directory - :parm mkdir: + :param mkdir: if specified will create the repository directory if it doesn't already exists. Creates the directory with a mode=0755. Only effective if a path is explicitly given @@ -886,7 +886,7 @@ can lead to information disclosure, allowing attackers to access the contents of environment variables - :parm kwargs: + :param kwargs: keyword arguments serving as additional options to the git-init command :return: ``git.Repo`` (the newly created repo)""" @@ -984,10 +984,10 @@ def archive(self, ostream, treeish=None, prefix=None, **kwargs): """Archive the tree at the given revision. - :parm ostream: file compatible stream object to which the archive will be written as bytes - :parm treeish: is the treeish name/id, defaults to active branch - :parm prefix: is the optional prefix to prepend to each filename in the archive - :parm kwargs: Additional arguments passed to git-archive + :param ostream: file compatible stream object to which the archive will be written as bytes + :param treeish: is the treeish name/id, defaults to active branch + :param prefix: is the optional prefix to prepend to each filename in the archive + :param kwargs: Additional arguments passed to git-archive * Use the 'format' argument to define the kind of format. Use specialized ostreams to write any format supported by python. @@ -1001,7 +1001,7 @@ if prefix and 'prefix' not in kwargs: kwargs['prefix'] = prefix kwargs['output_stream'] = ostream - path = kwargs.pop('path', list()) + path = kwargs.pop('path', []) if not isinstance(path, (tuple, list)): path = [path] # end assure paths is list diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index cb46173..1c06010 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -15,6 +15,7 @@ import tempfile import textwrap import time +import unittest from git.compat import string_types, is_win from git.util import rmtree, cwd @@ -22,11 +23,6 @@ import os.path as osp - -if sys.version_info[0:2] == (2, 6): - import unittest2 as unittest -else: - import unittest TestCase = unittest.TestCase SkipTest = unittest.SkipTest @@ -348,7 +344,6 @@ of the project history ( to assure tests don't fail for others ). """ - # On py26, unittest2 has assertRaisesRegex # On py3, unittest has assertRaisesRegex # On py27, we use unittest, which names it differently: if sys.version_info[0:2] == (2, 7): diff --git a/git/test/performance/test_odb.py b/git/test/performance/test_odb.py index 425af84..8bd614f 100644 --- a/git/test/performance/test_odb.py +++ b/git/test/performance/test_odb.py @@ -28,11 +28,11 @@ # GET TREES # walk all trees of all commits st = time() - blobs_per_commit = list() + blobs_per_commit = [] nt = 0 for commit in commits: tree = commit.tree - blobs = list() + blobs = [] for item in tree.traverse(): nt += 1 if item.type == 'blob': diff --git a/git/test/performance/test_streams.py b/git/test/performance/test_streams.py index 3909d8f..2e3772a 100644 --- a/git/test/performance/test_streams.py +++ b/git/test/performance/test_streams.py @@ -69,7 +69,7 @@ # reading in chunks of 1 MiB cs = 512 * 1000 - chunks = list() + chunks = [] st = time() ostream = ldb.stream(binsha) while True: diff --git a/git/test/test_base.py b/git/test/test_base.py index 69f161b..2132806 100644 --- a/git/test/test_base.py +++ b/git/test/test_base.py @@ -7,10 +7,7 @@ import os import sys import tempfile -try: - from unittest import SkipTest, skipIf -except ImportError: - from unittest2 import SkipTest, skipIf +from unittest import SkipTest, skipIf from git import ( Blob, diff --git a/git/test/test_diff.py b/git/test/test_diff.py index 48a5a64..d21dde6 100644 --- a/git/test/test_diff.py +++ b/git/test/test_diff.py @@ -217,7 +217,7 @@ def test_diff_interface(self): # test a few variations of the main diff routine - assertion_map = dict() + assertion_map = {} for i, commit in enumerate(self.rorepo.iter_commits('0.1.6', max_count=2)): diff_item = commit if i % 2 == 0: diff --git a/git/test/test_docs.py b/git/test/test_docs.py index 1ba3f48..67ffb93 100644 --- a/git/test/test_docs.py +++ b/git/test/test_docs.py @@ -173,7 +173,7 @@ # [14-test_init_repo_object] # create a new submodule and check it out on the spot, setup to track master branch of `bare_repo` - # As our GitPython repository has submodules already that point to github, make sure we don't + # As our GitPython repository has submodules already that point to GitHub, make sure we don't # interact with them for sm in cloned_repo.submodules: assert not sm.remove().exists() # after removal, the sm doesn't exist anymore diff --git a/git/test/test_fun.py b/git/test/test_fun.py index 5e32a1f..314fb73 100644 --- a/git/test/test_fun.py +++ b/git/test/test_fun.py @@ -2,11 +2,7 @@ from stat import S_IFDIR, S_IFREG, S_IFLNK from os import stat import os.path as osp - -try: - from unittest import skipIf, SkipTest -except ImportError: - from unittest2 import skipIf, SkipTest +from unittest import skipIf, SkipTest from git import Git from git.compat import PY3 @@ -215,7 +211,7 @@ def _assert_tree_entries(self, entries, num_trees): for entry in entries: assert len(entry) == num_trees - paths = set(e[2] for e in entry if e) + paths = {e[2] for e in entry if e} # only one path per set of entries assert len(paths) == 1 diff --git a/git/test/test_git.py b/git/test/test_git.py index 059f90c..c6180f7 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -91,7 +91,7 @@ # order is undefined res = self.git.transform_kwargs(**{'s': True, 't': True}) - self.assertEqual(set(['-s', '-t']), set(res)) + self.assertEqual({'-s', '-t'}, set(res)) def test_it_executes_git_to_shell_and_returns_result(self): assert_match(r'^git version [\d\.]{2}.*$', self.git.execute(["git", "version"])) diff --git a/git/test/test_index.py b/git/test/test_index.py index 757bec9..9be4031 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -11,12 +11,8 @@ S_ISLNK, ST_MODE ) -import sys import tempfile -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf from git import ( IndexFile, @@ -101,7 +97,7 @@ def _reset_progress(self): # maps paths to the count of calls - self._fprogress_map = dict() + self._fprogress_map = {} def _assert_entries(self, entries): for entry in entries: @@ -131,7 +127,7 @@ # test stage index_merge = IndexFile(self.rorepo, fixture_path("index_merge")) self.assertEqual(len(index_merge.entries), 106) - assert len(list(e for e in index_merge.entries.values() if e.stage != 0)) + assert len([e for e in index_merge.entries.values() if e.stage != 0]) # write the data - it must match the original tmpfile = tempfile.mktemp() @@ -145,14 +141,14 @@ if isinstance(tree, str): tree = self.rorepo.commit(tree).tree - blist = list() + blist = [] for blob in tree.traverse(predicate=lambda e, d: e.type == "blob", branch_first=False): assert (blob.path, 0) in index.entries blist.append(blob) # END for each blob in tree if len(blist) != len(index.entries): - iset = set(k[0] for k in index.entries.keys()) - bset = set(b.path for b in blist) + iset = {k[0] for k in index.entries.keys()} + bset = {b.path for b in blist} raise AssertionError("CMP Failed: Missing entries in index: %s, missing in tree: %s" % (bset - iset, iset - bset)) # END assertion message @@ -168,9 +164,7 @@ except Exception as ex: msg_py3 = "required argument is not an integer" msg_py2 = "cannot convert argument to integer" - msg_py26 = "unsupported operand type(s) for &: 'str' and 'long'" - assert msg_py2 in str(ex) or msg_py3 in str(ex) or \ - msg_py26 in str(ex), str(ex) + assert msg_py2 in str(ex) or msg_py3 in str(ex) ## 2nd time should not fail due to stray lock file try: @@ -180,9 +174,6 @@ @with_rw_repo('0.1.6') def test_index_file_from_tree(self, rw_repo): - if sys.version_info < (2, 7): - ## Skipped, not `assertRaisesRegexp` in py2.6 - return common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541" cur_sha = "4b43ca7ff72d5f535134241e7c797ddc9c7a3573" other_sha = "39f85c4358b7346fee22169da9cad93901ea9eb9" @@ -199,7 +190,7 @@ # merge three trees - here we have a merge conflict three_way_index = IndexFile.from_tree(rw_repo, common_ancestor_sha, cur_sha, other_sha) - assert len(list(e for e in three_way_index.entries.values() if e.stage != 0)) + assert len([e for e in three_way_index.entries.values() if e.stage != 0]) # ITERATE BLOBS merge_required = lambda t: t[0] != 0 @@ -235,7 +226,7 @@ def test_index_merge_tree(self, rw_repo): # A bit out of place, but we need a different repo for this: self.assertNotEqual(self.rorepo, rw_repo) - self.assertEqual(len(set((self.rorepo, self.rorepo, rw_repo, rw_repo))), 2) + self.assertEqual(len({self.rorepo, self.rorepo, rw_repo, rw_repo}), 2) # SINGLE TREE MERGE # current index is at the (virtual) cur_commit @@ -536,7 +527,7 @@ # same index, no parents commit_message = "index without parents" - commit_no_parents = index.commit(commit_message, parent_commits=list(), head=True) + commit_no_parents = index.commit(commit_message, parent_commits=[], head=True) self.assertEqual(commit_no_parents.message, commit_message) self.assertEqual(len(commit_no_parents.parents), 0) self.assertEqual(cur_head.commit, commit_no_parents) @@ -891,10 +882,10 @@ _make_hook( index.repo.git_dir, 'commit-msg', - 'echo -n " {0}" >> "$1"'.format(from_hook_message) + 'echo -n " {}" >> "$1"'.format(from_hook_message) ) new_commit = index.commit(commit_message) - self.assertEqual(new_commit.message, u"{0} {1}".format(commit_message, from_hook_message)) + self.assertEqual(new_commit.message, u"{} {}".format(commit_message, from_hook_message)) @with_rw_repo('HEAD', bare=True) def test_commit_msg_hook_fail(self, rw_repo): diff --git a/git/test/test_refs.py b/git/test/test_refs.py index f885617..348c3d4 100644 --- a/git/test/test_refs.py +++ b/git/test/test_refs.py @@ -45,7 +45,7 @@ TagReference(self.rorepo, "refs/invalid/tag", check_path=False) def test_tag_base(self): - tag_object_refs = list() + tag_object_refs = [] for tag in self.rorepo.tags: assert "refs/tags" in tag.path assert tag.name diff --git a/git/test/test_remote.py b/git/test/test_remote.py index ad9210f..7c1711c 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -6,10 +6,7 @@ import random import tempfile -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf from git import ( RemoteProgress, @@ -47,8 +44,8 @@ def __init__(self): super(TestRemoteProgress, self).__init__() - self._seen_lines = list() - self._stages_per_op = dict() + self._seen_lines = [] + self._stages_per_op = {} self._num_progress_messages = 0 def _parse_progress_line(self, line): diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 2c3ad95..97eac4a 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -9,12 +9,8 @@ import itertools import os import pickle -import sys import tempfile -try: - from unittest import skipIf, SkipTest -except ImportError: - from unittest2 import skipIf, SkipTest +from unittest import skipIf, SkipTest try: import pathlib @@ -364,9 +360,6 @@ @patch.object(Git, '_call_process') def test_should_display_blame_information(self, git): - if sys.version_info < (2, 7): - ## Skipped, not `assertRaisesRegexp` in py2.6 - return git.return_value = fixture('blame') b = self.rorepo.blame('master', 'lib/git.py') assert_equal(13, len(b)) @@ -522,7 +515,7 @@ # this is only a preliminary test, more testing done in test_index self.assertEqual(self.rorepo, self.rorepo) self.assertFalse(self.rorepo != self.rorepo) - self.assertEqual(len(set((self.rorepo, self.rorepo))), 1) + self.assertEqual(len({self.rorepo, self.rorepo}), 1) @with_rw_directory def test_tilde_and_env_vars_in_repo_path(self, rw_dir): @@ -792,8 +785,6 @@ def test_repo_odbtype(self): target_type = GitCmdObjectDB - if sys.version_info[:2] < (2, 5): - target_type = GitCmdObjectDB self.assertIsInstance(self.rorepo.odb, target_type) def test_submodules(self): diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 5c8a279..0bf7638 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -3,10 +3,7 @@ # the BSD License: http://www.opensource.org/licenses/bsd-license.php import os import sys -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf import git from git.cmd import Git @@ -267,7 +264,7 @@ self.failUnlessRaises(ValueError, csm.remove, module=False, configuration=False) # module() is supposed to point to gitdb, which has a child-submodule whose URL is still pointing - # to github. To save time, we will change it to + # to GitHub. To save time, we will change it to csm.set_parent_commit(csm.repo.head.commit) with csm.config_writer() as cw: cw.set_value('url', self._small_repo_url()) diff --git a/git/test/test_tree.py b/git/test/test_tree.py index 5fd4d76..dc23f29 100644 --- a/git/test/test_tree.py +++ b/git/test/test_tree.py @@ -6,10 +6,7 @@ from io import BytesIO import sys -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf from git import ( Tree, @@ -64,7 +61,7 @@ def test_traverse(self): root = self.rorepo.tree('0.1.6') num_recursive = 0 - all_items = list() + all_items = [] for obj in root.traverse(): if "/" in obj.path: num_recursive += 1 @@ -82,7 +79,7 @@ # only choose trees trees_only = lambda i, d: i.type == "tree" trees = list(root.traverse(predicate=trees_only)) - assert len(trees) == len(list(i for i in root.traverse() if trees_only(i, 0))) + assert len(trees) == len([i for i in root.traverse() if trees_only(i, 0)]) # test prune lib_folder = lambda t, d: t.path == "lib" @@ -91,7 +88,7 @@ # trees and blobs assert len(set(trees) | set(root.trees)) == len(trees) - assert len(set(b for b in root if isinstance(b, Blob)) | set(root.blobs)) == len(root.blobs) + assert len({b for b in root if isinstance(b, Blob)} | set(root.blobs)) == len(root.blobs) subitem = trees[0][0] assert "/" in subitem.path assert subitem.name == osp.basename(subitem.path) diff --git a/git/test/test_util.py b/git/test/test_util.py index d30c837..b7925c8 100644 --- a/git/test/test_util.py +++ b/git/test/test_util.py @@ -6,10 +6,7 @@ import tempfile import time -try: - from unittest import skipIf -except ImportError: - from unittest2 import skipIf +from unittest import skipIf import ddt diff --git a/git/util.py b/git/util.py index 18c28fd..1186d31 100644 --- a/git/util.py +++ b/git/util.py @@ -14,10 +14,7 @@ import shutil import stat import time -try: - from unittest import SkipTest -except ImportError: - from unittest2 import SkipTest +from unittest import SkipTest from gitdb.util import (# NOQA @IgnorePep8 make_sha, @@ -372,7 +369,7 @@ re_op_relative = re.compile(r"(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)") def __init__(self): - self._seen_ops = list() + self._seen_ops = [] self._cur_line = None self.error_lines = [] self.other_lines = [] @@ -395,7 +392,7 @@ return [] sub_lines = line.split('\r') - failed_lines = list() + failed_lines = [] for sline in sub_lines: # find escape characters and cut them away - regex will not work with # them as they are non-ascii. As git might expect a tty, it will send them @@ -673,7 +670,7 @@ """Create a Stat object from output retrieved by git-diff. :return: git.Stat""" - hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': dict()} + hsh = {'total': {'insertions': 0, 'deletions': 0, 'lines': 0, 'files': 0}, 'files': {}} for line in text.splitlines(): (raw_insertions, raw_deletions, filename) = line.split("\t") insertions = raw_insertions != '-' and int(raw_insertions) or 0 @@ -802,11 +799,11 @@ def __init__(self, file_path, check_interval_s=0.3, max_block_time_s=MAXSIZE): """Configure the instance - :parm check_interval_s: + :param check_interval_s: Period of time to sleep until the lock is checked the next time. By default, it waits a nearly unlimited time - :parm max_block_time_s: Maximum amount of seconds we may lock""" + :param max_block_time_s: Maximum amount of seconds we may lock""" super(BlockingLockFile, self).__init__(file_path) self._check_interval = check_interval_s self._max_block_time = max_block_time_s @@ -920,7 +917,7 @@ """Defines an interface for iterable items which is to assure a uniform way to retrieve and iterate items within the git repository""" - __slots__ = tuple() + __slots__ = () _id_attribute_ = "attribute that most suitably identifies your instance" @classmethod diff --git a/requirements.txt b/requirements.txt index a8e7a7a..3964460 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ gitdb>=0.6.4 ddt>=1.1.1 -unittest2; python_version < '2.7' diff --git a/setup.py b/setup.py index 47523e0..2703a9c 100755 --- a/setup.py +++ b/setup.py @@ -9,8 +9,6 @@ from distutils.command.build_py import build_py as _build_py from setuptools.command.sdist import sdist as _sdist -import pkg_resources -import logging import os import sys from os import path @@ -47,7 +45,7 @@ def _stamp_version(filename): - found, out = False, list() + found, out = False, [] try: with open(filename, 'r') as f: for line in f: @@ -66,26 +64,7 @@ install_requires = ['gitdb2 >= 2.0.0'] -extras_require = { - ':python_version == "2.6"': ['ordereddict'], -} test_requires = ['ddt>=1.1.1'] -if sys.version_info[:2] < (2, 7): - test_requires.append('mock') - -try: - if 'bdist_wheel' not in sys.argv: - for key, value in extras_require.items(): - if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]): - install_requires.extend(value) -except Exception: - logging.getLogger(__name__).exception( - 'Something went wrong calculating platform specific dependencies, so ' - "you're getting them all!" - ) - for key, value in extras_require.items(): - if key.startswith(':'): - install_requires.extend(value) # end setup( @@ -101,7 +80,7 @@ package_data={'git.test': ['fixtures/*']}, package_dir={'git': 'git'}, license="BSD License", - python_requires='>=2.6, !=3.0.*, !=3.1.*, !=3.2.*', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', requires=['gitdb2 (>=2.0.0)'], install_requires=install_requires, test_requirements=test_requires + install_requires, @@ -126,10 +105,8 @@ "Operating System :: MacOS :: MacOS X", "Programming Language :: Python", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6",