Skip to content

Commit 408bad4

Browse files
committed
Cleanup: black and isort
1 parent f9c0c7e commit 408bad4

File tree

5 files changed

+66
-63
lines changed

5 files changed

+66
-63
lines changed

docs/conf.py

Lines changed: 63 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@
88
# All configuration values have a default; values that are commented out
99
# serve to show the default.
1010

11-
import os
12-
import sys
1311
import inspect
12+
import os
1413
import shutil
14+
import sys
1515

16-
__location__ = os.path.join(os.getcwd(), os.path.dirname(
17-
inspect.getfile(inspect.currentframe())))
16+
__location__ = os.path.join(
17+
os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe()))
18+
)
1819

1920
# If extensions (or modules to document with autodoc) are in another directory,
2021
# add these directories to sys.path here. If the directory is relative to the
2122
# documentation root, use os.path.abspath to make it absolute, like shown here.
22-
sys.path.insert(0, os.path.join(__location__, '../src'))
23+
sys.path.insert(0, os.path.join(__location__, "../src"))
2324

2425
# -- Run sphinx-apidoc ------------------------------------------------------
2526
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
@@ -49,7 +50,7 @@
4950
cmd_line = cmd_line_template.format(outputdir=output_dir, moduledir=module_dir)
5051

5152
args = cmd_line.split(" ")
52-
if parse_version(sphinx.__version__) >= parse_version('1.7'):
53+
if parse_version(sphinx.__version__) >= parse_version("1.7"):
5354
args = args[1:]
5455

5556
apidoc.main(args)
@@ -63,37 +64,46 @@
6364

6465
# Add any Sphinx extension module names here, as strings. They can be extensions
6566
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
66-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
67-
'sphinx.ext.autosummary', 'sphinx.ext.viewcode', 'sphinx.ext.coverage',
68-
'sphinx.ext.doctest', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
69-
'sphinx.ext.napoleon', 'sphinxcontrib.plantuml']
67+
extensions = [
68+
"sphinx.ext.autodoc",
69+
"sphinx.ext.intersphinx",
70+
"sphinx.ext.todo",
71+
"sphinx.ext.autosummary",
72+
"sphinx.ext.viewcode",
73+
"sphinx.ext.coverage",
74+
"sphinx.ext.doctest",
75+
"sphinx.ext.ifconfig",
76+
"sphinx.ext.mathjax",
77+
"sphinx.ext.napoleon",
78+
"sphinxcontrib.plantuml",
79+
]
7080

7181
# plantuml = 'java -jar docs/plantuml.jar'
7282

7383
# Add any paths that contain templates here, relative to this directory.
74-
templates_path = ['_templates']
84+
templates_path = ["_templates"]
7585

7686
# The suffix of source filenames.
77-
source_suffix = '.rst'
87+
source_suffix = ".rst"
7888

7989
# The encoding of source files.
8090
# source_encoding = 'utf-8-sig'
8191

8292
# The master toctree document.
83-
master_doc = 'index'
93+
master_doc = "index"
8494

8595
# General information about the project.
86-
project = u'aleph-sdk-python'
87-
copyright = u'2019, Aleph.im'
96+
project = "aleph-sdk-python"
97+
copyright = "2019, Aleph.im"
8898

8999
# The version info for the project you're documenting, acts as replacement for
90100
# |version| and |release|, also used in various other places throughout the
91101
# built documents.
92102
#
93103
# The short X.Y version.
94-
version = '' # Is set by calling `setup.py docs`
104+
version = "" # Is set by calling `setup.py docs`
95105
# The full version, including alpha/beta/rc tags.
96-
release = '' # Is set by calling `setup.py docs`
106+
release = "" # Is set by calling `setup.py docs`
97107

98108
# The language for content autogenerated by Sphinx. Refer to documentation
99109
# for a list of supported languages.
@@ -107,7 +117,7 @@
107117

108118
# List of patterns, relative to source directory, that match files and
109119
# directories to ignore when looking for source files.
110-
exclude_patterns = ['_build']
120+
exclude_patterns = ["_build"]
111121

112122
# The reST default role (used for this markup: `text`) to use for all documents.
113123
# default_role = None
@@ -124,7 +134,7 @@
124134
# show_authors = False
125135

126136
# The name of the Pygments (syntax highlighting) style to use.
127-
pygments_style = 'sphinx'
137+
pygments_style = "sphinx"
128138

129139
# A list of ignored prefixes for module index sorting.
130140
# modindex_common_prefix = []
@@ -137,30 +147,30 @@
137147

138148
# The theme to use for HTML and HTML Help pages. See the documentation for
139149
# a list of builtin themes.
140-
html_theme = 'alabaster'
150+
html_theme = "alabaster"
141151

142152
# Theme options are theme-specific and customize the look and feel of a theme
143153
# further. For a list of options available for each theme, see the
144154
# documentation.
145155
html_theme_options = {
146156
#'sidebar_width': '300px',
147157
#'page_width': '1200px'
148-
'logo': 'logo.svg',
149-
'description': 'Aleph Network Client',
150-
'github_user': 'aleph-im',
151-
'github_repo': 'aleph-sdk-python',
152-
'github_button': True,
153-
'github_type': 'star',
154-
'github_banner': True,
155-
'travis_button': True,
156-
'codecov_button': True,
157-
'pre_bg': '#FFF6E5',
158-
'note_bg': '#E5ECD1',
159-
'note_border': '#BFCF8C',
160-
'body_text': '#482C0A',
161-
'sidebar_text': '#49443E',
162-
'sidebar_header': '#4B4032',
163-
'sidebar_collapse': False,
158+
"logo": "logo.svg",
159+
"description": "Aleph Network Client",
160+
"github_user": "aleph-im",
161+
"github_repo": "aleph-sdk-python",
162+
"github_button": True,
163+
"github_type": "star",
164+
"github_banner": True,
165+
"travis_button": True,
166+
"codecov_button": True,
167+
"pre_bg": "#FFF6E5",
168+
"note_bg": "#E5ECD1",
169+
"note_border": "#BFCF8C",
170+
"body_text": "#482C0A",
171+
"sidebar_text": "#49443E",
172+
"sidebar_header": "#4B4032",
173+
"sidebar_collapse": False,
164174
}
165175

166176
# Add any paths that contain custom themes here, relative to this directory.
@@ -190,7 +200,7 @@
190200
# Add any paths that contain custom static files (such as style sheets) here,
191201
# relative to this directory. They are copied after the builtin static files,
192202
# so a file named "default.css" will overwrite the builtin "default.css".
193-
html_static_path = ['_static']
203+
html_static_path = ["_static"]
194204

195205
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
196206
# using the given strftime format.
@@ -234,27 +244,24 @@
234244
# html_file_suffix = None
235245

236246
# Output file base name for HTML help builder.
237-
htmlhelp_basename = 'aleph_client-doc'
247+
htmlhelp_basename = "aleph_client-doc"
238248

239249

240250
# -- Options for LaTeX output --------------------------------------------------
241251

242252
latex_elements = {
243-
# The paper size ('letterpaper' or 'a4paper').
244-
# 'papersize': 'letterpaper',
245-
246-
# The font size ('10pt', '11pt' or '12pt').
247-
# 'pointsize': '10pt',
248-
249-
# Additional stuff for the LaTeX preamble.
250-
# 'preamble': '',
253+
# The paper size ('letterpaper' or 'a4paper').
254+
# 'papersize': 'letterpaper',
255+
# The font size ('10pt', '11pt' or '12pt').
256+
# 'pointsize': '10pt',
257+
# Additional stuff for the LaTeX preamble.
258+
# 'preamble': '',
251259
}
252260

253261
# Grouping the document tree into LaTeX files. List of tuples
254262
# (source start file, target name, title, author, documentclass [howto/manual]).
255263
latex_documents = [
256-
('index', 'user_guide.tex', u'aleph-sdk-python Documentation',
257-
u'Aleph.im', 'manual'),
264+
("index", "user_guide.tex", "aleph-sdk-python Documentation", "Aleph.im", "manual"),
258265
]
259266

260267
# The name of an image file (relative to this directory) to place at the top of
@@ -278,13 +285,13 @@
278285
# latex_domain_indices = True
279286

280287
# -- External mapping ------------------------------------------------------------
281-
python_version = '.'.join(map(str, sys.version_info[0:2]))
288+
python_version = ".".join(map(str, sys.version_info[0:2]))
282289
intersphinx_mapping = {
283-
'sphinx': ('http://www.sphinx-doc.org/en/stable', None),
284-
'python': ('https://docs.python.org/' + python_version, None),
285-
'matplotlib': ('https://matplotlib.org', None),
286-
'numpy': ('https://docs.scipy.org/doc/numpy', None),
287-
'sklearn': ('http://scikit-learn.org/stable', None),
288-
'pandas': ('http://pandas.pydata.org/pandas-docs/stable', None),
289-
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
290+
"sphinx": ("http://www.sphinx-doc.org/en/stable", None),
291+
"python": ("https://docs.python.org/" + python_version, None),
292+
"matplotlib": ("https://matplotlib.org", None),
293+
"numpy": ("https://docs.scipy.org/doc/numpy", None),
294+
"sklearn": ("http://scikit-learn.org/stable", None),
295+
"pandas": ("http://pandas.pydata.org/pandas-docs/stable", None),
296+
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
290297
}

examples/mqtt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ async def gateway(
7676
transport="tcp",
7777
auth=None,
7878
):
79-
8079
if pkey is None:
8180
pkey = get_fallback_private_key()
8281

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from setuptools import setup
1414

1515
try:
16-
require('setuptools>=38.3')
16+
require("setuptools>=38.3")
1717
except VersionConflict:
1818
print("Error: version of setuptools is too old (<38.3)!")
1919
sys.exit(1)

src/aleph/sdk/user_session.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,6 @@ async def _handle_broadcast_deprecated_response(
930930
self._log_publication_status(publication_status)
931931

932932
async def _broadcast_deprecated(self, message_dict: Mapping[str, Any]) -> None:
933-
934933
"""
935934
Broadcast a message on the Aleph network using the deprecated
936935
/ipfs/pubsub/pub/ endpoint.
@@ -1312,7 +1311,6 @@ async def _prepare_aleph_message(
13121311
allow_inlining: bool = True,
13131312
storage_engine: StorageEnum = StorageEnum.storage,
13141313
) -> AlephMessage:
1315-
13161314
message_dict: Dict[str, Any] = {
13171315
"sender": self.account.get_address(),
13181316
"chain": self.account.CHAIN,
@@ -1353,7 +1351,6 @@ async def submit(
13531351
allow_inlining: bool = True,
13541352
sync: bool = False,
13551353
) -> Tuple[AlephMessage, MessageStatus]:
1356-
13571354
message = await self._prepare_aleph_message(
13581355
message_type=message_type,
13591356
content=content,

tests/unit/test_vm_cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
async def test_local_vm_cache():
88
cache = TestVmCache()
99
assert (await cache.get("doesnotexist")) is None
10-
assert len(await (cache.keys())) == 0
10+
assert len(await cache.keys()) == 0
1111
key = "thisdoesexist"
1212
value = "yay, I exist!"
1313
await cache.set(key, value)
@@ -18,7 +18,7 @@ async def test_local_vm_cache():
1818
assert (await cache.keys("*exist"))[0] == key
1919
await cache.delete(key)
2020
assert (await cache.get(key)) is None
21-
assert len(await (cache.keys())) == 0
21+
assert len(await cache.keys()) == 0
2222

2323

2424
def test_sanitize_cache_keys():

0 commit comments

Comments
 (0)