Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1de8af9

Browse files
committed
Removed unnecessary (non-gitpython) tests and fixed flake8
1 parent6f55c17 commit1de8af9

File tree

15 files changed

+39
-224
lines changed

15 files changed

+39
-224
lines changed

‎git/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
6+
# flake8: noqa
67

78
importos
89
importsys

‎git/exc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
""" Module containing all exceptions thrown througout the git package, """
77

8-
fromgitdb.excimport*
8+
fromgitdb.excimport*# NOQA
99

1010

1111
classInvalidGitRepositoryError(Exception):

‎git/index/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Initialize the index package"""
2-
2+
# flake8: noqa
33
from __future__importabsolute_import
44

55
from .baseimport*

‎git/objects/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Import all submodules main classes into the package space
33
"""
4+
# flake8: noqa
45
from __future__importabsolute_import
56
importinspect
67
from .baseimport*

‎git/objects/blob.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class Blob(base.IndexObject):
1717
type="blob"
1818

1919
# valid blob modes
20-
executable_mode=0100755
21-
file_mode=0100644
22-
link_mode=0120000
20+
executable_mode=0o100755
21+
file_mode=0o100644
22+
link_mode=0o120000
2323

2424
__slots__=tuple()
2525

‎git/objects/tree.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ class Tree(IndexObject, diff.Diffable, util.Traversable, util.Serializable):
119119
__slots__="_cache"
120120

121121
# actual integer ids for comparison
122-
commit_id=016# equals stat.S_IFDIR | stat.S_IFLNK - a directory link
123-
blob_id=010
124-
symlink_id=012
125-
tree_id=004
122+
commit_id=0o16# equals stat.S_IFDIR | stat.S_IFLNK - a directory link
123+
blob_id=0o10
124+
symlink_id=0o12
125+
tree_id=0o04
126126

127127
_map_id_to_type= {
128128
commit_id:Submodule,

‎git/refs/__init__.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
# flake8: noqa
22
from __future__importabsolute_import
33
# import all modules in order, fix the names they require
44
from .symbolicimport*
@@ -7,16 +7,4 @@
77
from .tagimport*
88
from .remoteimport*
99

10-
# name fixes
11-
from .importhead
12-
head.RemoteReference=RemoteReference
13-
del(head)
14-
15-
16-
from .importsymbolic
17-
foritemin (HEAD,Head,RemoteReference,TagReference,Reference,SymbolicReference):
18-
setattr(symbolic,item.__name__,item)
19-
del(symbolic)
20-
21-
2210
from .logimport*

‎git/refs/head.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def reset(self, commit='HEAD', index=True, working_tree=False,
8181

8282
try:
8383
self.repo.git.reset(mode,commit,add_arg,paths,**kwargs)
84-
exceptGitCommandError,e:
84+
exceptGitCommandErrorase:
8585
# git nowadays may use 1 as status to indicate there are still unstaged
8686
# modifications after the reset
8787
ife.status!=1:
@@ -134,6 +134,7 @@ def set_tracking_branch(self, remote_reference):
134134
:param remote_reference: The remote reference to track or None to untrack
135135
any references
136136
:return: self"""
137+
from .remoteimportRemoteReference
137138
ifremote_referenceisnotNoneandnotisinstance(remote_reference,RemoteReference):
138139
raiseValueError("Incorrect parameter type: %r"%remote_reference)
139140
# END handle type
@@ -156,6 +157,7 @@ def tracking_branch(self):
156157
"""
157158
:return: The remote_reference we are tracking, or None if we are
158159
not a tracking branch"""
160+
from .remoteimportRemoteReference
159161
reader=self.config_reader()
160162
ifreader.has_option(self.k_config_remote)andreader.has_option(self.k_config_remote_ref):
161163
ref=Head(self.repo,Head.to_full_path(reader.get_value(self.k_config_remote_ref)))

‎git/refs/symbolic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ def from_path(cls, repo, path):
625625

626626
# Names like HEAD are inserted after the refs module is imported - we have an import dependency
627627
# cycle and don't want to import these names in-function
628+
from .importHEAD,Head,RemoteReference,TagReference,Reference
628629
forref_typein (HEAD,Head,RemoteReference,TagReference,Reference,SymbolicReference):
629630
try:
630631
instance=ref_type(repo,path)

‎git/repo/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"""Initialize the Repo package"""
2+
# flake8: noqa
23
from __future__importabsolute_import
34
from .baseimport*

‎git/repo/base.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66

77
fromgit.excimportInvalidGitRepositoryError,NoSuchPathError
88
fromgit.cmdimportGit
9+
fromgit.refsimport (
10+
HEAD,
11+
Head,
12+
Reference,
13+
TagReference,
14+
)
15+
fromgit.objectsimport (
16+
Submodule,
17+
RootModule,
18+
Commit
19+
)
920
fromgit.utilimport (
1021
Actor,
1122
finalize_process
1223
)
13-
fromgit.refsimport*
1424
fromgit.indeximportIndexFile
15-
fromgit.objectsimport*
1625
fromgit.configimportGitConfigParser
1726
fromgit.remoteimport (
1827
Remote,
@@ -659,7 +668,7 @@ def init(cls, path=None, mkdir=True, **kwargs):
659668
:return: ``git.Repo`` (the newly created repo)"""
660669

661670
ifmkdirandpathandnotos.path.exists(path):
662-
os.makedirs(path,0755)
671+
os.makedirs(path,0o755)
663672

664673
# git command automatically chdir into the directory
665674
git=Git(path)

‎git/test/lib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

7+
# flake8: noqa
78
importinspect
89
from .assertsimport*
910
from .helperimport*

‎git/test/performance/test_utils.py

Lines changed: 0 additions & 190 deletions
This file was deleted.

‎git/util.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# Most of these are unused here, but are for use by git-python modules so these
2121
# don't see gitdb all the time. Flake of course doesn't like it.
22-
fromgitdb.utilimport (
22+
fromgitdb.utilimport (# NOQA
2323
make_sha,
2424
LockedFD,
2525
file_contents_ro,
@@ -84,14 +84,13 @@ def join_path(a, *p):
8484
returnpath
8585

8686

87-
defto_native_path_windows(path):
88-
returnpath.replace('/','\\')
89-
87+
ifsys.platform.startswith('win'):
88+
defto_native_path_windows(path):
89+
returnpath.replace('/','\\')
9090

91-
defto_native_path_linux(path):
92-
returnpath.replace('\\','/')
91+
defto_native_path_linux(path):
92+
returnpath.replace('\\','/')
9393

94-
ifsys.platform.startswith('win'):
9594
to_native_path=to_native_path_windows
9695
else:
9796
# no need for any work on linux

‎tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ commands = {posargs}
1717

1818
[flake8]
1919
#show-source = True
20-
ignore = E265,F403
20+
#E265 = it can't deal with my #{ section sections
21+
#F403 = from module import * in __init__
22+
ignore = E265
2123
max-line-length = 120
2224
exclude = .tox,.venv,build,dist,doc,git/ext/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp