Remove the need to specify the pbr hook
If you're running pbr codepaths, you want the hook. There is no need to say "pbr=True" in setup.py and then to list the hook in setup.cfg now that d2to1 is in the tree. Change-Id: Ie33d3e08d5a4133f5caf2613859919ce4f02c4a0
This commit is contained in:
parent
71bea435b6
commit
c84876dc0f
@ -124,9 +124,6 @@ A simple sample can be found in pbr s own setup.cfg
|
|||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
oslo
|
oslo
|
||||||
[hooks]
|
|
||||||
setup-hooks =
|
|
||||||
pbr.hooks.setup_hook
|
|
||||||
|
|
||||||
The minimal setup.py should look something like this::
|
The minimal setup.py should look something like this::
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ class BaseTestCase(testtools.TestCase, testresources.ResourcedTestCase):
|
|||||||
|
|
||||||
self.useFixture(fixtures.NestedTempfile())
|
self.useFixture(fixtures.NestedTempfile())
|
||||||
self.useFixture(fixtures.FakeLogger())
|
self.useFixture(fixtures.FakeLogger())
|
||||||
|
self.useFixture(fixtures.EnvironmentVariable('PBR_VERSION', '0.0'))
|
||||||
|
|
||||||
self.temp_dir = self.useFixture(fixtures.TempDir()).path
|
self.temp_dir = self.useFixture(fixtures.TempDir()).path
|
||||||
self.package_dir = os.path.join(self.temp_dir, 'testpackage')
|
self.package_dir = os.path.join(self.temp_dir, 'testpackage')
|
||||||
|
@ -77,6 +77,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
import ConfigParser as configparser
|
import ConfigParser as configparser
|
||||||
|
|
||||||
|
import pbr.hooks
|
||||||
|
|
||||||
# A simplified RE for this; just checks that the line ends with version
|
# A simplified RE for this; just checks that the line ends with version
|
||||||
# predicates in ()
|
# predicates in ()
|
||||||
@ -219,7 +220,9 @@ def cfg_to_args(path='setup.cfg'):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if setup_hooks:
|
if setup_hooks:
|
||||||
setup_hooks = split_multiline(setup_hooks)
|
setup_hooks = [
|
||||||
|
hook for hook in split_multiline(setup_hooks)
|
||||||
|
if hook != 'pbr.hook.setup_hook']
|
||||||
for hook in setup_hooks:
|
for hook in setup_hooks:
|
||||||
hook_fn = resolve_name(hook)
|
hook_fn = resolve_name(hook)
|
||||||
try :
|
try :
|
||||||
@ -233,6 +236,9 @@ def cfg_to_args(path='setup.cfg'):
|
|||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Run the pbr hook
|
||||||
|
pbr.hooks.setup_hook(config)
|
||||||
|
|
||||||
kwargs = setup_cfg_to_setup_kwargs(config)
|
kwargs = setup_cfg_to_setup_kwargs(config)
|
||||||
|
|
||||||
# Set default config overrides
|
# Set default config overrides
|
||||||
|
Loading…
x
Reference in New Issue
Block a user