summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2015-01-28 06:57:06 -0800
committerMonty Taylor <mordred@inaugust.com>2015-02-03 17:05:30 -0500
commit1457aafa6095da4e33a6eb0a52218f077d991a67 (patch)
tree44ed6690b91bb1d4003b50a3b486c081a832ba71
parentaef4f7ef4faec987d553d1ca40b55951235af0b1 (diff)
Support script text override for newer develop0.10.8feature/0.10
setuptools > 12 has a new flow for writing out generated script text. It's nicer, actually, because it means we can just subclass and extend one method instead of monekypatching. Closes-Bug: 1415106 Change-Id: I56e7bea60df8a59d859575d426ce93c45ffee314
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Jeremy Stanley <fungi@yuggoth.org> Workflow+1: Jeremy Stanley <fungi@yuggoth.org> Submitted-by: Jenkins Submitted-at: Mon, 02 Mar 2015 17:27:24 +0000 Reviewed-on: https://review.openstack.org/152691 Project: openstack-dev/pbr Branch: refs/heads/feature/0.10
-rw-r--r--pbr/hooks/commands.py1
-rw-r--r--pbr/packaging.py13
-rw-r--r--tools/integration.sh7
3 files changed, 21 insertions, 0 deletions
diff --git a/pbr/hooks/commands.py b/pbr/hooks/commands.py
index 3033119..e8b0c3f 100644
--- a/pbr/hooks/commands.py
+++ b/pbr/hooks/commands.py
@@ -43,6 +43,7 @@ class CommandsConfig(base.BaseConfig):
43 self.add_command('pbr.packaging.LocalEggInfo') 43 self.add_command('pbr.packaging.LocalEggInfo')
44 self.add_command('pbr.packaging.LocalSDist') 44 self.add_command('pbr.packaging.LocalSDist')
45 self.add_command('pbr.packaging.LocalInstallScripts') 45 self.add_command('pbr.packaging.LocalInstallScripts')
46 self.add_command('pbr.packaging.LocalDevelop')
46 if os.name != 'nt': 47 if os.name != 'nt':
47 easy_install.get_script_args = packaging.override_get_script_args 48 easy_install.get_script_args = packaging.override_get_script_args
48 49
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 9a8f1c5..592ad32 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -30,6 +30,7 @@ import sys
30from distutils.command import install as du_install 30from distutils.command import install as du_install
31from distutils import log 31from distutils import log
32import pkg_resources 32import pkg_resources
33from setuptools.command import develop
33from setuptools.command import easy_install 34from setuptools.command import easy_install
34from setuptools.command import egg_info 35from setuptools.command import egg_info
35from setuptools.command import install 36from setuptools.command import install
@@ -321,6 +322,18 @@ def override_get_script_args(
321 yield (name, header + script_text) 322 yield (name, header + script_text)
322 323
323 324
325class LocalDevelop(develop.develop):
326
327 command_name = 'develop'
328
329 def install_wrapper_scripts(self, dist):
330 if sys.platform == 'win32':
331 return develop.develop.install_wrapper_scripts(self, dist)
332 if not self.exclude_scripts:
333 for args in override_get_script_args(dist):
334 self.write_script(*args)
335
336
324class LocalInstallScripts(install_scripts.install_scripts): 337class LocalInstallScripts(install_scripts.install_scripts):
325 """Intercepts console scripts entry_points.""" 338 """Intercepts console scripts entry_points."""
326 command_name = 'install_scripts' 339 command_name = 'install_scripts'
diff --git a/tools/integration.sh b/tools/integration.sh
index 58ffac8..6f79541 100644
--- a/tools/integration.sh
+++ b/tools/integration.sh
@@ -80,6 +80,13 @@ eppbrdir=$tmpdir/eppbrdir
80git clone $REPODIR/pbr $eppbrdir 80git clone $REPODIR/pbr $eppbrdir
81$epvenv/bin/pip install -e $eppbrdir 81$epvenv/bin/pip install -e $eppbrdir
82 82
83# First check develop
84PBR_VERSION=0.0 $epvenv/bin/python setup.py develop
85cat $epvenv/bin/test_cmd
86grep 'PBR Generated' $epvenv/bin/test_cmd
87PBR_VERSION=0.0 $epvenv/bin/python setup.py develop --uninstall
88
89# Now check install
83PBR_VERSION=0.0 $epvenv/bin/python setup.py install 90PBR_VERSION=0.0 $epvenv/bin/python setup.py install
84cat $epvenv/bin/test_cmd 91cat $epvenv/bin/test_cmd
85grep 'PBR Generated' $epvenv/bin/test_cmd 92grep 'PBR Generated' $epvenv/bin/test_cmd