Browse Source

add local tox targets for pep8 and py27

This patch adds local tox targets for pep8 and python 2.7 as per [1]
that will install dependencies in editable mode.
To run them use the pep8-dev and py27-dev targets respectively.

Py3 support is still needed, but it appears there's lots of work
to do in this code before it'll run successfully.

[1] https://etherpad.openstack.org/p/neutron-sibling-setup

Partial-Bug: 1800186

Change-Id: If65fb3494ca7453005be1526a5178ff2f581938e
Boden R 5 months ago
parent
commit
8c7b6b429a
4 changed files with 31 additions and 3 deletions
  1. 6
    1
      networking_bigswitch/__init__.py
  2. 3
    0
      requirements.txt
  3. 2
    1
      test-requirements.txt
  4. 20
    1
      tox.ini

+ 6
- 1
networking_bigswitch/__init__.py View File

@@ -14,6 +14,11 @@
14 14
 #    under the License.
15 15
 
16 16
 import gettext
17
+import six
17 18
 
18 19
 
19
-gettext.install('neutron', unicode=1)
20
+if six.PY2:
21
+    # E1123: unexpected keyword argument
22
+    gettext.install('neutron', unicode=1)  # pylint: disable=E1123
23
+else:
24
+    gettext.install('neutron')

+ 3
- 0
requirements.txt View File

@@ -3,8 +3,11 @@
3 3
 # setup the requirements. If any packages are added that are
4 4
 # specific to bsnstack lib, put them here.
5 5
 
6
+six>=1.10.0 # MIT
7
+
6 8
 # These repos are installed from git in OpenStack CI if the job
7 9
 # configures them as required-projects:
10
+neutron>=12.0.0 # Apache-2.0
8 11
 tap-as-a-service>=3.0.0 # Apache-2.0
9 12
 
10 13
 # The comment below indicates this project repo is current with neutron-lib

+ 2
- 1
test-requirements.txt View File

@@ -3,12 +3,12 @@
3 3
 # process, which may cause wedges in the gate later.
4 4
 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
5 5
 
6
--e git+https://git.openstack.org/openstack/neutron.git@master#egg=neutron
7 6
 cliff>=1.7.0  # Apache-2.0
8 7
 coverage>=3.6 # Apache-2.0
9 8
 discover # BSD
10 9
 mock>=1.0 # BSD
11 10
 fixtures>=1.3.1 # BSD + Apache
11
+flake8-import-order==0.12 # LGPLv3
12 12
 python-subunit>=0.0.18 # BSD + Apache-2.0
13 13
 requests-mock>=0.5.1  # Apache-2.0
14 14
 sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD
@@ -23,3 +23,4 @@ oslotest>=1.2.0  # Apache-2.0
23 23
 tempest>=17.1.0  # Apache-2.0
24 24
 babel!=2.4.0,>=2.3.4 # BSD
25 25
 stestr>=1.0.0 # Apache-2.0
26
+pylint==1.7.6 # GPLv2

+ 20
- 1
tox.ini View File

@@ -13,7 +13,6 @@ install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.opens
13 13
 deps = -r{toxinidir}/requirements.txt
14 14
        -r{toxinidir}/test-requirements.txt
15 15
 commands =
16
-  dsvm-functional: {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envbindir}
17 16
   stestr run {posargs}
18 17
   stestr slowest
19 18
 
@@ -21,6 +20,8 @@ commands =
21 20
 deps =
22 21
   {[testenv]deps}
23 22
   -r{toxinidir}/networking_bigswitch/tests/functional/requirements.txt
23
+commands =
24
+  {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envbindir}
24 25
 
25 26
 [testenv:hashtest]
26 27
 # This is the same as default environment, but with a random PYTHONHASHSEED.
@@ -78,3 +79,21 @@ commands =
78 79
 [hacking]
79 80
 import_exceptions = neutron._i18n
80 81
 local-check-factory = neutron_lib.hacking.checks.factory
82
+
83
+[testenv:dev]
84
+# run locally (not in the gate) using editable mode
85
+# https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
86
+commands =
87
+    pip install -q -e "git+https://git.openstack.org/openstack/tap-as-a-service#egg=tap_as_a_service"
88
+    pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
89
+
90
+[testenv:py27-dev]
91
+basepython = python2.7
92
+commands =
93
+    {[testenv:dev]commands}
94
+    {[testenv]commands}
95
+
96
+[testenv:pep8-dev]
97
+commands =
98
+    {[testenv:dev]commands}
99
+    {[testenv:pep8]commands}

Loading…
Cancel
Save