From 427c105c589f0737871a60759b416eda6fb52bf2 Mon Sep 17 00:00:00 2001 From: mrichomme Date: Wed, 3 Jun 2020 09:48:34 +0200 Subject: Add tox.ini for pythonsdk-tests Issue-ID: INT-1607 Signed-off-by: mrichomme Change-Id: I668882bcceb98c47896486c600f24fae52341b61 Signed-off-by: mrichomme --- .coafile | 30 ++++++++++++++++++++++++++ .gitattributes | 5 +++++ .gitignore | 33 +++++++++++++++++++++++++++++ .yamllint | 16 ++++++++++++++ docs/conf.py | 26 +++++++++++++++++++++++ docs/requirements-docs.txt | 15 +++++++++++++ tox.ini | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 178 insertions(+) create mode 100644 .coafile create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .yamllint create mode 100644 docs/conf.py create mode 100644 docs/requirements-docs.txt create mode 100644 tox.ini diff --git a/.coafile b/.coafile new file mode 100644 index 0000000..c67ac99 --- /dev/null +++ b/.coafile @@ -0,0 +1,30 @@ +[yaml] +bears = YAMLLintBear +yamllint_config = .yamllint +ignore = + .tox/**, + +[json] +bears = JSONFormatBear +json_sort = False +indent_size = 2 +ignore = + .tox/**, + +[py] +bears = PyLintBear +pylint_disable = all +pylint_enable = + bad-indentation, trailing-whitespace, unused-wildcard-import, unused-import, + unnecessary-semicolon, unnecessary-semicolon, undefined-variable, + syntax-error, unused-variable, using-constant-test,unused-argument, + len-as-condition, trailing-newlines, missing-final-newline, reimported, + too-many-function-args, singleton-comparison +ignore = + .tox/** + +[md] +bears = MarkdownBear +ignore = + .tox/** + diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2eb6749 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto eol=lf +*.png binary +*.jpg binary +*.xlsx binary +*.csar -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..543c596 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +.idea/ +.project +.classpath +.factorypath +.settings/ +target/ +autorelease/build/*/ +autorelease/dist +log.html +output.xml +report.html +env.properties +.vagrant +/archives/ +*.jar +*.zip +*.tar +*.log +.vagrant +*~ +.checkstyle +.DS_Store +devtool/ +seccom/ +csit/ +.idea +*.iml +/.pydevproject +/bin/ +*.class +*.csar +benchmark/ +.tox/ diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..ab5bdc3 --- /dev/null +++ b/.yamllint @@ -0,0 +1,16 @@ +--- + +extends: default + +rules: + line-length: disable + truthy: disable + braces: + max-spaces-inside: 1 + brackets: + max-spaces-inside: 1 + comments-indentation: disable + comments: disable + document-start: disable + indentation: + indent-sequences: whatever diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..6684e1c --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,26 @@ +from docs_conf.conf import * + +branch = 'latest' +master_doc = 'index' + +linkcheck_ignore = [ + r'http://localhost:.*', + 'http://CONSUL_SERVER_UI:30270/ui/#/dc1/services', + r'https://.*h=frankfurt', + r'http.*frankfurt.*', + r'http.*simpledemo.onap.org.*', + r'http://ANY_K8S_IP.*', + 'http://so-monitoring:30224', + r'http://SINK_IP_ADDRESS:667.*', + r'http.*K8S_HOST:30227.*', + r'http.*K8S_NODE_IP.*' +] + +intersphinx_mapping = {} + +html_theme = 'sphinx_rtd_theme' +html_last_updated_fmt = '%d-%b-%y %H:%M' +html_theme_options = {'body_max_width': '100%'} + +def setup(app): + app.add_stylesheet("css/ribbon.css") diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt new file mode 100644 index 0000000..b3188dd --- /dev/null +++ b/docs/requirements-docs.txt @@ -0,0 +1,15 @@ +tox +Sphinx +doc8 +docutils +setuptools +six +sphinx_rtd_theme>=0.4.3 +sphinxcontrib-blockdiag +sphinxcontrib-needs>=0.2.3 +sphinxcontrib-nwdiag +sphinxcontrib-seqdiag +sphinxcontrib-swaggerdoc +sphinxcontrib-plantuml +sphinx_bootstrap_theme +lfdocs-conf diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..ee2b4c0 --- /dev/null +++ b/tox.ini @@ -0,0 +1,53 @@ +[tox] +minversion = 3.2.0 +envlist = json,yaml,py,rst,md +skipsdist = true +requires = pip >= 8 + +[testenv] +basepython = python3 +whitelist_externals = + git + bash +deps = + coala-bears + nodeenv + +[testenv:json] +commands_pre = + /bin/sh -c "git --no-pager diff HEAD HEAD^ --name-only '*.json' > /tmp/.coalist_json" +commands = +# '\ ' at the end of command is needed for a case where above command returns empty list (it adds empty file +# parameter to '--files' opt + /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn json --files $( /tmp/.coalist_yaml" +commands = +# '\ ' at the end of command is needed for a case where above command returns empty list (it adds empty file +# parameter to '--files' opt + /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn yaml --files $( /tmp/.coalist_py" +commands = + /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn py --files $( /tmp/.coalist_rst" +deps = -r ./docs/requirements-docs.txt +commands = + /bin/sh -c "sphinx-build -n -b html docs docs/build/html $( /tmp/.coalist_md" +commands = + /bin/bash -c "coala --non-interactive --disable-caching --no-autoapply-warn md --files $(