Browse Source

Update hacking version

Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I8bb814f8db8c87ba6b757be482d79d40548a137d
ZhijunWei 3 months ago
parent
commit
671cbd6024
5 changed files with 11 additions and 12 deletions
  1. 1
    1
      HACKING.rst
  2. 5
    7
      oslo_service/periodic_task.py
  3. 2
    2
      oslo_service/service.py
  4. 1
    1
      test-requirements.txt
  5. 2
    1
      tox.ini

+ 1
- 1
HACKING.rst View File

@@ -1,4 +1,4 @@
1 1
 oslo.service Style Commandments
2
-======================================================
2
+===============================
3 3
 
4 4
 Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/

+ 5
- 7
oslo_service/periodic_task.py View File

@@ -14,20 +14,18 @@
14 14
 import copy
15 15
 import logging
16 16
 import random
17
+import six
17 18
 import time
18 19
 
20
+from oslo_service._i18n import _
21
+from oslo_service import _options
22
+from oslo_utils import reflection
23
+
19 24
 if hasattr(time, 'monotonic'):
20 25
     now = time.monotonic
21 26
 else:
22 27
     from monotonic import monotonic as now  # noqa
23 28
 
24
-from oslo_utils import reflection
25
-import six
26
-
27
-from oslo_service._i18n import _
28
-from oslo_service import _options
29
-
30
-
31 29
 LOG = logging.getLogger(__name__)
32 30
 
33 31
 DEFAULT_INTERVAL = 60.0

+ 2
- 2
oslo_service/service.py View File

@@ -139,8 +139,8 @@ class SignalHandler(object):
139 139
         self._ignore_signals = ('SIG_DFL', 'SIG_IGN')
140 140
         self._signals_by_name = dict((name, getattr(signal, name))
141 141
                                      for name in dir(signal)
142
-                                     if name.startswith("SIG")
143
-                                     and name not in self._ignore_signals)
142
+                                     if name.startswith("SIG") and
143
+                                     name not in self._ignore_signals)
144 144
         self.signals_to_name = dict(
145 145
             (sigval, name)
146 146
             for (name, sigval) in self._signals_by_name.items())

+ 1
- 1
test-requirements.txt View File

@@ -3,7 +3,7 @@
3 3
 # process, which may cause wedges in the gate later.
4 4
 
5 5
 fixtures>=3.0.0 # Apache-2.0/BSD
6
-hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
6
+hacking>=1.1.0,<1.2.0 # Apache-2.0
7 7
 mock>=2.0.0 # BSD
8 8
 oslotest>=3.2.0 # Apache-2.0
9 9
 requests>=2.14.2 # Apache-2.0

+ 2
- 1
tox.ini View File

@@ -38,9 +38,10 @@ commands = python setup.py test --coverage --coverage-package-name=oslo_service
38 38
 
39 39
 [flake8]
40 40
 # E123, E125 skipped as they are invalid PEP-8.
41
+# E731 skipped as assign a lambda expression
41 42
 
42 43
 show-source = True
43
-ignore = E123,E125
44
+ignore = E123,E125,E731
44 45
 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
45 46
 
46 47
 [hacking]

Loading…
Cancel
Save