[libvirt] [libvirt-python] Use user requested python binary for setup.py

When setup.py is kicked off with a python interpreter other than the system 'python', (e.g. python2.7 setup.py build) the build process would switch to 'python' and not use python2.7 as requested by the user. We should always respect the user requested python interpreter and use it. --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index ecbce1f..24d4cf2 100755 --- a/setup.py +++ b/setup.py @@ -122,10 +122,10 @@ class my_build(build): def run(self): apis = get_api_xml_files() - self.spawn(["python", "generator.py", "libvirt", apis[0]]) - self.spawn(["python", "generator.py", "libvirt-qemu", apis[1]]) + self.spawn([sys.executable, "generator.py", "libvirt", apis[0]]) + self.spawn([sys.executable, "generator.py", "libvirt-qemu", apis[1]]) if have_libvirt_lxc: - self.spawn(["python", "generator.py", "libvirt-lxc", apis[2]]) + self.spawn([sys.executable, "generator.py", "libvirt-lxc", apis[2]]) build.run(self) @@ -267,7 +267,7 @@ class my_test(Command): apis = get_api_xml_files() - self.spawn(["python", "sanitytest.py", self.build_platlib, apis[0]]) + self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]]) class my_clean(clean): -- 1.8.3.2

On 12/03/2013 10:11 AM, Doug Goldstein wrote:
When setup.py is kicked off with a python interpreter other than the system 'python', (e.g. python2.7 setup.py build) the build process would switch to 'python' and not use python2.7 as requested by the user. We should always respect the user requested python interpreter and use it. --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ACK -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, Dec 3, 2013 at 11:23 AM, Eric Blake <eblake@redhat.com> wrote:
On 12/03/2013 10:11 AM, Doug Goldstein wrote:
When setup.py is kicked off with a python interpreter other than the system 'python', (e.g. python2.7 setup.py build) the build process would switch to 'python' and not use python2.7 as requested by the user. We should always respect the user requested python interpreter and use it. --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ACK
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Thanks. Pushed and reworded the subject to: setup: Use user requested python binary To better match the style of our commits. -- Doug Goldstein

On Tue, Dec 03, 2013 at 11:11:18AM -0600, Doug Goldstein wrote:
When setup.py is kicked off with a python interpreter other than the system 'python', (e.g. python2.7 setup.py build) the build process would switch to 'python' and not use python2.7 as requested by the user. We should always respect the user requested python interpreter and use it. --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/setup.py b/setup.py index ecbce1f..24d4cf2 100755 --- a/setup.py +++ b/setup.py @@ -122,10 +122,10 @@ class my_build(build): def run(self): apis = get_api_xml_files()
- self.spawn(["python", "generator.py", "libvirt", apis[0]]) - self.spawn(["python", "generator.py", "libvirt-qemu", apis[1]]) + self.spawn([sys.executable, "generator.py", "libvirt", apis[0]]) + self.spawn([sys.executable, "generator.py", "libvirt-qemu", apis[1]]) if have_libvirt_lxc: - self.spawn(["python", "generator.py", "libvirt-lxc", apis[2]]) + self.spawn([sys.executable, "generator.py", "libvirt-lxc", apis[2]])
build.run(self)
@@ -267,7 +267,7 @@ class my_test(Command):
apis = get_api_xml_files()
- self.spawn(["python", "sanitytest.py", self.build_platlib, apis[0]]) + self.spawn([sys.executable, "sanitytest.py", self.build_platlib, apis[0]])
ACK. I didn't notice this since I've been running generator.py directly in testing :-) Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Daniel P. Berrange
-
Doug Goldstein
-
Eric Blake