Skip to content

Commit 7ad4e2d

Browse files
committed
chore: black-format
1 parent 754ea19 commit 7ad4e2d

20 files changed

+2572
-2389
lines changed

docs/source/conf.py

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
import os
1616
import sys
1717

18-
sys.path.insert(0, os.path.abspath('..'))
18+
sys.path.insert(0, os.path.abspath(".."))
1919

2020

2121
# -- Project information -----------------------------------------------------
2222

23-
project = u'Sync2Jira'
24-
copyright = u'2019, Ralph Bean'
25-
author = u'Ralph Bean'
23+
project = "Sync2Jira"
24+
copyright = "2019, Ralph Bean"
25+
author = "Ralph Bean"
2626

2727
# The short X.Y version
28-
version = u'2.0'
28+
version = "2.0"
2929
# The full version, including alpha/beta/rc tags
30-
release = u'2.0'
30+
release = "2.0"
3131

3232

3333
# -- General configuration ---------------------------------------------------
@@ -40,28 +40,28 @@
4040
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4141
# ones.
4242
extensions = [
43-
'sphinx.ext.autodoc',
44-
'sphinx.ext.doctest',
45-
'sphinx.ext.intersphinx',
46-
'sphinx.ext.todo',
47-
'sphinx.ext.coverage',
48-
'sphinx.ext.mathjax',
49-
'sphinx.ext.ifconfig',
50-
'sphinx.ext.viewcode',
51-
'sphinx.ext.githubpages',
43+
"sphinx.ext.autodoc",
44+
"sphinx.ext.doctest",
45+
"sphinx.ext.intersphinx",
46+
"sphinx.ext.todo",
47+
"sphinx.ext.coverage",
48+
"sphinx.ext.mathjax",
49+
"sphinx.ext.ifconfig",
50+
"sphinx.ext.viewcode",
51+
"sphinx.ext.githubpages",
5252
]
5353

5454
# Add any paths that contain templates here, relative to this directory.
55-
templates_path = ['ntemplates']
55+
templates_path = ["ntemplates"]
5656

5757
# The suffix(es) of source filenames.
5858
# You can specify multiple suffix as a list of string:
5959
#
6060
# source_suffix = ['.rst', '.md']
61-
source_suffix = '.rst'
61+
source_suffix = ".rst"
6262

6363
# The master toctree document.
64-
master_doc = 'index'
64+
master_doc = "index"
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.
@@ -84,7 +84,7 @@
8484
# The theme to use for HTML and HTML Help pages. See the documentation for
8585
# a list of builtin themes.
8686
#
87-
html_theme = 'sphinx_rtd_theme'
87+
html_theme = "sphinx_rtd_theme"
8888

8989
# Theme options are theme-specific and customize the look and feel of a theme
9090
# further. For a list of options available for each theme, see the
@@ -95,7 +95,7 @@
9595
# Add any paths that contain custom static files (such as style sheets) here,
9696
# relative to this directory. They are copied after the builtin static files,
9797
# so a file named "default.css" will overwrite the builtin "default.css".
98-
html_static_path = ['nstatic']
98+
html_static_path = ["nstatic"]
9999

100100
# Custom sidebar templates, must be a dictionary that maps document names
101101
# to template names.
@@ -105,13 +105,13 @@
105105
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
106106
# 'searchbox.html']``.
107107
#
108-
html_sidebars = { '**': ['globaltoc.html', 'searchbox.html'] }
108+
html_sidebars = {"**": ["globaltoc.html", "searchbox.html"]}
109109

110110

111111
# -- Options for HTMLHelp output ---------------------------------------------
112112

113113
# Output file base name for HTML help builder.
114-
htmlhelp_basename = 'Sync2Jiradoc'
114+
htmlhelp_basename = "Sync2Jiradoc"
115115

116116

117117
# -- Options for LaTeX output ------------------------------------------------
@@ -120,15 +120,12 @@
120120
# The paper size ('letterpaper' or 'a4paper').
121121
#
122122
# 'papersize': 'letterpaper',
123-
124123
# The font size ('10pt', '11pt' or '12pt').
125124
#
126125
# 'pointsize': '10pt',
127-
128126
# Additional stuff for the LaTeX preamble.
129127
#
130128
# 'preamble': '',
131-
132129
# Latex figure (float) alignment
133130
#
134131
# 'figure_align': 'htbp',
@@ -138,19 +135,15 @@
138135
# (source start file, target name, title,
139136
# author, documentclass [howto, manual, or own class]).
140137
latex_documents = [
141-
(master_doc, 'Sync2Jira.tex', u'Sync2Jira Documentation',
142-
u'Ralph Bean', 'manual'),
138+
(master_doc, "Sync2Jira.tex", "Sync2Jira Documentation", "Ralph Bean", "manual"),
143139
]
144140

145141

146142
# -- Options for manual page output ------------------------------------------
147143

148144
# One entry per manual page. List of tuples
149145
# (source start file, name, description, authors, manual section).
150-
man_pages = [
151-
(master_doc, 'sync2jira', u'Sync2Jira Documentation',
152-
[author], 1)
153-
]
146+
man_pages = [(master_doc, "sync2jira", "Sync2Jira Documentation", [author], 1)]
154147

155148

156149
# -- Options for Texinfo output ----------------------------------------------
@@ -159,9 +152,15 @@
159152
# (source start file, target name, title, author,
160153
# dir menu entry, description, category)
161154
texinfo_documents = [
162-
(master_doc, 'Sync2Jira', u'Sync2Jira Documentation',
163-
author, 'Sync2Jira', 'One line description of project.',
164-
'Miscellaneous'),
155+
(
156+
master_doc,
157+
"Sync2Jira",
158+
"Sync2Jira Documentation",
159+
author,
160+
"Sync2Jira",
161+
"One line description of project.",
162+
"Miscellaneous",
163+
),
165164
]
166165

167166

@@ -180,7 +179,7 @@
180179
# epub_uid = ''
181180

182181
# A list of files that should not be packed into the epub file.
183-
epub_exclude_files = ['search.html']
182+
epub_exclude_files = ["search.html"]
184183

185184

186185
# -- Extension configuration -------------------------------------------------

setup.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@
2020

2121
from setuptools import setup
2222

23-
with open('requirements.txt', 'rb') as f:
24-
install_requires = f.read().decode('utf-8').split('\n')
25-
if not os.getenv('READTHEDOCS'):
26-
install_requires.append('requests-kerberos')
23+
with open("requirements.txt", "rb") as f:
24+
install_requires = f.read().decode("utf-8").split("\n")
25+
if not os.getenv("READTHEDOCS"):
26+
install_requires.append("requests-kerberos")
2727

28-
with open('test-requirements.txt', 'rb') as f:
29-
test_requires = f.read().decode('utf-8').split('\n')
28+
with open("test-requirements.txt", "rb") as f:
29+
test_requires = f.read().decode("utf-8").split("\n")
3030

3131
setup(
32-
name='sync2jira',
32+
name="sync2jira",
3333
version=2.0,
3434
description="Sync GitHub issues to jira, via fedmsg",
35-
author='Ralph Bean',
36-
author_email='rbean@redhat.com',
37-
url='https://github.com/release-engineering/Sync2Jira',
38-
license='LGPLv2+',
35+
author="Ralph Bean",
36+
author_email="rbean@redhat.com",
37+
url="https://github.com/release-engineering/Sync2Jira",
38+
license="LGPLv2+",
3939
classifiers=[
4040
"Development Status :: 5 - Production/Stable",
4141
"License :: OSI Approved :: GNU Lesser General "
@@ -47,12 +47,12 @@
4747
install_requires=install_requires,
4848
tests_require=test_requires,
4949
packages=[
50-
'sync2jira',
50+
"sync2jira",
5151
],
5252
include_package_data=True,
5353
zip_safe=False,
5454
entry_points={
55-
'console_scripts': [
55+
"console_scripts": [
5656
"sync2jira=sync2jira.main:main",
5757
"sync2jira-list-managed-urls=sync2jira.main:list_managed",
5858
"sync2jira-close-duplicates=sync2jira.main:close_duplicates",

sync-page/event-handler.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010

1111
# Global Variables
1212
app = Flask(__name__, static_url_path="/assets", static_folder="assets")
13-
BASE_URL = os.environ['BASE_URL']
14-
REDIRECT_URL = os.environ['REDIRECT_URL']
13+
BASE_URL = os.environ["BASE_URL"]
14+
REDIRECT_URL = os.environ["REDIRECT_URL"]
1515
config = load_config()
1616

1717
# Set up our logging
1818
FORMAT = "[%(asctime)s] %(levelname)s: %(message)s"
1919
logging.basicConfig(format=FORMAT, level=logging.INFO)
2020
logging.basicConfig(format=FORMAT, level=logging.DEBUG)
2121
logging.basicConfig(format=FORMAT, level=logging.WARNING)
22-
log = logging.getLogger('sync2jira-sync-page')
22+
log = logging.getLogger("sync2jira-sync-page")
2323

2424

25-
@app.route('/handle-event', methods=['POST'])
25+
@app.route("/handle-event", methods=["POST"])
2626
def handle_event():
2727
"""
2828
Handler for when a user wants to sync a repo
@@ -37,32 +37,35 @@ def handle_event():
3737
initialize_pr(config, repo_name=repo_name)
3838
synced_repos.append(repo_name)
3939
if synced_repos:
40-
return render_template('sync-page-success.jinja',
41-
synced_repos=synced_repos,
42-
url=f"https://{REDIRECT_URL}")
40+
return render_template(
41+
"sync-page-success.jinja",
42+
synced_repos=synced_repos,
43+
url=f"https://{REDIRECT_URL}",
44+
)
4345
else:
44-
return render_template('sync-page-failure.jinja',
45-
url=f"https://{REDIRECT_URL}")
46+
return render_template("sync-page-failure.jinja", url=f"https://{REDIRECT_URL}")
4647

4748

48-
@app.route('/', methods=['GET'])
49+
@app.route("/", methods=["GET"])
4950
def index():
5051
"""
5152
Return relevant redirect
5253
"""
5354
return redirect("/github")
5455

5556

56-
@app.route('/github', methods=['GET'])
57+
@app.route("/github", methods=["GET"])
5758
def github():
5859
"""
5960
Github Sync Page
6061
"""
6162
# Build and return our updated HTML page
62-
return render_template('sync-page-github.jinja',
63-
github=config['sync2jira']['map']['github'],
64-
url=f"https://{REDIRECT_URL}")
63+
return render_template(
64+
"sync-page-github.jinja",
65+
github=config["sync2jira"]["map"]["github"],
66+
url=f"https://{REDIRECT_URL}",
67+
)
6568

6669

67-
if __name__ == '__main__':
70+
if __name__ == "__main__":
6871
app.run(host=BASE_URL)

sync2jira/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110.15.0 USA
1717
#
1818
# Authors: Ralph Bean <rbean@redhat.com>
19-
__version__ = '1.7'
19+
__version__ = "1.7"

0 commit comments

Comments
 (0)