From d6d331fa772da3774f1e687a81d64d9aef56f7ef Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Mon, 27 Oct 2014 11:44:31 -0700 Subject: [PATCH 1/7] Set default gitreview branch Change-Id: Ia6e458cda841cec9b7cce930bfcc8214fed07189 --- .gitreview | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitreview b/.gitreview index 6eb747d..9a7e823 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.openstack.org port=29418 project=openstack-dev/hacking.git +defaultbranch=0.9.x From 4e258c4222d1c9ff06213ba783035802e3bdbc46 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sat, 25 Oct 2014 11:08:45 -0500 Subject: [PATCH 2/7] Pin mccabe to prevent it from breaking hacking mccabe has undergone some very significant bug fixes recently but has not yet released a new version. When it does, complexity calculations will change in potentially significant ways. Cherry-picked onto 0.9.x to make sure a release of mccabe doesn't break existing 0.9.x users. Change-Id: I6e75391da19fde45588575517087d1ba4e4c44b7 (cherry picked from commit 7a649681f984f2a246eae23cd05d6973d14d5745) --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 38936b7..9a2b4c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,6 @@ pbr>=0.6,!=0.7,<1.0 pep8==1.5.6 pyflakes==0.8.1 flake8==2.1.0 +mccabe==0.2.1 six>=1.6.0 From b45ac441395f06399662963a04d84c84470e14a8 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 2 Dec 2014 12:51:53 -0500 Subject: [PATCH 3/7] Allow import redirections When we move modules out of namespace packages we set up redirects to import the new module under the old name. Python's import machinery doesn't detect those things as modules, and the names don't show up in sys.modules. However, if we look at what we actually got when we did the import we can see that it is a module. Change-Id: I4b42d081965b6d898b178cbe9232b47cfed17d8a (cherry picked from commit dd8b4d63331d435ff79e6f4a50b7f6cee384f9ba) --- hacking/checks/imports.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hacking/checks/imports.py b/hacking/checks/imports.py index a98cb00..729f311 100644 --- a/hacking/checks/imports.py +++ b/hacking/checks/imports.py @@ -11,6 +11,7 @@ # under the License. import imp +import inspect import os import re import sys @@ -100,7 +101,20 @@ def is_module_for_sure(mod, search_path=sys.path): else: # NOTE(imelnikov): we imported the thing; if it was module, # it must be there: - return mod in sys.modules + if mod in sys.modules: + return True + else: + # NOTE(dhellmann): If the thing isn't there under + # its own name, look to see if it is a module + # redirection import in one of the oslo libraries + # where we are moving things out of the namespace + # package. + pack_name, _sep, mod_name = mod.rpartition('.') + if pack_name in sys.modules: + the_mod = getattr(sys.modules[pack_name], + mod_name, None) + return inspect.ismodule(the_mod) + return False return True def is_module(mod): From 3af414c0c9e5c64cb764c0e131a876b22a0553cd Mon Sep 17 00:00:00 2001 From: Surojit Pathak Date: Wed, 3 Dec 2014 18:12:06 +0000 Subject: [PATCH 4/7] Fixing broken while loop in imports.py This commit is backporting commit 64ef5bf5. It could not be cherry-picked, as the unit test code had lot more dependent code to be pulled in. Issue: flake8 occasionally encounters "H302 import only modules." error even though the python module exists at the path and python shell is able to import the same. Root-cause: The while loop in is_module_for_sure() had a bug, where iterating variable, 'mod_name', was getting derived from the same input, 'mod', every time. It should have led to an infinite loop otherwise. But, an ImportError takes it out of the loop. Most of the cases, this is not an issue, if as part of the exception handler, built-in __import__() finds the module. The evidence of the issue is the availability of import statements suffixed with "# noqa" to work-around the bug. Fixing the while loop causes the logic to flow in the original path of the code to use 'imp.find_module()' Change-Id: I421a66242121b987b7c8c1568394478514073b87 --- hacking/checks/imports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hacking/checks/imports.py b/hacking/checks/imports.py index 729f311..d5f7c8b 100644 --- a/hacking/checks/imports.py +++ b/hacking/checks/imports.py @@ -73,7 +73,7 @@ def is_module_for_sure(mod, search_path=sys.path): try: mod_name = mod while '.' in mod_name: - pack_name, _sep, mod_name = mod.partition('.') + pack_name, _sep, mod_name = mod_name.partition('.') f, p, d = imp.find_module(pack_name, search_path) search_path = [p] imp.find_module(mod_name, search_path) From f63394c9a427bdad21bf219135eeb030c2e01145 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Mon, 18 May 2015 17:29:02 -0700 Subject: [PATCH 5/7] Bump pbr cap to <2.0 Hacking's pbr cap of <1.0 is breaking things (see bug for a lot more detail). Since projects are still using hacking 0.9.x bump the PBR cap to unbreak projects still on 0.9.x. Change-Id: I77f2b7e661c4de067e39596765d36a4463a2d143 Closes-Bug: #1456376 (cherry picked from commit bc4b1118e155784bc306c01733375ffec56b89b3) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9a2b4c3..1a872c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pbr>=0.6,!=0.7,<1.0 +pbr>=0.11,<2.0 pep8==1.5.6 pyflakes==0.8.1 From d987e18e6978b07f562a01d4b4dc060b05f03a9d Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Thu, 2 Mar 2017 17:32:33 +1100 Subject: [PATCH 6/7] Remove the PBR cap Unlike most of the other OpenStack projects hacking is not automatically syncronsed to projecst via the proposal-bot. My understanding of this is because new hacking tests could cause unexpected gate failures which it was automatically syncronised and/or did not always take into account project style. The downside of this is that we have alarge number of projects still using older hacking releases. This has come to a head with the release of pbr 2.0.0 which conflicts with 0.9.x and 0.10.x hacking branches. While it isn't possible to get all projecst up to the newest hacking it it is possible to remove the cap on PBR and allow project that still want older hacking releasee to work with the new PBR release. Change-Id: Iabf27cc0648c12c3c090f01facd15c3ec52a4861 Related-Bug: 1668848 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1a872c1..5c1610b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pbr>=0.11,<2.0 +pbr>=0.11 pep8==1.5.6 pyflakes==0.8.1 From ecc0e32844961247f3a494255c720a172393483a Mon Sep 17 00:00:00 2001 From: OpenDev Sysadmins Date: Fri, 19 Apr 2019 19:33:16 +0000 Subject: [PATCH 7/7] OpenDev Migration Patch This commit was bulk generated and pushed by the OpenDev sysadmins as a part of the Git hosting and code review systems migration detailed in these mailing list posts: http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html Attempts have been made to correct repository namespaces and hostnames based on simple pattern matching, but it's possible some were updated incorrectly or missed entirely. Please reach out to us via the contact information listed at https://opendev.org/ with any questions you may have. --- .gitreview | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitreview b/.gitreview index 9a7e823..842fcbb 100644 --- a/.gitreview +++ b/.gitreview @@ -1,5 +1,5 @@ [gerrit] -host=review.openstack.org +host=review.opendev.org port=29418 -project=openstack-dev/hacking.git +project=openstack/hacking.git defaultbranch=0.9.x