Skip to content

Commit 21ec529

Browse files
committed
Run everything through 'black'
That way people who use it won't be deterred, while it unifies style everywhere.
1 parent b30720e commit 21ec529

Some content is hidden

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

65 files changed

+6674
-3918
lines changed

doc/source/conf.py

+46-46
Original file line numberDiff line numberDiff line change
@@ -20,100 +20,101 @@
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 = (
48+
"Copyright (C) 2008, 2009 Michael Trier and contributors, 2010-2015 Sebastian Thiel"
49+
)
4850

4951
# The version info for the project you're documenting, acts as replacement for
5052
# |version| and |release|, also used in various other places throughout the
5153
# built documents.
5254
#
5355
# The short X.Y version.
54-
with open(os.path.join(os.path.dirname(__file__), "..", "..", 'VERSION')) as fd:
56+
with open(os.path.join(os.path.dirname(__file__), "..", "..", "VERSION")) as fd:
5557
VERSION = fd.readline().strip()
5658
version = VERSION
5759
# The full version, including alpha/beta/rc tags.
5860
release = VERSION
5961

6062
# The language for content autogenerated by Sphinx. Refer to documentation
6163
# for a list of supported languages.
62-
#language = None
64+
# language = None
6365

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

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

7375
# List of directories, relative to source directory, that shouldn't be searched
7476
# for source files.
75-
exclude_trees = ['build']
77+
exclude_trees = ["build"]
7678

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

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

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

8789
# If true, sectionauthor and moduleauthor directives will be shown in the
8890
# output. They are ignored by default.
89-
#show_authors = False
91+
# show_authors = False
9092

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

9496

9597
# Options for HTML output
9698
# -----------------------
9799

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

102103
# The name for this set of Sphinx documents. If None, it defaults to
103104
# "<project> v<release> documentation".
104-
#html_title = None
105+
# html_title = None
105106

106107
# A shorter title for the navigation bar. Default is the same as html_title.
107-
#html_short_title = None
108+
# html_short_title = None
108109

109110
# The name of an image file (relative to this directory) to place at the top
110111
# of the sidebar.
111-
#html_logo = None
112+
# html_logo = None
112113

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

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

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

127128
# If true, SmartyPants will be used to convert quotes and dashes to
128129
# typographically correct entities.
129-
#html_use_smartypants = True
130+
# html_use_smartypants = True
130131

131132
# Custom sidebar templates, maps document names to template names.
132-
#html_sidebars = {}
133+
# html_sidebars = {}
133134

134135
# Additional templates that should be rendered to pages, maps page names to
135136
# template names.
136-
#html_additional_pages = {}
137+
# html_additional_pages = {}
137138

138139
# If false, no module index is generated.
139-
#html_use_modindex = True
140+
# html_use_modindex = True
140141

141142
# If false, no index is generated.
142-
#html_use_index = True
143+
# html_use_index = True
143144

144145
# If true, the index is split into individual pages for each letter.
145-
#html_split_index = False
146+
# html_split_index = False
146147

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

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

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

158159
# Output file base name for HTML help builder.
159-
htmlhelp_basename = 'gitpythondoc'
160+
htmlhelp_basename = "gitpythondoc"
160161

161162

162163
# Options for LaTeX output
163164
# ------------------------
164165

165166
# The paper size ('letter' or 'a4').
166-
#latex_paper_size = 'letter'
167+
# latex_paper_size = 'letter'
167168

168169
# The font size ('10pt', '11pt' or '12pt').
169-
#latex_font_size = '10pt'
170+
# latex_font_size = '10pt'
170171

171172
# Grouping the document tree into LaTeX files. List of tuples
172173
# (source start file, target name, title, author, document class [howto/manual]).
173174
latex_documents = [
174-
('index', 'GitPython.tex', r'GitPython Documentation',
175-
r'Michael Trier', 'manual'),
175+
("index", "GitPython.tex", r"GitPython Documentation", r"Michael Trier", "manual"),
176176
]
177177

178178
# The name of an image file (relative to this directory) to place at the top of
179179
# the title page.
180-
#latex_logo = None
180+
# latex_logo = None
181181

182182
# For "manual" documents, if this is true, then toplevel headings are parts,
183183
# not chapters.
184-
#latex_use_parts = False
184+
# latex_use_parts = False
185185

186186
# Additional stuff for the LaTeX preamble.
187-
#latex_preamble = ''
187+
# latex_preamble = ''
188188

189189
# Documents to append as an appendix to all manuals.
190-
#latex_appendices = []
190+
# latex_appendices = []
191191

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

git/__init__.py

+30-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,61 @@
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__ = [
65+
name
66+
for name, obj in locals().items()
67+
if not (name.startswith("_") or inspect.ismodule(obj))
68+
]
6569

6670

67-
#{ Initialize git executable path
71+
# { Initialize git executable path
6872
GIT_OK = None
6973

7074

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

8185
GIT_OK = True
82-
#} END initialize git executable path
86+
87+
88+
# } END initialize git executable path
8389

8490

8591
#################
8692
try:
8793
refresh()
8894
except Exception as exc:
89-
raise ImportError('Failed to initialize: {0}'.format(exc)) from exc
95+
raise ImportError("Failed to initialize: {0}".format(exc)) from exc
9096
#################

0 commit comments

Comments
 (0)