Merge lp:~sergiusens/snapcraft/1498212 into lp:~snappy-dev/snapcraft/core

Proposed by Sergio Schvezov
Status: Merged
Approved by: Ted Gould
Approved revision: 187
Merged at revision: 187
Proposed branch: lp:~sergiusens/snapcraft/1498212
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 54 lines (+6/-6)
2 files modified
snapcraft/plugins/python2_project.py (+3/-3)
snapcraft/plugins/python3_project.py (+3/-3)
To merge this branch: bzr merge lp:~sergiusens/snapcraft/1498212
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+271881@code.launchpad.net

Commit message

Used builddir as a base for setup.py overrides

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Code looks fine. The tests are failing, but I don't think that it because of this branch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'snapcraft/plugins/python2_project.py'
--- snapcraft/plugins/python2_project.py 2015-09-18 18:06:01 +0000
+++ snapcraft/plugins/python2_project.py 2015-09-21 22:24:36 +0000
@@ -38,7 +38,7 @@
3838
39 return self.run(39 return self.run(
40 ['python2', setuptemp.name, 'install', '--install-layout=deb',40 ['python2', setuptemp.name, 'install', '--install-layout=deb',
41 '--prefix={}/usr'.format(self.installdir)])41 '--prefix={}/usr'.format(self.installdir)], cwd=self.builddir)
4242
43 @property43 @property
44 def dist_packages_dir(self):44 def dist_packages_dir(self):
@@ -48,12 +48,12 @@
48 # Takes the setup.py file and puts a couple little gems on the48 # Takes the setup.py file and puts a couple little gems on the
49 # front to make things work better.49 # front to make things work better.
50 def copy_setup(self):50 def copy_setup(self):
51 setupout = tempfile.NamedTemporaryFile(mode='w+')51 setupout = tempfile.NamedTemporaryFile(dir=self.builddir, mode='w+')
5252
53 setupout.write('import sys\n')53 setupout.write('import sys\n')
54 setupout.write('sys.executable = "usr/bin/python2"\n\n')54 setupout.write('sys.executable = "usr/bin/python2"\n\n')
5555
56 with open('setup.py', 'r') as f:56 with open(os.path.join(self.builddir, 'setup.py'), 'r') as f:
57 for line in f:57 for line in f:
58 setupout.write(line)58 setupout.write(line)
5959
6060
=== modified file 'snapcraft/plugins/python3_project.py'
--- snapcraft/plugins/python3_project.py 2015-09-18 17:29:31 +0000
+++ snapcraft/plugins/python3_project.py 2015-09-21 22:24:36 +0000
@@ -41,7 +41,7 @@
41 setuptemp = self.copy_setup()41 setuptemp = self.copy_setup()
42 return self.run(42 return self.run(
43 ['python3', setuptemp.name, 'install', '--install-layout=deb',43 ['python3', setuptemp.name, 'install', '--install-layout=deb',
44 '--prefix=%s/usr' % self.installdir])44 '--prefix={}/usr'.format(self.installdir)], cwd=self.builddir)
4545
46 @property46 @property
47 def dist_packages_dir(self):47 def dist_packages_dir(self):
@@ -51,12 +51,12 @@
51 # Takes the setup.py file and puts a couple little gems on the51 # Takes the setup.py file and puts a couple little gems on the
52 # front to make things work better.52 # front to make things work better.
53 def copy_setup(self):53 def copy_setup(self):
54 setupout = tempfile.NamedTemporaryFile(mode='w+')54 setupout = tempfile.NamedTemporaryFile(dir=self.builddir, mode='w+')
5555
56 setupout.write('import sys\n')56 setupout.write('import sys\n')
57 setupout.write('sys.executable = "usr/bin/python3"\n\n')57 setupout.write('sys.executable = "usr/bin/python3"\n\n')
5858
59 with open('setup.py', 'r') as f:59 with open(os.path.join(self.builddir, 'setup.py'), 'r') as f:
60 for line in f:60 for line in f:
61 setupout.write(line)61 setupout.write(line)
6262

Subscribers

People subscribed via source and target branches