@@ -10,8 +10,6 @@ | |||
| 10 | 10 | S_IFREG, | |
| 11 | 11 | ) | |
| 12 | 12 | ||
| 13 | - S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule | ||
| 14 | - | ||
| 15 | 13 | from io import BytesIO | |
| 16 | 14 | import os | |
| 17 | 15 | import subprocess | |
@@ -33,7 +31,6 @@ | |||
| 33 | 31 | CE_NAMEMASK, | |
| 34 | 32 | CE_STAGESHIFT | |
| 35 | 33 | ) | |
| 36 | - CE_NAMEMASK_INV = ~CE_NAMEMASK | ||
| 37 | 34 | ||
| 38 | 35 | from .util import ( | |
| 39 | 36 | pack, | |
@@ -47,6 +44,9 @@ | |||
| 47 | 44 | force_text | |
| 48 | 45 | ) | |
| 49 | 46 | ||
| 47 | + S_IFGITLINK = S_IFLNK | S_IFDIR # a submodule | ||
| 48 | + CE_NAMEMASK_INV = ~CE_NAMEMASK | ||
| 49 | + | ||
| 50 | 50 | __all__ = ('write_cache', 'read_cache', 'write_tree_from_cache', 'entry_key', | |
| 51 | 51 | 'stat_mode_to_index_mode', 'S_IFGITLINK', 'run_commit_hook', 'hook_path') | |
| 52 | 52 | ||
@@ -15,7 +15,9 @@ | |||
| 15 | 15 | from git import Repo, Remote, GitCommandError, Git | |
| 16 | 16 | from git.compat import string_types | |
| 17 | 17 | ||
| 18 | - GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))) | ||
| 18 | + osp = os.path.dirname | ||
| 19 | + | ||
| 20 | + GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", osp(osp(osp(osp(__file__))))) | ||
| 19 | 21 | ||
| 20 | 22 | __all__ = ( | |
| 21 | 23 | 'fixture_path', 'fixture', 'absolute_project_path', 'StringProcessAdapter', | |
@@ -26,7 +28,7 @@ | |||
| 26 | 28 | ||
| 27 | 29 | ||
| 28 | 30 | def fixture_path(name): | |
| 29 | - test_dir = os.path.dirname(os.path.dirname(__file__)) | ||
| 31 | + test_dir = osp(osp(__file__)) | ||
| 30 | 32 | return os.path.join(test_dir, "fixtures", name) | |
| 31 | 33 | ||
| 32 | 34 | ||
@@ -35,7 +37,7 @@ def fixture(name): | |||
| 35 | 37 | ||
| 36 | 38 | ||
| 37 | 39 | def absolute_project_path(): | |
| 38 | - return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) | ||
| 40 | + return os.path.abspath(os.path.join(osp(__file__), "..", "..")) | ||
| 39 | 41 | ||
| 40 | 42 | #} END routines | |
| 41 | 43 | ||
@@ -195,7 +197,7 @@ def remote_repo_creator(self): | |||
| 195 | 197 | ||
| 196 | 198 | d_remote.config_writer.set('url', remote_repo_url) | |
| 197 | 199 | ||
| 198 | - temp_dir = os.path.dirname(_mktemp()) | ||
| 200 | + temp_dir = osp(_mktemp()) | ||
| 199 | 201 | # On windows, this will fail ... we deal with failures anyway and default to telling the user to do it | |
| 200 | 202 | try: | |
| 201 | 203 | gd = Git().daemon(temp_dir, enable='receive-pack', as_process=True) | |
@@ -120,7 +120,7 @@ def test_add_unicode(self, rw_repo): | |||
| 120 | 120 | ||
| 121 | 121 | # verify first that we could encode file name in this environment | |
| 122 | 122 | try: | |
| 123 | - _ = file_path.encode(sys.getfilesystemencoding()) | ||
| 123 | + file_path.encode(sys.getfilesystemencoding()) | ||
| 124 | 124 | except UnicodeEncodeError: | |
| 125 | 125 | from nose import SkipTest | |
| 126 | 126 | raise SkipTest("Environment doesn't support unicode filenames") | |
@@ -18,7 +18,9 @@ commands = {posargs} | |||
| 18 | 18 | [flake8] | |
| 19 | 19 | #show-source = True | |
| 20 | 20 | # E265 = comment blocks like @{ section, which it can't handle | |
| 21 | + # E266 = too many leading '#' for block comment | ||
| 22 | + # E731 = do not assign a lambda expression, use a def | ||
| 21 | 23 | # W293 = Blank line contains whitespace | |
| 22 | - ignore = E265,W293 | ||
| 24 | + ignore = E265,W293,E266,E731 | ||
| 23 | 25 | max-line-length = 120 | |
| 24 | 26 | exclude = .tox,.venv,build,dist,doc,git/ext/ | |
0 commit comments