Browse Source

add in-repo zuul config

This patch adds the zuul config and tox.ini updates to support
in-repo config for zuul v3.

Change-Id: I0cf5b5fdef72887c6bd81084937b120d82d4f1a4
changes/32/668932/4
Boden R 2 months ago
parent
commit
9a2bc89574
5 changed files with 55 additions and 14 deletions
  1. 5
    0
      .zuul.yaml
  2. 30
    0
      bindep.txt
  3. 1
    1
      test-requirements.txt
  4. 18
    12
      tox.ini
  5. 1
    1
      vmware_nsxlib/v3/exceptions.py

+ 5
- 0
.zuul.yaml View File

@@ -0,0 +1,5 @@
1
+- project:
2
+    templates:
3
+      - openstack-python-jobs
4
+      - openstack-python36-jobs
5
+      - check-requirements

+ 30
- 0
bindep.txt View File

@@ -0,0 +1,30 @@
1
+# This file contains runtime (non-python) dependencies
2
+# More info at: http://docs.openstack.org/infra/bindep/readme.html
3
+
4
+# tools/misc-sanity-checks.sh validates .po[t] files
5
+gettext [test]
6
+
7
+# cffi (required by oslo.privsep) and PyNaCL (required by paramiko)
8
+libffi-dev [platform:dpkg]
9
+libffi-devel [platform:rpm]
10
+
11
+# MySQL and PostgreSQL databases since some jobs are set up in
12
+# OpenStack infra that need these like
13
+# periodic-neutron-py27-with-oslo-master and
14
+# periodic-neutron-py35-with-neutron-lib-master.
15
+haproxy
16
+libmysqlclient-dev [platform:dpkg test]
17
+mysql [platform:rpm test]
18
+mysql-client [platform:dpkg test]
19
+mysql-devel [platform:rpm test]
20
+mysql-server [test]
21
+postgresql [test]
22
+postgresql-client [platform:dpkg test]
23
+postgresql-devel [platform:rpm test]
24
+postgresql-server [platform:rpm test]
25
+
26
+# Neutron's test-requirements requires tempest which requires paramiko
27
+# which requires cryptography which requires ssl.
28
+libssl-dev [platform:dpkg]
29
+openssl-devel [platform:rpm !platform:suse]
30
+libopenssl-devel [platform:suse !platform:rpm]

+ 1
- 1
test-requirements.txt View File

@@ -2,7 +2,7 @@
2 2
 # of appearance. Changing the order has an impact on the overall integration
3 3
 # process, which may cause wedges in the gate later.
4 4
 
5
-hacking<0.12,>=0.11.0 # Apache-2.0
5
+hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
6 6
 
7 7
 coverage!=4.4,>=4.0 # Apache-2.0
8 8
 fixtures>=3.0.0 # Apache-2.0/BSD

+ 18
- 12
tox.ini View File

@@ -1,17 +1,16 @@
1 1
 [tox]
2
-envlist = py35,py27,pep8,docs
2
+envlist = py36,py27,pep8,docs
3 3
 minversion = 2.0
4 4
 skipsdist = True
5 5
 
6 6
 [testenv]
7
-install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?stable/queens} {opts} {packages}
7
+install_command = pip install {opts} {packages}
8 8
 setenv = VIRTUAL_ENV={envdir}
9
-         BRANCH_NAME=master
10
-         CLIENT_NAME=vmware-nsxlib
11 9
          PYTHONWARNINGS=default::DeprecationWarning
12 10
 passenv = TRACE_FAILONLY GENERATE_HASHES http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
13 11
 usedevelop = True
14
-deps = -r{toxinidir}/requirements.txt
12
+deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/queens}
13
+       -r{toxinidir}/requirements.txt
15 14
        -r{toxinidir}/test-requirements.txt
16 15
 whitelist_externals = sh
17 16
 commands =
@@ -27,7 +26,7 @@ setenv = {[testenv]setenv}
27 26
 commands = false
28 27
 
29 28
 [testenv:functional]
30
-basepython = python2.7
29
+basepython = python3
31 30
 setenv = {[testenv]setenv}
32 31
          {[testenv:common]setenv}
33 32
          OS_TEST_PATH=./vmware_nsxlib/tests/functional
@@ -37,7 +36,7 @@ deps =
37 36
   -r{toxinidir}/vmware_nsxlib/tests/functional/requirements.txt
38 37
 
39 38
 [testenv:dsvm-functional]
40
-basepython = python2.7
39
+basepython = python3
41 40
 setenv = {[testenv]setenv}
42 41
          OS_SUDO_TESTING=1
43 42
          OS_FAIL_ON_MISSING_DEPS=1
@@ -54,7 +53,7 @@ sitepackages = True
54 53
 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
55 54
 
56 55
 [testenv:pep8]
57
-basepython = python2.7
56
+basepython = python3
58 57
 deps =
59 58
   {[testenv]deps}
60 59
 commands =
@@ -66,10 +65,12 @@ whitelist_externals =
66 65
     bash
67 66
 
68 67
 [testenv:bandit]
69
-deps = -r{toxinidir}/test-requirements.txt
68
+deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/queens}
69
+       -r{toxinidir}/test-requirements.txt
70 70
 commands = bandit -r vmware_nsxlib -n 5 -ll
71 71
 
72 72
 [testenv:cover]
73
+basepython = python3
73 74
 commands =
74 75
   python setup.py test --coverage --coverage-package-name=vmware_nsxlib --testr-args='{posargs}'
75 76
   coverage report
@@ -78,17 +79,22 @@ commands =
78 79
 commands = {posargs}
79 80
 
80 81
 [testenv:docs]
81
-commands = sphinx-build -W -b html doc/source doc/build/html
82
+basepython = python3
83
+deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/queens}
84
+       -r{toxinidir}/requirements.txt
85
+commands = sphinx-build -b html doc/source doc/build/html
82 86
 
83 87
 [flake8]
84 88
 # E125 continuation line does not distinguish itself from next logical line
85 89
 # E129 visually indented line with same indent as next logical line
90
+# E741 ambiguous variable name
86 91
 # N530 direct neutron imports not allowed
92
+# W504 line break after binary operator
87 93
 # N531 translations hints
88
-ignore = N530,E125,E129,N531
94
+ignore = N530,E125,E129,E741,N531,W504
89 95
 show-source = true
90 96
 builtins = _
91
-exclude = build,dist
97
+exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
92 98
 import-order-style = pep8
93 99
 
94 100
 [hacking]

+ 1
- 1
vmware_nsxlib/v3/exceptions.py View File

@@ -42,7 +42,7 @@ class NsxLibException(Exception):
42 42
 
43 43
     if six.PY2:
44 44
         def __unicode__(self):
45
-            return unicode(self.msg)
45
+            return unicode(self.msg) if six.PY2 else self.msg  # noqa
46 46
 
47 47
     def __str__(self):
48 48
         return self.msg

Loading…
Cancel
Save