|
6 | 6 | import django
|
7 | 7 |
|
8 | 8 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.testapp.settings")
|
9 |
| -sys.path.insert(0, os.path.abspath('..')) |
| 9 | +sys.path.insert(0, os.path.abspath("..")) |
10 | 10 | django.setup()
|
11 | 11 |
|
12 | 12 | extensions = [
|
13 |
| - 'sphinx.ext.autodoc', |
14 |
| - 'sphinx.ext.napoleon', |
15 |
| - 'sphinx.ext.inheritance_diagram', |
16 |
| - 'sphinx.ext.intersphinx', |
17 |
| - 'sphinx.ext.githubpages', |
18 |
| - 'sphinx.ext.linkcode', |
| 13 | + "sphinx.ext.autodoc", |
| 14 | + "sphinx.ext.napoleon", |
| 15 | + "sphinx.ext.inheritance_diagram", |
| 16 | + "sphinx.ext.intersphinx", |
| 17 | + "sphinx.ext.githubpages", |
| 18 | + "sphinx.ext.linkcode", |
19 | 19 | ]
|
20 | 20 |
|
21 | 21 | try:
|
22 | 22 | import sphinxcontrib.spelling # noqa
|
23 | 23 | except ImportError:
|
24 | 24 | pass
|
25 | 25 | else:
|
26 |
| - extensions.append('sphinxcontrib.spelling') |
| 26 | + extensions.append("sphinxcontrib.spelling") |
27 | 27 |
|
28 | 28 |
|
29 | 29 | def linkcode_resolve(domain, info):
|
30 | 30 | """Link source code to GitHub."""
|
31 |
| - project = 'joeflow' |
32 |
| - github_user = 'codingjoe' |
33 |
| - head = 'master' |
| 31 | + project = "joeflow" |
| 32 | + github_user = "codingjoe" |
| 33 | + head = "master" |
34 | 34 |
|
35 |
| - if domain != 'py' or not info['module']: |
| 35 | + if domain != "py" or not info["module"]: |
36 | 36 | return None
|
37 |
| - filename = info['module'].replace('.', '/') |
38 |
| - mod = importlib.import_module(info['module']) |
| 37 | + filename = info["module"].replace(".", "/") |
| 38 | + mod = importlib.import_module(info["module"]) |
39 | 39 | basename = os.path.splitext(mod.__file__)[0]
|
40 |
| - if basename.endswith('__init__'): |
41 |
| - filename += '/__init__' |
| 40 | + if basename.endswith("__init__"): |
| 41 | + filename += "/__init__" |
42 | 42 | item = mod
|
43 |
| - lineno = '' |
| 43 | + lineno = "" |
44 | 44 |
|
45 |
| - for piece in info['fullname'].split('.'): |
| 45 | + for piece in info["fullname"].split("."): |
46 | 46 | try:
|
47 | 47 | item = getattr(item, piece)
|
48 | 48 | except AttributeError:
|
49 | 49 | pass
|
50 | 50 | try:
|
51 | 51 | lines, first_line = inspect.getsourcelines(item)
|
52 |
| - lineno = '#L%d-L%s' % (first_line, first_line + len(lines) - 1) |
| 52 | + lineno = "#L%d-L%s" % (first_line, first_line + len(lines) - 1) |
53 | 53 | except (TypeError, IOError):
|
54 | 54 | pass
|
55 |
| - return ("https://github.com/%s/%s/blob/%s/%s.py%s" % |
56 |
| - (github_user, project, head, filename, lineno)) |
| 55 | + return "https://github.com/%s/%s/blob/%s/%s.py%s" % ( |
| 56 | + github_user, |
| 57 | + project, |
| 58 | + head, |
| 59 | + filename, |
| 60 | + lineno, |
| 61 | + ) |
57 | 62 |
|
58 | 63 |
|
59 | 64 | # The master toctree document.
|
60 |
| -master_doc = 'index' |
61 |
| -project = 'Joeflow' |
| 65 | +master_doc = "index" |
| 66 | +project = "Joeflow" |
62 | 67 |
|
63 |
| -html_theme = 'alabaster' |
| 68 | +html_theme = "alabaster" |
64 | 69 |
|
65 | 70 | intersphinx_mapping = {
|
66 |
| - 'python': ('https://docs.python.org/3', None), |
67 |
| - 'django': ('https://docs.djangoproject.com/en/stable/', |
68 |
| - 'https://docs.djangoproject.com/en/stable/_objects/'), |
69 |
| - 'celery': ('https://celery.readthedocs.io/en/stable/', None), |
70 |
| - 'graphviz': ('https://graphviz.readthedocs.io/en/stable/', None), |
| 71 | + "python": ("https://docs.python.org/3", None), |
| 72 | + "django": ( |
| 73 | + "https://docs.djangoproject.com/en/stable/", |
| 74 | + "https://docs.djangoproject.com/en/stable/_objects/", |
| 75 | + ), |
| 76 | + "celery": ("https://celery.readthedocs.io/en/stable/", None), |
| 77 | + "graphviz": ("https://graphviz.readthedocs.io/en/stable/", None), |
71 | 78 | }
|
72 | 79 |
|
73 |
| -spelling_word_list_filename = 'spelling_wordlist.txt' |
| 80 | +spelling_word_list_filename = "spelling_wordlist.txt" |
74 | 81 | spelling_show_suggestions = True
|
75 | 82 |
|
76 |
| -graphviz_output_format = 'svg' |
| 83 | +graphviz_output_format = "svg" |
77 | 84 |
|
78 |
| -inheritance_graph_attrs = dict(rankdir="TB", size='"6.0, 8.0"', |
79 |
| - fontsize=14, ratio='compress') |
| 85 | +inheritance_graph_attrs = dict( |
| 86 | + rankdir="TB", size='"6.0, 8.0"', fontsize=14, ratio="compress" |
| 87 | +) |
0 commit comments