Update Neutron Classifier for Zuulv3

This patch updates the testing of the neutron classifier
repository to be zuulv3 compliant. Changes include:
 - Added lower-constraints.txt file.
 - Added clarifying comments to requirements.txt including
   neutron-lib-current update.
 - Removed playbooks/legacy yaml files.
 - Modified coverage package version.
 - Added to testenv, testenv:dev in tox.ini

 This patch is part of the neutron-sibling-setup
 as documented in [1]. Changes were also based on zuulv3
 opencontrail patch [2] as well as updates made to
 x/vmware-nsx project.[3]

[1] https://etherpad.openstack.org/p/neutron-sibling-setup
[2] https://review.opendev.org/#/c/624782/
[3] https://review.opendev.org/#/c/670134/

Change-Id: I46ac45d97a5af24ae234f11952d6883cd3088ff7
This commit is contained in:
Boden R 2019-07-18 08:37:55 -06:00
parent 103c2022ca
commit 7e3ae0075a
16 changed files with 576 additions and 136 deletions

79
.gitignore vendored
View File

@ -1,58 +1,31 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
.eggs
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
.testrepository
.venv
.stestr/
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Complexity
output/*.html
output/*/index.html
# Sphinx
doc/build
# pbr generates these
AUTHORS AUTHORS
build/*
build-stamp
ChangeLog ChangeLog
cover/
# Editors covhtml/
dist/
doc/build
etc/*.sample
*.DS_Store
*.pyc
vmware_nsx.egg-info/
pbr*.egg/
run_tests.err.log
run_tests.log
setuptools*.egg/
subunit.log
*.mo
*.sw?
*~ *~
.*.swp /.*
.*sw? !/.coveragerc
!/.gitignore
!/.gitreview
!/.mailmap
!/.pylintrc
!/.testr.conf
!/.zuul.yaml
# Reno # Files created by releasenotes build
releasenotes/build releasenotes/build

142
.pylintrc Normal file
View File

@ -0,0 +1,142 @@
# The format of this file isn't really documented; just use --generate-rcfile
[MASTER]
# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
#
# Note the 'openstack' below is intended to match only
# neutron.openstack.common. If we ever have another 'openstack'
# dirname, then we'll need to expand the ignore features in pylint :/
ignore=.git,tests,openstack
[MESSAGES CONTROL]
# NOTE(gus): This is a long list. A number of these are important and
# should be re-enabled once the offending code is fixed (or marked
# with a local disable)
disable=
# "F" Fatal errors that prevent further processing
import-error,
# "I" Informational noise
locally-disabled,
# "E" Error for important programming issues (likely bugs)
access-member-before-definition,
no-member,
no-method-argument,
no-self-argument,
not-an-iterable,
# "W" Warnings for stylistic problems or minor programming issues
abstract-method,
abstract-class-instantiated,
arguments-differ,
attribute-defined-outside-init,
bad-builtin,
bad-indentation,
broad-except,
dangerous-default-value,
deprecated-lambda,
expression-not-assigned,
fixme,
global-statement,
literal-comparison,
no-init,
non-parent-init-called,
not-callable,
protected-access,
redefined-builtin,
redefined-outer-name,
signature-differs,
star-args,
super-init-not-called,
super-on-old-class,
unpacking-non-sequence,
unused-argument,
unused-import,
unused-variable,
unsubscriptable-object,
useless-super-delegation,
# TODO(dougwig) - disable nonstandard-exception while we have neutron_lib shims
nonstandard-exception,
# "C" Coding convention violations
bad-continuation,
consider-iterating-dictionary,
consider-using-enumerate,
invalid-name,
len-as-condition,
misplaced-comparison-constant,
missing-docstring,
singleton-comparison,
superfluous-parens,
ungrouped-imports,
wrong-import-order,
wrong-import-position,
# "R" Refactor recommendations
abstract-class-little-used,
abstract-class-not-used,
consider-merging-isinstance,
consider-using-ternary,
duplicate-code,
interface-not-implemented,
no-else-return,
no-self-use,
redefined-argument-from-local,
simplifiable-if-statement,
too-few-public-methods,
too-many-ancestors,
too-many-arguments,
too-many-boolean-expressions,
too-many-branches,
too-many-function-args,
too-many-instance-attributes,
too-many-lines,
too-many-locals,
too-many-nested-blocks,
too-many-public-methods,
too-many-return-statements,
too-many-statements,
cyclic-import,
no-name-in-module,
bad-super-call
[BASIC]
# Variable names can be 1 to 31 characters long, with lowercase and underscores
variable-rgx=[a-z_][a-z0-9_]{0,30}$
# Argument names can be 2 to 31 characters long, with lowercase and underscores
argument-rgx=[a-z_][a-z0-9_]{1,30}$
# Method names should be at least 3 characters long
# and be lowecased with underscores
method-rgx=([a-z_][a-z0-9_]{2,}|setUp|tearDown)$
# Module names matching neutron-* are ok (files in bin/)
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(neutron-[a-z0-9_-]+))$
# Don't require docstrings on tests.
no-docstring-rgx=((__.*__)|([tT]est.*)|setUp|tearDown)$
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=79
[VARIABLES]
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
# _ is used by our localization
additional-builtins=_
[CLASSES]
# List of interface methods to ignore, separated by a comma.
ignore-iface-methods=
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=
# should use openstack.common.jsonutils
json
[TYPECHECK]
# List of module names for which member attributes should not be checked
ignored-modules=six.moves,_MovedItems
[REPORTS]
# Tells whether to display a full report or only the messages
reports=no

View File

@ -1,3 +1,3 @@
[DEFAULT] [DEFAULT]
test_path=${OS_TEST_PATH:-./neutron_classifier/tests/unit} test_path=./neutron_classifier/tests/unit
top_dir=./ top_dir=./

View File

@ -1,15 +1,29 @@
- project: - project:
templates:
- build-openstack-docs-pti
- check-requirements
- openstack-python-jobs
- openstack-python3-train-jobs
check: check:
jobs: jobs:
- neutron-classifier-tox-lower-constraints
- neutron-classifier-functional-dsvm: - neutron-classifier-functional-dsvm:
required-projects: required-projects:
- openstack/neutron - openstack/neutron
gate: gate:
queue: neutron-classifier
jobs: jobs:
- neutron-classifier-tox-lower-constraints
- neutron-classifier-functional-dsvm: - neutron-classifier-functional-dsvm:
required-projects: required-projects:
- openstack/neutron - openstack/neutron
- job:
name: neutron-classifier-tox-lower-constraints
parent: openstack-tox-lower-constraints
required-projects:
- openstack/neutron
- job: - job:
name: neutron-classifier-functional-dsvm name: neutron-classifier-functional-dsvm
parent: legacy-dsvm-base parent: legacy-dsvm-base
@ -18,10 +32,10 @@
timeout: 7800 timeout: 7800
required-projects: required-projects:
- openstack/devstack-gate - openstack/devstack-gate
- opendev.org/openstack/keystone - openstack/keystone
- opendev.org/openstack/neutron - openstack/neutron
roles: roles:
- zuul: openstack-infra/devstack - zuul: openstack/devstack-gate
vars: vars:
devstack_localrc: devstack_localrc:
DATABASE_PASSWORD: secretdatabase DATABASE_PASSWORD: secretdatabase
@ -64,4 +78,4 @@
tempest: false tempest: false
osc_environment: osc_environment:
PYTHONUNBUFFERED: 'true' PYTHONUNBUFFERED: 'true'
OS_CLOUD: devstack-admin OS_CLOUD: devstack-admin

31
bindep.txt Normal file
View File

@ -0,0 +1,31 @@
# This file contains runtime (non-python) dependencies
# More info at: http://docs.openstack.org/infra/bindep/readme.html
# tools/misc-sanity-checks.sh validates .po[t] files
gettext [test]
# cffi (required by oslo.privsep) and PyNaCL (required by paramiko)
libffi-dev [platform:dpkg]
libffi-devel [platform:rpm]
# MySQL and PostgreSQL databases since some jobs are set up in
# OpenStack infra that need these like
# periodic-neutron-py27-with-oslo-master and
# periodic-neutron-py35-with-neutron-lib-master.
haproxy
libmysqlclient-dev [platform:dpkg test]
mysql [platform:rpm test]
mysql-client [platform:dpkg test]
mysql-devel [platform:rpm test]
mysql-server [test]
postgresql [test]
postgresql-client [platform:dpkg test]
postgresql-devel [platform:rpm test]
postgresql-server [platform:rpm test]
postgresql-server-dev-all [platform:dpkg]
# Neutron's test-requirements requires tempest which requires paramiko
# which requires cryptography which requires ssl.
libssl-dev [platform:dpkg]
openssl-devel [platform:rpm !platform:suse]
libopenssl-devel [platform:suse !platform:rpm]

13
doc/requirements.txt Normal file
View File

@ -0,0 +1,13 @@
# 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.
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
oslosphinx>=4.7.0 # Apache-2.0
openstackdocstheme>=1.18.1 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
@ -12,60 +11,232 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import os # Build configuration file that is execfile()'d with the current directory
import sys # set to it's containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
sys.path.insert(0, os.path.abspath('../..')) import os
# -- General configuration ---------------------------------------------------- import subprocess
import sys
import warnings
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
sys.path.insert(0, ROOT_DIR)
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [ extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autodoc', 'sphinx.ext.coverage',
'oslosphinx' 'sphinx.ext.ifconfig',
] 'sphinx.ext.graphviz',
'sphinx.ext.todo',
'openstackdocstheme',]
# autodoc generation is a bit aggressive and a nuisance when doing heavy todo_include_todos = True
# text edit cycles.
# execute "export SPHINX_DEBUG=1" in your terminal to disable # Add any paths that contain templates here, relative to this directory.
templates_path = []
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'
# The master toctree document. # The encoding of source files.
#source_encoding = 'utf-8'
# The master doctree document.
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'neutron-classifier' project = u'Neutron Library'
copyright = u'2013, OpenStack Foundation' copyright = u'2015-present, OpenStack Foundation.'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# Version info
from neutron_classifier.version import version_info as neutron_class_version
release = neutron_class_version.release_string()
# The short X.Y version.
version = neutron_class_version.version_string()
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
# unused_docs = []
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = []
# The reST default role (for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True #add_function_parentheses = True
# If true, the current module name will be prepended to all description # If true, the current module name will be prepended to all description
# unit titles (such as .. function::). # unit titles (such as .. function::).
add_module_names = True #add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = True
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
# -- Options for HTML output -------------------------------------------------- # A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['neutron_lib.']
# -- Options for man page output --------------------------------------------
# Grouping the document tree for man pages.
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
# man_pages = [
# ('man/neutron-lib', 'neutron-lib', u'Neutron Library',
# [u'OpenStack'], 1)
# ]
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with # The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'. # Sphinx are currently 'default' and 'sphinxdoc'.
# html_theme_path = ["."] # html_theme_path = ["."]
# html_theme = '_theme' # html_theme = '_theme'
# html_static_path = ['static'] html_theme = 'openstackdocs'
# 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 = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = ['_theme']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# 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']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % project #htmlhelp_basename = 'neutronlibdoc'
# -- Options for LaTeX output ------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass # (source start file, target name, title, author,
# [howto/manual]). # documentclass [howto/manual]).
latex_documents = [ # latex_documents = [
('index', # ('index', 'NeutronLib.tex', u'Neutron Library Documentation',
'%s.tex' % project, # u'Neutron development team', 'manual'),
u'%s Documentation' % project, # ]
u'OpenStack Foundation', 'manual'),
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True
# -- Options for openstackdocstheme -------------------------------------------
repository_name = 'x/neutron-classifier'
bug_project = 'neutron-classifier'
bug_tag = 'doc'
linkcheck_anchors_ignore = [
# skip gerrit anchors
'\/q\/.*',
'q\,.*',
'\/c\/.*'
] ]

21
lower-constraints.txt Normal file
View File

@ -0,0 +1,21 @@
bandit==1.1.0
coverage==4.0
fixtures==3.0.0
flake8-import-order==0.12
flake8==2.6.2
hacking==1.1.0
keystoneauth1==3.14.0
mock==2.0.0
neutron-lib==1.28.0
oslo.utils==3.40.2
oslotest==3.2.0
pbr==4.0.0
python-neutronclient==6.7.0
python-openstackclient==3.16.0
psycopg2==2.7
PyMySQL==0.7.6
pylint==1.7.1
SQLAlchemy==1.2.0
sphinx==1.6.5
stestr==1.0.0
testtools==2.2.0

View File

@ -21,6 +21,7 @@ def validate_string(String):
String = '' String = ''
return String return String
CLASSIFICATION_GROUP_RESOURCE_MAP = { CLASSIFICATION_GROUP_RESOURCE_MAP = {
'id': { 'id': {
'allow_post': False, 'allow_put': False, 'allow_post': False, 'allow_put': False,

View File

@ -40,6 +40,7 @@ def validate_string(String):
String = '' String = ''
return String return String
RESOURCE_ATTRIBUTE_MAP = { RESOURCE_ATTRIBUTE_MAP = {
'classification_type': 'classification_type':
classifier_resources.CLASSIFICATION_TYPE_RESOURCE_MAP, classifier_resources.CLASSIFICATION_TYPE_RESOURCE_MAP,

View File

@ -0,0 +1,17 @@
# Copyright 2011 OpenStack Foundation
#
# 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.
import pbr.version
version_info = pbr.version.VersionInfo('neutron-classifier')

View File

@ -1,9 +1,17 @@
pbr>=2.0.0,!=2.1.0 # Apache-2.0 pbr>=4.0.0 # Apache-2.0
Babel>=2.3.4,!=2.4.0 # BSD keystoneauth1>=3.14.0 # Apache-2.0
keystoneauth1>=3.6.2 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0 python-neutronclient>=6.7.0 # Apache-2.0
python-openstackclient>=3.16.0 # Apache-2.0 python-openstackclient>=3.16.0 # Apache-2.0
SQLAlchemy>=1.0.10,!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8 # MIT SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.2.0 # MIT
neutron-lib>=1.18.0 # Apache-2.0 neutron-lib>=1.28.0 # Apache-2.0
neutron>=14.0.0 # Apache-2.0 oslo.utils>=3.40.2 # Apache-2.
oslo.utils>=3.33.0 # Apache-2.0
# These repos are installed from git in OpenStack CI if the job
# configures them as required-projects:
neutron>=14.0.0.0rc1 # Apache-2.0
# The comment below indicates this project repo is current with neutron-lib
# and should receive neutron-lib consumption patches as they are released
# in neutron-lib. It also implies the project will stay current with TC
# and infra initiatives ensuring consumption patches can land.
# neutron-lib-current

View File

@ -16,7 +16,7 @@ classifier =
Programming Language :: Python :: 2 Programming Language :: Python :: 2
Programming Language :: Python :: 2.7 Programming Language :: Python :: 2.7
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6
[files] [files]
packages = packages =

View File

@ -25,5 +25,5 @@ except ImportError:
pass pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr'], setup_requires=['pbr>=2.0.0'],
pbr=True) pbr=True)

View File

@ -1,21 +1,16 @@
#The order of packages is significant, because pip processes them in the order # 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 # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking>=1.1.0 # Apache-2.0
hacking>=1.1.0,<1.2.0 # Apache-2.0 bandit!=1.6.0,>=1.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD flake8>=2.6.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD flake8-import-order==0.12 # LGPLv3
openstackdocstheme>=1.18.1 # Apache-2.0 mock>=2.0.0 # BSD
oslosphinx>=4.7.0 # Apache-2.0 psycopg2>=2.7 # LGPL/ZPL
WebOb>=1.7.1 # MIT PyMySQL>=0.7.6 # MIT License
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
os-client-config>=1.28.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
testresources>=2.0.0 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0 pylint==1.7.6 # GPLv2
tempest>=17.1.0 # Apache-2.0

105
tox.ini
View File

@ -1,40 +1,58 @@
[tox] [tox]
minversion = 1.6 envlist = py36,py27,pep8,docs
envlist = py36,py35,py27,pep8 minversion = 2.0
skipsdist = True skipsdist = True
[testenv] [testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
usedevelop = True usedevelop = True
install_command = pip install {opts} {packages} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
setenv = -r{toxinidir}/requirements.txt
VIRTUAL_ENV={envdir} -r{toxinidir}/test-requirements.txt
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
PYTHONWARNINGS=default::DeprecationWarning
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = whitelist_externals =
sh sh
find
stestr stestr
commands = commands =
find . -type f -name "*.py[c|o]" -delete stestr run {posargs}
find . -type d -name "__pycache__" -delete stestr slowest
stestr run {posargs}
[testenv:releasenotes]
basepython = python3
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:bandit]
# B104: Possible binding to all interfaces
# B303: Blacklist use of insecure MD2, MD4, MD5, or SHA1 hash functions
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purpose
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r neutron_classifier -x tests -n5 -s B104,B303,B311
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3
commands = commands =
flake8 flake8
{[testenv:bandit]commands}
[testenv:dsvm] [testenv:dsvm]
basepython = python3 basepython = python3
setenv = OS_FAIL_ON_MISSING_DEPS=1 setenv = OS_FAIL_ON_MISSING_DEPS=1
OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs} OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:dev]
# run locally (not in the gate) using editable mode
# https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
# note that order is important to ensure dependencies don't override
commands =
pip install -q -e "git+https://opendev.org/openstack/neutron#egg=neutron"
[testenv:functional] [testenv:functional]
basepython = python3 basepython = python3
setenv = {[testenv]setenv} setenv = {[testenv]setenv}
@ -69,10 +87,6 @@ deps =
commands = commands =
stestr run {posargs} stestr run {posargs}
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:cover] [testenv:cover]
basepython = python3 basepython = python3
setenv = setenv =
@ -82,14 +96,53 @@ commands =
[testenv:docs] [testenv:docs]
basepython = python3 basepython = python3
commands = python setup.py build_sphinx deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:debug] [testenv:debug]
basepython = python3 basepython = python3
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[flake8] [flake8]
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality
# H205: Use assert(Greater|Less)(Equal) for comparison
# H904: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904
show-source = True show-source = True
#ignore = exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools
builtins = _ import-order-style = pep8
exclude = ./.*,build,dist
[hacking]
import_exceptions = vmware_nsx._i18n,
local-check-factory = neutron_lib.hacking.checks.factory
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
-r{toxinidir}/requirements.txt
[testenv:py27-dev]
basepython = python2.7
commands =
{[testenv:dev]commands}
pip freeze
stestr run {posargs}
whitelist_externals =
stestr
[testenv:py3-dev]
basepython = python3
commands =
{[testenv:dev]commands}
pip freeze
stestr run {posargs}
whitelist_externals =
stestr