2012-01-31 15:27:29 -08:00
|
|
|
[tox]
|
2019-04-02 17:42:21 -07:00
|
|
|
envlist = py37,py27,pep8
|
2018-11-02 11:39:38 +05:30
|
|
|
minversion = 2.3.2
|
2013-12-09 13:56:10 +00:00
|
|
|
skipsdist = True
|
2012-01-31 15:27:29 -08:00
|
|
|
|
|
|
|
[testenv]
|
2013-12-09 13:56:10 +00:00
|
|
|
usedevelop = True
|
2019-03-22 10:23:36 -05:00
|
|
|
install_command = pip install -U {opts} {packages}
|
2012-06-08 19:59:26 -04:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2013-06-02 21:28:56 -04:00
|
|
|
NOSE_WITH_COVERAGE=1
|
|
|
|
NOSE_COVER_BRANCHES=1
|
2019-10-25 12:48:36 -07:00
|
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
2012-01-31 15:27:29 -08:00
|
|
|
deps =
|
2020-11-01 16:37:32 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2013-05-29 22:03:40 +08:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2020-12-04 10:49:45 -08:00
|
|
|
commands =
|
|
|
|
find {envdir} ( -type f -o -type l ) -name "*.py[co]" -delete
|
|
|
|
find {envdir} -type d -name "__pycache__" -delete
|
|
|
|
bash -ec "nosetests {posargs:test/unit} --with-id || nosetests --failed"
|
|
|
|
allowlist_externals =
|
|
|
|
bash
|
|
|
|
find
|
2015-06-02 19:51:39 +00:00
|
|
|
passenv = SWIFT_* *_proxy
|
2012-06-08 19:59:26 -04:00
|
|
|
|
2020-04-29 15:57:08 -05:00
|
|
|
[testenv:py27]
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/py2-constraints.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
|
2013-09-04 22:25:28 -04:00
|
|
|
[testenv:cover]
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
NOSE_WITH_COVERAGE=1
|
|
|
|
NOSE_COVER_BRANCHES=1
|
|
|
|
NOSE_COVER_HTML=1
|
|
|
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
|
|
|
|
2012-01-31 15:27:29 -08:00
|
|
|
[testenv:pep8]
|
2012-05-03 18:33:05 -07:00
|
|
|
commands =
|
2016-03-08 10:57:56 -06:00
|
|
|
flake8 {posargs:swift test doc setup.py}
|
2021-02-01 13:26:53 -08:00
|
|
|
flake8 --filename=bin/swift* bin
|
2019-03-29 17:18:49 -07:00
|
|
|
python ./setup.py check --restructuredtext --strict
|
2016-09-02 15:00:00 +02:00
|
|
|
bandit -c bandit.yaml -r swift -n 5
|
2018-09-14 17:44:38 -06:00
|
|
|
./.manpages {posargs}
|
2012-01-31 15:27:29 -08:00
|
|
|
|
2019-03-01 12:43:42 -08:00
|
|
|
[testenv:func-py3]
|
|
|
|
basepython = python3
|
py3: Finish porting func tests
We were (indirectly) importing swiftclient (and therefore requests and
urllib3) before doing our eventlet monkey-patching. This would lead
boto3 (which digs an SSLContext out of urllib3) to trip RecursionErrors
on py3 similar to
>>> from ssl import SSLContext, PROTOCOL_SSLv23
>>> import eventlet
>>> eventlet.monkey_patch(socket=True)
>>> SSLContext(PROTOCOL_SSLv23).options |= 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 330 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
Change-Id: I4bb59edd87336597791416c4f2a096efe0e72fe3
2019-08-07 16:16:57 -07:00
|
|
|
commands = ./.functests {posargs}
|
2019-03-01 12:43:42 -08:00
|
|
|
|
2019-03-22 14:48:10 -07:00
|
|
|
[testenv:func-ec-py3]
|
|
|
|
basepython = python3
|
py3: Finish porting func tests
We were (indirectly) importing swiftclient (and therefore requests and
urllib3) before doing our eventlet monkey-patching. This would lead
boto3 (which digs an SSLContext out of urllib3) to trip RecursionErrors
on py3 similar to
>>> from ssl import SSLContext, PROTOCOL_SSLv23
>>> import eventlet
>>> eventlet.monkey_patch(socket=True)
>>> SSLContext(PROTOCOL_SSLv23).options |= 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 330 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
Change-Id: I4bb59edd87336597791416c4f2a096efe0e72fe3
2019-08-07 16:16:57 -07:00
|
|
|
commands = ./.functests {posargs}
|
2019-03-22 14:48:10 -07:00
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec
|
2019-03-26 13:02:24 -07:00
|
|
|
|
2019-08-06 10:00:41 -07:00
|
|
|
[testenv:func-encryption-py3]
|
|
|
|
basepython = python3
|
py3: Finish porting func tests
We were (indirectly) importing swiftclient (and therefore requests and
urllib3) before doing our eventlet monkey-patching. This would lead
boto3 (which digs an SSLContext out of urllib3) to trip RecursionErrors
on py3 similar to
>>> from ssl import SSLContext, PROTOCOL_SSLv23
>>> import eventlet
>>> eventlet.monkey_patch(socket=True)
>>> SSLContext(PROTOCOL_SSLv23).options |= 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
File "/usr/lib/python3.6/ssl.py", line 465, in options
super(SSLContext, SSLContext).options.__set__(self, value)
[Previous line repeated 330 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
Change-Id: I4bb59edd87336597791416c4f2a096efe0e72fe3
2019-08-07 16:16:57 -07:00
|
|
|
commands = ./.functests {posargs}
|
2019-08-06 10:00:41 -07:00
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=encryption
|
|
|
|
|
2019-11-05 01:45:26 +00:00
|
|
|
[testenv:func]
|
|
|
|
basepython = python2.7
|
2020-04-29 15:57:08 -05:00
|
|
|
deps = {[testenv:py27]deps}
|
2019-11-05 01:45:26 +00:00
|
|
|
commands = ./.functests {posargs}
|
|
|
|
|
2016-11-19 23:24:30 +01:00
|
|
|
[testenv:func-encryption]
|
2019-11-05 01:45:26 +00:00
|
|
|
basepython = python2.7
|
2020-04-29 15:57:08 -05:00
|
|
|
deps = {[testenv:py27]deps}
|
2016-07-25 22:07:15 -05:00
|
|
|
commands = ./.functests {posargs}
|
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=encryption
|
|
|
|
|
2017-03-07 19:22:01 +00:00
|
|
|
[testenv:func-ec]
|
2019-11-05 01:45:26 +00:00
|
|
|
basepython = python2.7
|
2020-04-29 15:57:08 -05:00
|
|
|
deps = {[testenv:py27]deps}
|
2017-03-07 19:22:01 +00:00
|
|
|
commands = ./.functests {posargs}
|
|
|
|
setenv = SWIFT_TEST_IN_PROCESS=1
|
|
|
|
SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec
|
|
|
|
|
2012-03-16 01:23:39 -07:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
2013-04-28 18:32:12 -07:00
|
|
|
|
2014-08-05 00:59:54 -04:00
|
|
|
[testenv:docs]
|
2019-03-29 16:14:58 -07:00
|
|
|
basepython = python3
|
2020-11-11 18:30:27 +08:00
|
|
|
deps =
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-03-11 16:27:28 +00:00
|
|
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
2014-08-05 00:59:54 -04:00
|
|
|
|
2016-05-04 02:00:53 +00:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
2019-07-22 18:53:40 +02:00
|
|
|
# the API Ref to docs.openstack.org.
|
2019-03-29 16:06:31 -07:00
|
|
|
basepython = python3
|
2018-03-11 16:27:28 +00:00
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
2020-12-04 10:49:45 -08:00
|
|
|
allowlist_externals =
|
|
|
|
rm
|
2016-05-04 02:00:53 +00:00
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2015-06-27 23:26:47 +05:30
|
|
|
[testenv:bandit]
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2016-09-02 09:52:17 -07:00
|
|
|
commands = bandit -c bandit.yaml -r swift -n 5
|
2015-06-27 23:26:47 +05:30
|
|
|
|
2013-04-28 18:32:12 -07:00
|
|
|
[flake8]
|
2015-07-27 11:34:07 +02:00
|
|
|
# it's not a bug that we aren't using all of hacking, ignore:
|
|
|
|
# H101: Use TODO(NAME)
|
|
|
|
# H202: assertRaises Exception too broad
|
|
|
|
# H301: one import per line
|
|
|
|
# H306: imports not in alphabetical order (time, os)
|
|
|
|
# H404: multi line docstring should start without a leading new line
|
|
|
|
# H405: multi line docstring summary not separated with an empty line
|
|
|
|
# H501: Do not use self.__dict__ for string formatting
|
2020-04-03 10:53:34 +02:00
|
|
|
# Disabled with going to hacking 2.0, needs further investigation and
|
|
|
|
# changes to enable:
|
|
|
|
# E402: module level import not at top of file
|
|
|
|
# E731 do not assign a lambda expression, use a def
|
2020-05-13 00:24:08 -07:00
|
|
|
# E741 ambiguous variable name
|
2020-04-03 10:53:34 +02:00
|
|
|
# Swift team needs to decide if they want to enable either of these:
|
|
|
|
# W503: line break before binary operator
|
|
|
|
# W504: line break after binary operator
|
2020-05-13 00:24:08 -07:00
|
|
|
ignore = H101,H202,H301,H306,H404,H405,H501,W503,W504,E402,E731,E741
|
2016-03-04 15:19:39 -06:00
|
|
|
exclude = .venv,.tox,dist,*egg
|
2016-07-07 17:58:58 +00:00
|
|
|
filename = *.py,bin/*
|
2013-04-28 18:32:12 -07:00
|
|
|
show-source = True
|
2016-03-28 18:21:22 +02:00
|
|
|
|
|
|
|
[testenv:bindep]
|
|
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
|
|
# separately, outside of the requirements files.
|
2018-09-14 17:44:38 -06:00
|
|
|
skip_install = True
|
2016-03-28 18:21:22 +02:00
|
|
|
deps = bindep
|
2020-11-05 12:00:04 +00:00
|
|
|
commands = bindep test doc
|
2016-10-03 17:18:22 -07:00
|
|
|
|
|
|
|
[testenv:releasenotes]
|
2019-03-29 17:18:49 -07:00
|
|
|
basepython = python3
|
2020-11-11 18:30:27 +08:00
|
|
|
deps =
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2016-10-03 17:18:22 -07:00
|
|
|
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2018-03-22 18:54:29 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
# FIXME(dhellmann): We'll want to uncomment this
|
|
|
|
# when the full test suite works with python 3.
|
|
|
|
# basepython = python3
|
2019-11-01 09:57:34 +02:00
|
|
|
basepython = python2.7
|
2018-03-22 18:54:29 -04:00
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2019-09-04 14:30:33 +10:00
|
|
|
|
|
|
|
[testenv:pdf-docs]
|
|
|
|
basepython = python3
|
|
|
|
deps = {[testenv:docs]deps}
|
2020-12-04 10:49:45 -08:00
|
|
|
allowlist_externals =
|
2019-09-04 14:30:33 +10:00
|
|
|
make
|
|
|
|
commands =
|
|
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
|
|
make -C doc/build/pdf
|