From f3aac5c4d0aebad751ef9ab29a45ae89e76ce297 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 15 May 2018 09:58:22 +0100 Subject: [PATCH] Add tox.ini with pep8 environment that runs yamllint Also fixes one lint failure - a trailing space in monitoring.yml. --- .gitignore | 36 +++++++++++++++++++++++++++++------- .yamllint | 12 ++++++++++++ etc/kayobe/monitoring.yml | 2 +- setup.cfg | 14 ++++++++++++++ setup.py | 22 ++++++++++++++++++++++ test-requirements.txt | 5 +++++ tox.ini | 14 ++++++++++++++ 7 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 .yamllint create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index eb61b58..713cead 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,33 @@ -# vim and emacs temp files -*~ -[._]*.s[a-w][a-z] - -# Byte-compiled / optimized / DLL files -__pycache__/ *.py[cod] -*$py.class + +# C extensions +*.so + +# Packages +*.egg* +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.tox + +# Editors +*~ +.*.swp +.*sw? # Files generated by Ansible ansible/*.retry diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..479488d --- /dev/null +++ b/.yamllint @@ -0,0 +1,12 @@ +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + comments: + require-starting-space: false + truthy: disable diff --git a/etc/kayobe/monitoring.yml b/etc/kayobe/monitoring.yml index a5dabbf..0b64855 100644 --- a/etc/kayobe/monitoring.yml +++ b/etc/kayobe/monitoring.yml @@ -23,7 +23,7 @@ # Dict of monitoring node BIOS options. Format is same as that used by # stackhpc.drac role. -#monitoring_bios_config: +#monitoring_bios_config: # Dict of default monitoring node BIOS options. Format is same as that used by # stackhpc.drac role. diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..f2954bb --- /dev/null +++ b/setup.cfg @@ -0,0 +1,14 @@ +[metadata] +name = kayobe-config +summary = Configuration for Kayobe +description-file = + README.rst +author = OpenStack +author-email = openstack-dev@lists.openstack.org +home-page = https://kayobe.readthedocs.io/en/latest/ +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..70c2b3f --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools + +setuptools.setup( + setup_requires=['pbr'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..333d318 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,5 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +yamllint # GPLv3 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..c6a9b8c --- /dev/null +++ b/tox.ini @@ -0,0 +1,14 @@ +[tox] +minversion = 2.0 +envlist = pep8 +skipsdist = True + +[testenv] +install_command = pip install {opts} {packages} +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens} + -r{toxinidir}/test-requirements.txt + +[testenv:pep8] +commands = + yamllint etc/kayobe