Isolate docs requirements
...since modern sphinx won't install on py27. While we're at it, clean up some warnings and treat warnings as errors. Also, fix up how we parse test configs so we can run func tests. Related-Change: Id3c2ed87230c5918c18e2c01d086df8157f036b1 Change-Id: I3718f69610545b0dbcb0a2ab45b400da3a45682c
This commit is contained in:
parent
b52c13f648
commit
113eacf3b8
5
doc/requirements.txt
Normal file
5
doc/requirements.txt
Normal file
@ -0,0 +1,5 @@
|
||||
keystoneauth1>=3.4.0 # Apache-2.0
|
||||
sphinx!=1.6.6,!=1.6.7,<2.0.0,>=1.6.2;python_version=='2.7' # BSD
|
||||
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
|
||||
reno>=2.5.0 # Apache-2.0
|
||||
openstackdocstheme>=1.18.1 # Apache-2.0
|
0
doc/source/_static/.gitignore
vendored
Normal file
0
doc/source/_static/.gitignore
vendored
Normal file
@ -175,6 +175,14 @@ class ConnectionThreadPoolExecutor(ThreadPoolExecutor):
|
||||
super(ConnectionThreadPoolExecutor, self).__init__(max_workers)
|
||||
|
||||
def submit(self, fn, *args, **kwargs):
|
||||
"""
|
||||
Schedules the callable, `fn`, to be executed
|
||||
|
||||
:param fn: the callable to be invoked
|
||||
:param args: the positional arguments for the callable
|
||||
:param kwargs: the keyword arguments for the callable
|
||||
:returns: a Future object representing the execution of the callable
|
||||
"""
|
||||
def conn_fn():
|
||||
priority = None
|
||||
conn = None
|
||||
|
@ -74,7 +74,7 @@ def generate_temp_url(path, seconds, key, method, absolute=False,
|
||||
Swift object.
|
||||
|
||||
:param path: The full path to the Swift object or prefix if
|
||||
a prefix-based temporary URL should be generated. Example:
|
||||
a prefix-based temporary URL should be generated. Example:
|
||||
/v1/AUTH_account/c/o or /v1/AUTH_account/c/prefix.
|
||||
:param seconds: time in seconds or ISO 8601 timestamp.
|
||||
If absolute is False and this is the string representation of an
|
||||
|
@ -3,7 +3,4 @@ hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
keystoneauth1>=3.4.0 # Apache-2.0
|
||||
mock>=1.2.0 # BSD
|
||||
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
reno>=2.5.0 # Apache-2.0
|
||||
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||
|
@ -46,11 +46,34 @@ class TestFunctional(unittest.TestCase):
|
||||
config.read(config_file)
|
||||
self.config = config
|
||||
if config.has_section('func_test'):
|
||||
auth_host = config.get('func_test', 'auth_host')
|
||||
auth_port = config.getint('func_test', 'auth_port')
|
||||
auth_ssl = config.getboolean('func_test', 'auth_ssl')
|
||||
auth_prefix = config.get('func_test', 'auth_prefix')
|
||||
self.auth_version = config.get('func_test', 'auth_version')
|
||||
if config.has_option('func_test', 'auth_uri'):
|
||||
self.auth_url = config.get('func_test', 'auth_uri')
|
||||
try:
|
||||
self.auth_version = config.get('func_test', 'auth_version')
|
||||
except configparser.NoOptionError:
|
||||
last_piece = self.auth_url.rstrip('/').rsplit('/', 1)[1]
|
||||
if last_piece.endswith('.0'):
|
||||
last_piece = last_piece[:-2]
|
||||
if last_piece in ('1', '2', '3'):
|
||||
self.auth_version = last_piece
|
||||
else:
|
||||
raise
|
||||
else:
|
||||
auth_host = config.get('func_test', 'auth_host')
|
||||
auth_port = config.getint('func_test', 'auth_port')
|
||||
auth_ssl = config.getboolean('func_test', 'auth_ssl')
|
||||
auth_prefix = config.get('func_test', 'auth_prefix')
|
||||
self.auth_version = config.get('func_test', 'auth_version')
|
||||
self.auth_url = ""
|
||||
if auth_ssl:
|
||||
self.auth_url += "https://"
|
||||
else:
|
||||
self.auth_url += "http://"
|
||||
self.auth_url += "%s:%s%s" % (
|
||||
auth_host, auth_port, auth_prefix)
|
||||
if self.auth_version == "1":
|
||||
self.auth_url += 'v1.0'
|
||||
|
||||
try:
|
||||
self.account_username = config.get('func_test',
|
||||
'account_username')
|
||||
@ -59,15 +82,6 @@ class TestFunctional(unittest.TestCase):
|
||||
username = config.get('func_test', 'username')
|
||||
self.account_username = "%s:%s" % (account, username)
|
||||
self.password = config.get('func_test', 'password')
|
||||
self.auth_url = ""
|
||||
if auth_ssl:
|
||||
self.auth_url += "https://"
|
||||
else:
|
||||
self.auth_url += "http://"
|
||||
self.auth_url += "%s:%s%s" % (auth_host, auth_port, auth_prefix)
|
||||
if self.auth_version == "1":
|
||||
self.auth_url += 'v1.0'
|
||||
|
||||
else:
|
||||
self.skip_tests = True
|
||||
|
||||
|
6
tox.ini
6
tox.ini
@ -65,8 +65,10 @@ commands = {[testenv:func]commands}
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3
|
||||
usedevelop = False
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
commands=
|
||||
python setup.py build_sphinx
|
||||
python setup.py build_sphinx -W
|
||||
|
||||
[flake8]
|
||||
# it's not a bug that we aren't using all of hacking, ignore:
|
||||
@ -96,6 +98,8 @@ commands = bindep test
|
||||
|
||||
[testenv:releasenotes]
|
||||
basepython = python3
|
||||
usedevelop = False
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
[testenv:lower-constraints]
|
||||
|
Loading…
Reference in New Issue
Block a user