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
1=== modified file 'snapcraft/plugins/python2_project.py'
2--- snapcraft/plugins/python2_project.py 2015-09-18 18:06:01 +0000
3+++ snapcraft/plugins/python2_project.py 2015-09-21 22:24:36 +0000
4@@ -38,7 +38,7 @@
5
6 return self.run(
7 ['python2', setuptemp.name, 'install', '--install-layout=deb',
8- '--prefix={}/usr'.format(self.installdir)])
9+ '--prefix={}/usr'.format(self.installdir)], cwd=self.builddir)
10
11 @property
12 def dist_packages_dir(self):
13@@ -48,12 +48,12 @@
14 # Takes the setup.py file and puts a couple little gems on the
15 # front to make things work better.
16 def copy_setup(self):
17- setupout = tempfile.NamedTemporaryFile(mode='w+')
18+ setupout = tempfile.NamedTemporaryFile(dir=self.builddir, mode='w+')
19
20 setupout.write('import sys\n')
21 setupout.write('sys.executable = "usr/bin/python2"\n\n')
22
23- with open('setup.py', 'r') as f:
24+ with open(os.path.join(self.builddir, 'setup.py'), 'r') as f:
25 for line in f:
26 setupout.write(line)
27
28
29=== modified file 'snapcraft/plugins/python3_project.py'
30--- snapcraft/plugins/python3_project.py 2015-09-18 17:29:31 +0000
31+++ snapcraft/plugins/python3_project.py 2015-09-21 22:24:36 +0000
32@@ -41,7 +41,7 @@
33 setuptemp = self.copy_setup()
34 return self.run(
35 ['python3', setuptemp.name, 'install', '--install-layout=deb',
36- '--prefix=%s/usr' % self.installdir])
37+ '--prefix={}/usr'.format(self.installdir)], cwd=self.builddir)
38
39 @property
40 def dist_packages_dir(self):
41@@ -51,12 +51,12 @@
42 # Takes the setup.py file and puts a couple little gems on the
43 # front to make things work better.
44 def copy_setup(self):
45- setupout = tempfile.NamedTemporaryFile(mode='w+')
46+ setupout = tempfile.NamedTemporaryFile(dir=self.builddir, mode='w+')
47
48 setupout.write('import sys\n')
49 setupout.write('sys.executable = "usr/bin/python3"\n\n')
50
51- with open('setup.py', 'r') as f:
52+ with open(os.path.join(self.builddir, 'setup.py'), 'r') as f:
53 for line in f:
54 setupout.write(line)
55

Subscribers

People subscribed via source and target branches