Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: Black support #314

Merged
merged 3 commits into from Jun 8, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,25 @@
Changes
=======

Version master (UNRELEASED)
---------------------------

- Enables workflow restarts.
- Enables deletion of workflows in queued state.
- Exposes workflow engines logs.
- Allows passing operational options.
- Adds progress report on workflow list response.
- Makes CVMFS available in interactive sessions.
- Adds preview flag to file download endpoint.
- Fixes jobs status update.
- Labels workflow engine pods for better traceability.
- Enriches logs enpoint information.
- Decreases clone depth when retrieving GitLab projects.
- Fixes response on close interactive session action.
- Installs submodules in editable mode for live code updates.
- Adds code mount on dev mode in workflow engines and job controller.
- Adds Black formatter support.

Version 0.6.0 (2019-12-20)
--------------------------

Expand Down
3 changes: 3 additions & 0 deletions README.rst
Expand Up @@ -17,6 +17,9 @@
.. image:: https://img.shields.io/github/license/reanahub/reana-workflow-controller.svg
:target: https://github.com/reanahub/reana-workflow-controller/blob/master/LICENSE

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

About
-----

Expand Down
137 changes: 67 additions & 70 deletions docs/conf.py
Expand Up @@ -34,51 +34,48 @@
# needs_sphinx = '1.0'

# Do not warn on external images.
suppress_warnings = ['image.nonlocal_uri']
suppress_warnings = ["image.nonlocal_uri"]

# 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.coverage',
'sphinx.ext.doctest',
'sphinx.ext.graphviz',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinxcontrib.httpdomain',
'sphinxcontrib.openapi',
'sphinxcontrib.redoc',
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.graphviz",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinxcontrib.httpdomain",
"sphinxcontrib.openapi",
"sphinxcontrib.redoc",
]

redoc = [
{
'page': '_static/api',
'spec': 'openapi.json',
'embed': True,
'opts': {
'hide-loading': True,
'hide-hostname': True,
}
"page": "_static/api",
"spec": "openapi.json",
"embed": True,
"opts": {"hide-loading": True, "hide-hostname": True,},
}
]

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

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

# General information about the project.
project = 'reana'
copyright = '2017-2019 info@reana.io'
author = 'info@reana.io'
project = "reana"
copyright = "2017-2019 info@reana.io"
author = "info@reana.io"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -88,9 +85,9 @@

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('..', 'reana_workflow_controller', 'version.py'), 'rt') as fp:
with open(os.path.join("..", "reana_workflow_controller", "version.py"), "rt") as fp:
exec(fp.read(), g)
version = g['__version__']
version = g["__version__"]

# The full version, including alpha/beta/rc tags.
release = version
Expand All @@ -105,10 +102,10 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

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

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -119,53 +116,53 @@
# 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 = {
'logo': 'logo-reana.png',
'description': """<p>REANA-Workflow-Controller is a component of the <a
"logo": "logo-reana.png",
"description": """<p>REANA-Workflow-Controller is a component of the <a
href="http://www.reana.io">REANA</a> reusable and
reproducible research data analysis
platform.</p><p>REANA-Workflow-Controller takes care of
instantiating and managing computational
workflows.</p>""",
'github_user': 'reanahub',
'github_repo': 'reana-workflow-controller',
'github_button': False,
'github_banner': True,
'show_powered_by': False,
'extra_nav_links': {
'REANA@DockerHub': 'https://hub.docker.com/u/reanahub/',
'REANA@GitHub': 'https://github.com/reanahub',
'REANA@Twitter': 'https://twitter.com/reanahub',
'REANA@Web': 'http://www.reana.io',
}
"github_user": "reanahub",
"github_repo": "reana-workflow-controller",
"github_button": False,
"github_banner": True,
"show_powered_by": False,
"extra_nav_links": {
"REANA@DockerHub": "https://hub.docker.com/u/reanahub/",
"REANA@GitHub": "https://github.com/reanahub",
"REANA@Twitter": "https://twitter.com/reanahub",
"REANA@Web": "http://www.reana.io",
},
}

# 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"]

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html',
'donate.html',
"**": [
"about.html",
"navigation.html",
"relations.html",
"searchbox.html",
"donate.html",
]
}

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'reanadoc'
htmlhelp_basename = "reanadoc"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -174,15 +171,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

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

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -192,19 +186,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'reana.tex', 'reana Documentation',
'info@reana.io', 'manual'),
(master_doc, "reana.tex", "reana Documentation", "info@reana.io", "manual"),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'reana', 'reana Documentation',
[author], 1)
]
man_pages = [(master_doc, "reana", "reana Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -213,12 +203,18 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'reana', 'reana Documentation',
author, 'reana', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"reana",
"reana Documentation",
author,
"reana",
"One line description of project.",
"Miscellaneous",
),
]

rest_api_modules = ['reana_workflow_controller.rest']
rest_api_modules = ["reana_workflow_controller.rest"]


def get_name(full_module_name):
Expand All @@ -227,7 +223,7 @@ def get_name(full_module_name):
Split the full_module_name by "."'s
"""
module_name = ".".join(full_module_name.split(".")[:2])
function_name = full_module_name.split('.')[-1]
function_name = full_module_name.split(".")[-1]
return module_name, function_name


Expand All @@ -237,24 +233,25 @@ def process_docstring(app, what, name, obj, options, lines):
to redocs.
"""
module_name, function_name = get_name(name)
description = ''
operation_id = ''
description = ""
operation_id = ""
if what != "module" and module_name in rest_api_modules:
for line in lines:
if "summary:" in line:
description = line.split("summary: ", 1)[1]
if "operationId:" in line:
operation_id = line.split('operationId: ', 1)[1]
url = "`%s <_static/api.html#operation/%s>`_" % (description,
operation_id)
operation_id = line.split("operationId: ", 1)[1]
url = "`%s <_static/api.html#operation/%s>`_" % (description, operation_id)
# clearing the list of docstrings
del lines[:]
# adding back description
lines.append(url)


intersphinx_mapping = {
'reana_db': ('https://reana-db.readthedocs.io/en/latest/', None),
"reana_db": ("https://reana-db.readthedocs.io/en/latest/", None),
}


def setup(app):
app.connect('autodoc-process-docstring', process_docstring)
app.connect("autodoc-process-docstring", process_docstring)
2 changes: 1 addition & 1 deletion pytest.ini
Expand Up @@ -5,4 +5,4 @@
# under the terms of the MIT License; see LICENSE file for more details.

[pytest]
addopts = --pep8 --ignore=docs --cov=reana_workflow_controller --cov-report=term-missing
addopts = --ignore=docs --cov=reana_workflow_controller --cov-report=term-missing
2 changes: 1 addition & 1 deletion reana_workflow_controller/__init__.py
Expand Up @@ -12,4 +12,4 @@

from .version import __version__

__all__ = ('__version__', )
__all__ = ("__version__",)
4 changes: 2 additions & 2 deletions reana_workflow_controller/app.py
Expand Up @@ -24,5 +24,5 @@ def shutdown_session(response_or_exc):
return response_or_exc


if __name__ == '__main__':
app.run(host='0.0.0.0')
if __name__ == "__main__":
app.run(host="0.0.0.0")
2 changes: 1 addition & 1 deletion reana_workflow_controller/cli.py
Expand Up @@ -16,7 +16,7 @@
from reana_workflow_controller.consumer import JobStatusConsumer


@click.command('consume-job-queue')
@click.command("consume-job-queue")
def consume_job_queue():
"""Consumes job queue and updates job status."""
logging.basicConfig(level=REANA_LOG_LEVEL, format=REANA_LOG_FORMAT)
Expand Down