Skip to content

Commit 782afc9

Browse files
committed
chore: run black and isort
1 parent 03c1cf7 commit 782afc9

File tree

79 files changed

+3026
-2351
lines changed

Some content is hidden

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

79 files changed

+3026
-2351
lines changed

celeryconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from celery import Celery
22
from django.conf import settings
33

4-
app = Celery('event_routing_backends')
4+
app = Celery("event_routing_backends")
55

66
app.config_from_object(settings)
77

docs/conf.py

Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ def get_version(*file_paths):
3232
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
3333
if version_match:
3434
return version_match.group(1)
35-
raise RuntimeError('Unable to find version string.')
35+
raise RuntimeError("Unable to find version string.")
3636

3737

3838
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
3939
sys.path.append(REPO_ROOT)
4040

41-
VERSION = get_version('../event_routing_backends', '__init__.py')
41+
VERSION = get_version("../event_routing_backends", "__init__.py")
4242

4343
# Configure Django for autodoc usage
4444
settings.configure()
@@ -62,40 +62,40 @@ def get_version(*file_paths):
6262
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
6363
# ones.
6464
extensions = [
65-
'sphinx.ext.autodoc',
66-
'sphinx.ext.doctest',
67-
'sphinx.ext.intersphinx',
68-
'sphinx.ext.ifconfig',
69-
'sphinx.ext.napoleon',
70-
'sphinx.ext.autosectionlabel'
65+
"sphinx.ext.autodoc",
66+
"sphinx.ext.doctest",
67+
"sphinx.ext.intersphinx",
68+
"sphinx.ext.ifconfig",
69+
"sphinx.ext.napoleon",
70+
"sphinx.ext.autosectionlabel",
7171
]
7272

7373
# A list of warning types to suppress arbitrary warning messages.
7474
suppress_warnings = [
75-
'image.nonlocal_uri',
75+
"image.nonlocal_uri",
7676
]
7777

7878
# Add any paths that contain templates here, relative to this directory.
79-
templates_path = ['_templates']
79+
templates_path = ["_templates"]
8080

8181
# The suffix(es) of source filenames.
8282
# You can specify multiple suffix as a list of string:
8383
#
8484
# source_suffix = ['.rst', '.md']
85-
source_suffix = '.rst'
85+
source_suffix = ".rst"
8686

8787
# The encoding of source files.
8888
#
8989
# source_encoding = 'utf-8-sig'
9090

9191
# The top level toctree document.
92-
top_level_doc = 'index'
92+
top_level_doc = "index"
9393

9494
# General information about the project.
95-
project = 'event-routing-backends'
96-
copyright = f'{datetime.now().year}, Axim Collaborative, Inc' # pylint: disable=redefined-builtin
97-
author = 'Axim Collaborative, Inc'
98-
project_title = 'event-routing-backends'
95+
project = "event-routing-backends"
96+
copyright = f"{datetime.now().year}, Axim Collaborative, Inc" # pylint: disable=redefined-builtin
97+
author = "Axim Collaborative, Inc"
98+
project_title = "event-routing-backends"
9999
documentation_title = f"{project_title}"
100100

101101
# The version info for the project you're documenting, acts as replacement for
@@ -126,7 +126,7 @@ def get_version(*file_paths):
126126
# List of patterns, relative to source directory, that match files and
127127
# directories to ignore when looking for source files.
128128
# This patterns also effect to html_static_path and html_extra_path
129-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'changelog.rst']
129+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "changelog.rst"]
130130

131131
# The reST default role (used for this markup: `text`) to use for all
132132
# documents.
@@ -148,7 +148,7 @@ def get_version(*file_paths):
148148
# show_authors = False
149149

150150
# The name of the Pygments (syntax highlighting) style to use.
151-
pygments_style = 'sphinx'
151+
pygments_style = "sphinx"
152152

153153
# A list of ignored prefixes for module index sorting.
154154
# modindex_common_prefix = []
@@ -165,22 +165,22 @@ def get_version(*file_paths):
165165
# The theme to use for HTML and HTML Help pages. See the documentation for
166166
# a list of builtin themes.
167167

168-
html_theme = 'sphinx_book_theme'
168+
html_theme = "sphinx_book_theme"
169169

170170
# Theme options are theme-specific and customize the look and feel of a theme
171171
# further. For a list of options available for each theme, see the
172172
# documentation.
173173
#
174174
html_theme_options = {
175-
"repository_url": "https://github.com/openedx/event-routing-backends",
176-
"repository_branch": "master",
177-
"path_to_docs": "docs/",
178-
"home_page_in_toc": True,
179-
"use_repository_button": True,
180-
"use_issues_button": True,
181-
"use_edit_page_button": True,
182-
# Please don't change unless you know what you're doing.
183-
"extra_footer": """
175+
"repository_url": "https://github.com/openedx/event-routing-backends",
176+
"repository_branch": "master",
177+
"path_to_docs": "docs/",
178+
"home_page_in_toc": True,
179+
"use_repository_button": True,
180+
"use_issues_button": True,
181+
"use_edit_page_button": True,
182+
# Please don't change unless you know what you're doing.
183+
"extra_footer": """
184184
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
185185
<img
186186
alt="Creative Commons License"
@@ -200,7 +200,7 @@ def get_version(*file_paths):
200200
rel="license"
201201
href="https://creativecommons.org/licenses/by-sa/4.0/"
202202
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
203-
"""
203+
""",
204204
}
205205

206206
# Add any paths that contain custom themes here, relative to this directory.
@@ -229,10 +229,10 @@ def get_version(*file_paths):
229229
# Add any paths that contain custom static files (such as style sheets) here,
230230
# relative to this directory. They are copied after the builtin static files,
231231
# so a file named "default.css" will overwrite the builtin "default.css".
232-
html_static_path = ['_static']
232+
html_static_path = ["_static"]
233233

234234
html_css_files = [
235-
'theme_overrides.css',
235+
"theme_overrides.css",
236236
]
237237

238238
# Add any extra paths that contain custom files (such as robots.txt or
@@ -313,23 +313,20 @@ def get_version(*file_paths):
313313
# html_search_scorer = 'scorer.js'
314314

315315
# Output file base name for HTML help builder.
316-
htmlhelp_basename = f'{project}doc'
316+
htmlhelp_basename = f"{project}doc"
317317

318318
# -- Options for LaTeX output ---------------------------------------------
319319

320320
latex_elements = {
321321
# The paper size ('letterpaper' or 'a4paper').
322322
#
323323
# 'papersize': 'letterpaper',
324-
325324
# The font size ('10pt', '11pt' or '12pt').
326325
#
327326
# 'pointsize': '10pt',
328-
329327
# Additional stuff for the LaTeX preamble.
330328
#
331329
# 'preamble': '',
332-
333330
# Latex figure (float) alignment
334331
#
335332
# 'figure_align': 'htbp',
@@ -338,10 +335,9 @@ def get_version(*file_paths):
338335
# Grouping the document tree into LaTeX files. List of tuples
339336
# (source start file, target name, title,
340337
# author, documentclass [howto, manual, or own class]).
341-
latex_target = f'{project}.tex'
338+
latex_target = f"{project}.tex"
342339
latex_documents = [
343-
(top_level_doc, latex_target, documentation_title,
344-
author, 'manual'),
340+
(top_level_doc, latex_target, documentation_title, author, "manual"),
345341
]
346342

347343
# The name of an image file (relative to this directory) to place at the top of
@@ -381,10 +377,7 @@ def get_version(*file_paths):
381377

382378
# One entry per manual page. List of tuples
383379
# (source start file, name, description, authors, manual section).
384-
man_pages = [
385-
(top_level_doc, project_title, documentation_title,
386-
[author], 1)
387-
]
380+
man_pages = [(top_level_doc, project_title, documentation_title, [author], 1)]
388381

389382
# If true, show URL addresses after external links.
390383
#
@@ -397,9 +390,15 @@ def get_version(*file_paths):
397390
# (source start file, target name, title, author,
398391
# dir menu entry, description, category)
399392
texinfo_documents = [
400-
(top_level_doc, project_title, documentation_title,
401-
author, project_title, 'Various backends for receiving edX LMS events.',
402-
'Miscellaneous'),
393+
(
394+
top_level_doc,
395+
project_title,
396+
documentation_title,
397+
author,
398+
project_title,
399+
"Various backends for receiving edX LMS events.",
400+
"Miscellaneous",
401+
),
403402
]
404403

405404
# Documents to append as an appendix to all manuals.
@@ -473,7 +472,7 @@ def get_version(*file_paths):
473472
# epub_post_files = []
474473

475474
# A list of files that should not be packed into the epub file.
476-
epub_exclude_files = ['search.html']
475+
epub_exclude_files = ["search.html"]
477476

478477
# The depth of the table of contents in toc.ncx.
479478
#
@@ -506,9 +505,12 @@ def get_version(*file_paths):
506505

507506
# Example configuration for intersphinx: refer to the Python standard library.
508507
intersphinx_mapping = {
509-
'python': ('https://docs.python.org/3.6', None),
510-
'django': ('https://docs.djangoproject.com/en/1.11/', 'https://docs.djangoproject.com/en/1.11/_objects/'),
511-
'model_utils': ('https://django-model-utils.readthedocs.io/en/latest/', None),
508+
"python": ("https://docs.python.org/3.6", None),
509+
"django": (
510+
"https://docs.djangoproject.com/en/1.11/",
511+
"https://docs.djangoproject.com/en/1.11/_objects/",
512+
),
513+
"model_utils": ("https://django-model-utils.readthedocs.io/en/latest/", None),
512514
}
513515

514516

@@ -520,17 +522,24 @@ def on_init(app): # pylint: disable=unused-argument
520522
avoid checking in the generated reStructuredText files.
521523
"""
522524
docs_path = os.path.abspath(os.path.dirname(__file__))
523-
root_path = os.path.abspath(os.path.join(docs_path, '..'))
524-
apidoc_path = 'sphinx-apidoc'
525-
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
525+
root_path = os.path.abspath(os.path.join(docs_path, ".."))
526+
apidoc_path = "sphinx-apidoc"
527+
if hasattr(sys, "real_prefix"): # Check to see if we are in a virtualenv
526528
# If we are, assemble the path manually
527-
bin_path = os.path.abspath(os.path.join(sys.prefix, 'bin'))
529+
bin_path = os.path.abspath(os.path.join(sys.prefix, "bin"))
528530
apidoc_path = os.path.join(bin_path, apidoc_path)
529-
check_call([apidoc_path, '-o', docs_path, os.path.join(root_path, 'event_routing_backends'),
530-
os.path.join(root_path, 'event_routing_backends/migrations')])
531+
check_call(
532+
[
533+
apidoc_path,
534+
"-o",
535+
docs_path,
536+
os.path.join(root_path, "event_routing_backends"),
537+
os.path.join(root_path, "event_routing_backends/migrations"),
538+
]
539+
)
531540

532541

533542
def setup(app):
534543
"""Sphinx extension: run sphinx-apidoc."""
535-
event = 'builder-inited'
544+
event = "builder-inited"
536545
app.connect(event, on_init)

event_routing_backends/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Various backends for receiving edX LMS events..
33
"""
44

5-
__version__ = '9.3.1'
5+
__version__ = "9.3.1"

event_routing_backends/admin.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Contains Admin class(es) for the django app.
33
"""
4+
45
from config_models.admin import KeyedConfigurationModelAdmin
56
from django.contrib import admin
67

@@ -13,11 +14,11 @@ class RouterConfigurationAdmin(KeyedConfigurationModelAdmin):
1314
Admin model class for RouterConfiguration model.
1415
"""
1516

16-
history_list_display = 'status'
17-
change_form_template = 'admin/router_conf_change_form.html'
17+
history_list_display = "status"
18+
change_form_template = "admin/router_conf_change_form.html"
1819

1920
def get_displayable_field_names(self):
2021
"""
2122
Get the list display.
2223
"""
23-
return ['backend_name', 'enabled', 'route_url', 'configurations']
24+
return ["backend_name", "enabled", "route_url", "configurations"]

event_routing_backends/apps.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ class EventRoutingBackendsConfig(AppConfig):
1111
Configuration for the event_routing_backends Django application.
1212
"""
1313

14-
name = 'event_routing_backends'
14+
name = "event_routing_backends"
1515
verbose_name = "Event Routing Backends"
1616

1717
plugin_app = {
1818
PluginSettings.CONFIG: {
19-
'lms.djangoapp': {
20-
'production': {PluginSettings.RELATIVE_PATH: 'settings.production'},
21-
'common': {PluginSettings.RELATIVE_PATH: 'settings.common'},
22-
'devstack': {PluginSettings.RELATIVE_PATH: 'settings.devstack'},
19+
"lms.djangoapp": {
20+
"production": {PluginSettings.RELATIVE_PATH: "settings.production"},
21+
"common": {PluginSettings.RELATIVE_PATH: "settings.common"},
22+
"devstack": {PluginSettings.RELATIVE_PATH: "settings.devstack"},
23+
},
24+
"cms.djangoapp": {
25+
"production": {PluginSettings.RELATIVE_PATH: "settings.production"},
26+
"common": {PluginSettings.RELATIVE_PATH: "settings.common"},
27+
"devstack": {PluginSettings.RELATIVE_PATH: "settings.devstack"},
2328
},
24-
'cms.djangoapp': {
25-
'production': {PluginSettings.RELATIVE_PATH: 'settings.production'},
26-
'common': {PluginSettings.RELATIVE_PATH: 'settings.common'},
27-
'devstack': {PluginSettings.RELATIVE_PATH: 'settings.devstack'},
28-
}
2929
}
3030
}
3131

@@ -35,5 +35,9 @@ def ready(self):
3535
"""
3636
super().ready()
3737
# pylint: disable=import-outside-toplevel, unused-import
38-
from event_routing_backends.processors.caliper import event_transformers as caliper_event_transformers
39-
from event_routing_backends.processors.xapi import event_transformers as xapi_event_transformers
38+
from event_routing_backends.processors.caliper import (
39+
event_transformers as caliper_event_transformers,
40+
)
41+
from event_routing_backends.processors.xapi import (
42+
event_transformers as xapi_event_transformers,
43+
)

0 commit comments

Comments
 (0)