Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 63 additions & 56 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys
import inspect
import os
import shutil
import sys

__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))
__location__ = os.path.join(
os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe()))
)

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

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

args = cmd_line.split(" ")
if parse_version(sphinx.__version__) >= parse_version('1.7'):
if parse_version(sphinx.__version__) >= parse_version("1.7"):
args = args[1:]

apidoc.main(args)
Expand All @@ -63,37 +64,46 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
'sphinx.ext.autosummary', 'sphinx.ext.viewcode', 'sphinx.ext.coverage',
'sphinx.ext.doctest', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinx.ext.napoleon', 'sphinxcontrib.plantuml']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.ifconfig",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinxcontrib.plantuml",
]

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

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

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

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

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'aleph-sdk-python'
copyright = u'2019, Aleph.im'
project = "aleph-sdk-python"
copyright = "2019, Aleph.im"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '' # Is set by calling `setup.py docs`
version = "" # Is set by calling `setup.py docs`
# The full version, including alpha/beta/rc tags.
release = '' # Is set by calling `setup.py docs`
release = "" # Is set by calling `setup.py docs`

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

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

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'alabaster'
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
#'sidebar_width': '300px',
#'page_width': '1200px'
'logo': 'logo.svg',
'description': 'Aleph Network Client',
'github_user': 'aleph-im',
'github_repo': 'aleph-sdk-python',
'github_button': True,
'github_type': 'star',
'github_banner': True,
'travis_button': True,
'codecov_button': True,
'pre_bg': '#FFF6E5',
'note_bg': '#E5ECD1',
'note_border': '#BFCF8C',
'body_text': '#482C0A',
'sidebar_text': '#49443E',
'sidebar_header': '#4B4032',
'sidebar_collapse': False,
"logo": "logo.svg",
"description": "Aleph Network Client",
"github_user": "aleph-im",
"github_repo": "aleph-sdk-python",
"github_button": True,
"github_type": "star",
"github_banner": True,
"travis_button": True,
"codecov_button": True,
"pre_bg": "#FFF6E5",
"note_bg": "#E5ECD1",
"note_border": "#BFCF8C",
"body_text": "#482C0A",
"sidebar_text": "#49443E",
"sidebar_header": "#4B4032",
"sidebar_collapse": False,
}

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

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

# Output file base name for HTML help builder.
htmlhelp_basename = 'aleph_client-doc'
htmlhelp_basename = "aleph_client-doc"


# -- Options for LaTeX output --------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}

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

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

# -- External mapping ------------------------------------------------------------
python_version = '.'.join(map(str, sys.version_info[0:2]))
python_version = ".".join(map(str, sys.version_info[0:2]))
intersphinx_mapping = {
'sphinx': ('http://www.sphinx-doc.org/en/stable', None),
'python': ('https://docs.python.org/' + python_version, None),
'matplotlib': ('https://matplotlib.org', None),
'numpy': ('https://docs.scipy.org/doc/numpy', None),
'sklearn': ('http://scikit-learn.org/stable', None),
'pandas': ('http://pandas.pydata.org/pandas-docs/stable', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
"sphinx": ("http://www.sphinx-doc.org/en/stable", None),
"python": ("https://docs.python.org/" + python_version, None),
"matplotlib": ("https://matplotlib.org", None),
"numpy": ("https://docs.scipy.org/doc/numpy", None),
"sklearn": ("http://scikit-learn.org/stable", None),
"pandas": ("http://pandas.pydata.org/pandas-docs/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
}
1 change: 0 additions & 1 deletion examples/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ async def gateway(
transport="tcp",
auth=None,
):

if pkey is None:
pkey = get_fallback_private_key()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from setuptools import setup

try:
require('setuptools>=38.3')
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)
Expand Down
3 changes: 0 additions & 3 deletions src/aleph/sdk/user_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,6 @@ async def _handle_broadcast_deprecated_response(
self._log_publication_status(publication_status)

async def _broadcast_deprecated(self, message_dict: Mapping[str, Any]) -> None:

"""
Broadcast a message on the Aleph network using the deprecated
/ipfs/pubsub/pub/ endpoint.
Expand Down Expand Up @@ -1312,7 +1311,6 @@ async def _prepare_aleph_message(
allow_inlining: bool = True,
storage_engine: StorageEnum = StorageEnum.storage,
) -> AlephMessage:

message_dict: Dict[str, Any] = {
"sender": self.account.get_address(),
"chain": self.account.CHAIN,
Expand Down Expand Up @@ -1353,7 +1351,6 @@ async def submit(
allow_inlining: bool = True,
sync: bool = False,
) -> Tuple[AlephMessage, MessageStatus]:

message = await self._prepare_aleph_message(
message_type=message_type,
content=content,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_vm_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
async def test_local_vm_cache():
cache = TestVmCache()
assert (await cache.get("doesnotexist")) is None
assert len(await (cache.keys())) == 0
assert len(await cache.keys()) == 0
key = "thisdoesexist"
value = "yay, I exist!"
await cache.set(key, value)
Expand All @@ -18,7 +18,7 @@ async def test_local_vm_cache():
assert (await cache.keys("*exist"))[0] == key
await cache.delete(key)
assert (await cache.get(key)) is None
assert len(await (cache.keys())) == 0
assert len(await cache.keys()) == 0


def test_sanitize_cache_keys():
Expand Down