From cf81b116aa75475321e68e2110a84f87db9d1205 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Tue, 1 Aug 2017 14:03:13 -0400 Subject: [PATCH] Initial support for zuulv3.o.o Add python bits to run a tox-pep8 job. Change-Id: I483720a9e1af9ae28415f20f3897cf9e065ab849 Signed-off-by: Paul Belanger --- .zuul.yaml | 5 +++++ bindep.txt | 2 ++ requirements.txt | 0 setup.cfg | 26 ++++++++++++++++++++++++++ setup.py | 29 +++++++++++++++++++++++++++++ test-requirements.txt | 1 + tox.ini | 36 ++++++++++++++++++++++++++++++++++++ 7 files changed, 99 insertions(+) create mode 100644 .zuul.yaml create mode 100644 bindep.txt create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 000000000..27140ae30 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,5 @@ +- project: + name: openstack-dev/sandbox + check: + jobs: + - tox-pep8 diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 000000000..4f9b42547 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,2 @@ +# This is a cross-platform list tracking distribution packages needed by tests; +# see http://docs.openstack.org/infra/bindep/ for additional information. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..e69de29bb diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..3bb479f72 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,26 @@ +[metadata] +name = sandbox +summary = The sandbox +description-file = + README.rst +author = OpenStack Infrastructure Team +author-email = openstack-infra@lists.openstack.org +home-page = http://docs.openstack.org/infra/system-config/ +classifier = + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 2.6 + +[pbr] +warnerrors = True + +[build_sphinx] +source-dir = doc/source +build-dir = doc/build +all_files = 1 +warning-is-error = 1 diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..3887303fb --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +# 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 + +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # noqa +except ImportError: + pass + +setuptools.setup( + setup_requires=['pbr>=2.0'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..ff99a1fa7 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +hacking>=0.10.2,<0.11 diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..f91a36b10 --- /dev/null +++ b/tox.ini @@ -0,0 +1,36 @@ +[tox] +minversion = 2.0 +envlist = pep8 +skipsdist = True + +[testenv] +usedevelop = True +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +setenv = + VIRTUAL_ENV={envdir} + PYTHONWARNINGS=default::DeprecationWarning +deps = -r{toxinidir}/test-requirements.txt +commands = python setup.py test --slowest --testr-args='{posargs}' + +[testenv:pep8] +commands = flake8 {posargs} + +[testenv:venv] +commands = {posargs} + +[testenv:cover] +commands = python setup.py test --coverage --testr-args='{posargs}' + +[testenv:docs] +commands = python setup.py build_sphinx + +[testenv:debug] +commands = oslo_debug_helper {posargs} + +[flake8] +# E123, E125 skipped as they are invalid PEP-8. + +show-source = True +ignore = E123,E125 +builtins = _ +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build