From 54b5aa0244cdc98dac811355fbfb8802935af90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Vidal=20Garc=C3=ADa?= Date: Thu, 23 Jul 2020 14:32:24 +0200 Subject: [PATCH] Revert "docs: add script to generate cli api docs" This reverts commit 44811f7f8b3f4af5711fb3813182d4d9638437fb. --- .gitignore | 4 ---- MANIFEST.in | 1 - run-tests.sh | 13 +------------ scripts/generate_cli_api.py | 35 ----------------------------------- 4 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 scripts/generate_cli_api.py diff --git a/.gitignore b/.gitignore index 8d8b1f15..c4b43a42 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,3 @@ target/ # Visual Studio Code files .vscode/* - -# Docs autogeneration -cmd_list.txt -cli_api.md diff --git a/MANIFEST.in b/MANIFEST.in index 433ede65..20153258 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -21,4 +21,3 @@ recursive-include docs *.py recursive-include docs *.png recursive-include docs *.rst recursive-include tests *.py -recursive-include scripts *.py diff --git a/run-tests.sh b/run-tests.sh index c1771615..6498c4b1 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of REANA. # Copyright (C) 2017, 2018 CERN. @@ -6,22 +6,11 @@ # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. - -cli_docs_url=https://raw.githubusercontent.com/reanahub/docs.reana.io/master/docs/reference/reana-client-cli-api/index.md -docs_differ_error_msg='Current reana-client differs with the documentation. Please update http://docs.reana.io/reference/reana-client-cli-api/.' -python_version=$(python -c 'import sys; print(sys.version_info.major)') - pydocstyle reana_client && \ black --check . && \ reana-client --help > cmd_list.txt && \ diff -q -w docs/cmd_list.txt cmd_list.txt && \ rm cmd_list.txt && \ -if [ "$python_version" -eq 3 ] -then - python scripts/generate_cli_api.py > cli_api.md && \ - (diff -q -w cli_api.md <(curl -s $cli_docs_url) || (echo $docs_differ_error_msg && exit 1)) && \ - rm cli_api.md -fi check-manifest --ignore ".travis-*" && \ sphinx-build -qnNW docs docs/_build/html && \ python setup.py test && \ diff --git a/scripts/generate_cli_api.py b/scripts/generate_cli_api.py deleted file mode 100644 index 9bdaaada..00000000 --- a/scripts/generate_cli_api.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of REANA. -# Copyright (C) 2020 CERN. -# -# REANA is free software; you can redistribute it and/or modify it -# under the terms of the MIT License; see LICENSE file for more details. -"""REANA client CLI API docs generation.""" - -import click - -from reana_client.cli import cli - - -def _print_code_block(content, lang=""): - print("```{}".format(lang)) - print(content) - print("```") - - -def generate_cli_docs(): - """Generate Markdown friendly CLI API documentation.""" - print("# reana-client CLI API\n") - with click.Context(cli) as ctx: - _print_code_block(cli.get_help(ctx), lang="console") - - for cmd_group in cli.cmd_groups: - print("\n## {}".format(cmd_group.help)) - for cmd_obj in cmd_group.commands.values(): - print("\n### {}\n".format(cmd_obj.name)) - print(cmd_obj.help) - - -if __name__ == "__main__": - generate_cli_docs()