Skip to content

Commit 38e9a18

Browse files
committed
Merge branch 'black-fmt'
2 parents b30720e + 43c00af commit 38e9a18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5271
-3683
lines changed

.flake8

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ ignore = E265,E266,E731,E704,
2525
A,
2626
D,
2727
RST, RST3
28-
max-line-length = 120
2928

3029
exclude = .tox,.venv,build,dist,doc,git/ext/,test
3130

3231
rst-roles = # for flake8-RST-docstrings
3332
attr,class,func,meth,mod,obj,ref,term,var # used by sphinx
3433

3534
min-python-version = 3.7.0
35+
36+
# for `black` compatibility
37+
max-line-length = 120
38+
extend-ignore = E203,W503

doc/source/conf.py

+44-46
Original file line numberDiff line numberDiff line change
@@ -20,100 +20,99 @@
2020
# If your extensions are in another directory, add it here. If the directory
2121
# is relative to the documentation root, use os.path.abspath to make it
2222
# absolute, like shown here.
23-
#sys.path.append(os.path.abspath('.'))
24-
sys.path.insert(0, os.path.abspath('../..'))
23+
# sys.path.append(os.path.abspath('.'))
24+
sys.path.insert(0, os.path.abspath("../.."))
2525

2626
# General configuration
2727
# ---------------------
2828

2929
# Add any Sphinx extension module names here, as strings. They can be extensions
3030
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
31-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
31+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest"]
3232

3333
# Add any paths that contain templates here, relative to this directory.
3434
templates_path = []
3535

3636
# The suffix of source filenames.
37-
source_suffix = '.rst'
37+
source_suffix = ".rst"
3838

3939
# The encoding of source files.
40-
#source_encoding = 'utf-8'
40+
# source_encoding = 'utf-8'
4141

4242
# The master toctree document.
43-
master_doc = 'index'
43+
master_doc = "index"
4444

4545
# General information about the project.
46-
project = 'GitPython'
47-
copyright = 'Copyright (C) 2008, 2009 Michael Trier and contributors, 2010-2015 Sebastian Thiel'
46+
project = "GitPython"
47+
copyright = "Copyright (C) 2008, 2009 Michael Trier and contributors, 2010-2015 Sebastian Thiel"
4848

4949
# The version info for the project you're documenting, acts as replacement for
5050
# |version| and |release|, also used in various other places throughout the
5151
# built documents.
5252
#
5353
# The short X.Y version.
54-
with open(os.path.join(os.path.dirname(__file__), "..", "..", 'VERSION')) as fd:
54+
with open(os.path.join(os.path.dirname(__file__), "..", "..", "VERSION")) as fd:
5555
VERSION = fd.readline().strip()
5656
version = VERSION
5757
# The full version, including alpha/beta/rc tags.
5858
release = VERSION
5959

6060
# The language for content autogenerated by Sphinx. Refer to documentation
6161
# for a list of supported languages.
62-
#language = None
62+
# language = None
6363

6464
# There are two options for replacing |today|: either, you set today to some
6565
# non-false value, then it is used:
66-
#today = ''
66+
# today = ''
6767
# Else, today_fmt is used as the format for a strftime call.
68-
#today_fmt = '%B %d, %Y'
68+
# today_fmt = '%B %d, %Y'
6969

7070
# List of documents that shouldn't be included in the build.
71-
#unused_docs = []
71+
# unused_docs = []
7272

7373
# List of directories, relative to source directory, that shouldn't be searched
7474
# for source files.
75-
exclude_trees = ['build']
75+
exclude_trees = ["build"]
7676

7777
# The reST default role (used for this markup: `text`) to use for all documents.
78-
#default_role = None
78+
# default_role = None
7979

8080
# If true, '()' will be appended to :func: etc. cross-reference text.
81-
#add_function_parentheses = True
81+
# add_function_parentheses = True
8282

8383
# If true, the current module name will be prepended to all description
8484
# unit titles (such as .. function::).
85-
#add_module_names = True
85+
# add_module_names = True
8686

8787
# If true, sectionauthor and moduleauthor directives will be shown in the
8888
# output. They are ignored by default.
89-
#show_authors = False
89+
# show_authors = False
9090

9191
# The name of the Pygments (syntax highlighting) style to use.
92-
pygments_style = 'sphinx'
92+
pygments_style = "sphinx"
9393

9494

9595
# Options for HTML output
9696
# -----------------------
9797

98-
html_theme = 'sphinx_rtd_theme'
99-
html_theme_options = {
100-
}
98+
html_theme = "sphinx_rtd_theme"
99+
html_theme_options = {}
101100

102101
# The name for this set of Sphinx documents. If None, it defaults to
103102
# "<project> v<release> documentation".
104-
#html_title = None
103+
# html_title = None
105104

106105
# A shorter title for the navigation bar. Default is the same as html_title.
107-
#html_short_title = None
106+
# html_short_title = None
108107

109108
# The name of an image file (relative to this directory) to place at the top
110109
# of the sidebar.
111-
#html_logo = None
110+
# html_logo = None
112111

113112
# The name of an image file (within the static path) to use as favicon of the
114113
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
115114
# pixels large.
116-
#html_favicon = None
115+
# html_favicon = None
117116

118117
# Add any paths that contain custom static files (such as style sheets) here,
119118
# relative to this directory. They are copied after the builtin static files,
@@ -122,72 +121,71 @@
122121

123122
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
124123
# using the given strftime format.
125-
#html_last_updated_fmt = '%b %d, %Y'
124+
# html_last_updated_fmt = '%b %d, %Y'
126125

127126
# If true, SmartyPants will be used to convert quotes and dashes to
128127
# typographically correct entities.
129-
#html_use_smartypants = True
128+
# html_use_smartypants = True
130129

131130
# Custom sidebar templates, maps document names to template names.
132-
#html_sidebars = {}
131+
# html_sidebars = {}
133132

134133
# Additional templates that should be rendered to pages, maps page names to
135134
# template names.
136-
#html_additional_pages = {}
135+
# html_additional_pages = {}
137136

138137
# If false, no module index is generated.
139-
#html_use_modindex = True
138+
# html_use_modindex = True
140139

141140
# If false, no index is generated.
142-
#html_use_index = True
141+
# html_use_index = True
143142

144143
# If true, the index is split into individual pages for each letter.
145-
#html_split_index = False
144+
# html_split_index = False
146145

147146
# If true, the reST sources are included in the HTML build as _sources/<name>.
148-
#html_copy_source = True
147+
# html_copy_source = True
149148

150149
# If true, an OpenSearch description file will be output, and all pages will
151150
# contain a <link> tag referring to it. The value of this option must be the
152151
# base URL from which the finished HTML is served.
153-
#html_use_opensearch = ''
152+
# html_use_opensearch = ''
154153

155154
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
156-
#html_file_suffix = ''
155+
# html_file_suffix = ''
157156

158157
# Output file base name for HTML help builder.
159-
htmlhelp_basename = 'gitpythondoc'
158+
htmlhelp_basename = "gitpythondoc"
160159

161160

162161
# Options for LaTeX output
163162
# ------------------------
164163

165164
# The paper size ('letter' or 'a4').
166-
#latex_paper_size = 'letter'
165+
# latex_paper_size = 'letter'
167166

168167
# The font size ('10pt', '11pt' or '12pt').
169-
#latex_font_size = '10pt'
168+
# latex_font_size = '10pt'
170169

171170
# Grouping the document tree into LaTeX files. List of tuples
172171
# (source start file, target name, title, author, document class [howto/manual]).
173172
latex_documents = [
174-
('index', 'GitPython.tex', r'GitPython Documentation',
175-
r'Michael Trier', 'manual'),
173+
("index", "GitPython.tex", r"GitPython Documentation", r"Michael Trier", "manual"),
176174
]
177175

178176
# The name of an image file (relative to this directory) to place at the top of
179177
# the title page.
180-
#latex_logo = None
178+
# latex_logo = None
181179

182180
# For "manual" documents, if this is true, then toplevel headings are parts,
183181
# not chapters.
184-
#latex_use_parts = False
182+
# latex_use_parts = False
185183

186184
# Additional stuff for the LaTeX preamble.
187-
#latex_preamble = ''
185+
# latex_preamble = ''
188186

189187
# Documents to append as an appendix to all manuals.
190-
#latex_appendices = []
188+
# latex_appendices = []
191189

192190
# If false, no module index is generated.
193-
#latex_use_modindex = True
191+
# latex_use_modindex = True

git/__init__.py

+26-24
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# This module is part of GitPython and is released under
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66
# flake8: noqa
7-
#@PydevCodeAnalysisIgnore
8-
from git.exc import * # @NoMove @IgnorePep8
7+
# @PydevCodeAnalysisIgnore
8+
from git.exc import * # @NoMove @IgnorePep8
99
import inspect
1010
import os
1111
import sys
@@ -14,57 +14,57 @@
1414
from typing import Optional
1515
from git.types import PathLike
1616

17-
__version__ = 'git'
17+
__version__ = "git"
1818

1919

20-
#{ Initialization
20+
# { Initialization
2121
def _init_externals() -> None:
2222
"""Initialize external projects by putting them into the path"""
23-
if __version__ == 'git' and 'PYOXIDIZER' not in os.environ:
24-
sys.path.insert(1, osp.join(osp.dirname(__file__), 'ext', 'gitdb'))
23+
if __version__ == "git" and "PYOXIDIZER" not in os.environ:
24+
sys.path.insert(1, osp.join(osp.dirname(__file__), "ext", "gitdb"))
2525

2626
try:
2727
import gitdb
2828
except ImportError as e:
2929
raise ImportError("'gitdb' could not be found in your PYTHONPATH") from e
3030
# END verify import
3131

32-
#} END initialization
32+
33+
# } END initialization
3334

3435

3536
#################
3637
_init_externals()
3738
#################
3839

39-
#{ Imports
40+
# { Imports
4041

4142
try:
4243
from git.config import GitConfigParser # @NoMove @IgnorePep8
43-
from git.objects import * # @NoMove @IgnorePep8
44-
from git.refs import * # @NoMove @IgnorePep8
45-
from git.diff import * # @NoMove @IgnorePep8
46-
from git.db import * # @NoMove @IgnorePep8
47-
from git.cmd import Git # @NoMove @IgnorePep8
48-
from git.repo import Repo # @NoMove @IgnorePep8
49-
from git.remote import * # @NoMove @IgnorePep8
50-
from git.index import * # @NoMove @IgnorePep8
51-
from git.util import ( # @NoMove @IgnorePep8
44+
from git.objects import * # @NoMove @IgnorePep8
45+
from git.refs import * # @NoMove @IgnorePep8
46+
from git.diff import * # @NoMove @IgnorePep8
47+
from git.db import * # @NoMove @IgnorePep8
48+
from git.cmd import Git # @NoMove @IgnorePep8
49+
from git.repo import Repo # @NoMove @IgnorePep8
50+
from git.remote import * # @NoMove @IgnorePep8
51+
from git.index import * # @NoMove @IgnorePep8
52+
from git.util import ( # @NoMove @IgnorePep8
5253
LockFile,
5354
BlockingLockFile,
5455
Stats,
5556
Actor,
5657
rmtree,
5758
)
5859
except GitError as exc:
59-
raise ImportError('%s: %s' % (exc.__class__.__name__, exc)) from exc
60+
raise ImportError("%s: %s" % (exc.__class__.__name__, exc)) from exc
6061

61-
#} END imports
62+
# } END imports
6263

63-
__all__ = [name for name, obj in locals().items()
64-
if not (name.startswith('_') or inspect.ismodule(obj))]
64+
__all__ = [name for name, obj in locals().items() if not (name.startswith("_") or inspect.ismodule(obj))]
6565

6666

67-
#{ Initialize git executable path
67+
# { Initialize git executable path
6868
GIT_OK = None
6969

7070

@@ -79,12 +79,14 @@ def refresh(path: Optional[PathLike] = None) -> None:
7979
return
8080

8181
GIT_OK = True
82-
#} END initialize git executable path
82+
83+
84+
# } END initialize git executable path
8385

8486

8587
#################
8688
try:
8789
refresh()
8890
except Exception as exc:
89-
raise ImportError('Failed to initialize: {0}'.format(exc)) from exc
91+
raise ImportError("Failed to initialize: {0}".format(exc)) from exc
9092
#################

0 commit comments

Comments
 (0)