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

Proposed by Sergio Schvezov
Status: Rejected
Rejected by: Sergio Schvezov
Proposed branch: lp:~sergiusens/snapcraft/setuptools
Merge into: lp:~snappy-dev/snapcraft/core
Diff against target: 38 lines (+9/-2)
2 files modified
snapcraft/plugins/python2.py (+1/-1)
snapcraft/plugins/python2_project.py (+8/-1)
To merge this branch: bzr merge lp:~sergiusens/snapcraft/setuptools
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Leo Arias (community) Needs Information
Review via email: mp+267121@code.launchpad.net

Commit message

setuptools for python 2 projects

Description of the change

Something like this MP is needed for this to work:
https://github.com/sergiusens/galileo

I don't think this is the final solution, but I am not sure how to proceed either.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

<elopio> sergiusens: can't you specify the python-setuptools dependency in the yaml of your package?
<elopio> there are other setup packages, so not all will require setuptools.

review: Needs Information
Revision history for this message
Michael Vogt (mvo) wrote :

I think we should merge the python2_project changes if that unblocks you. The python-setuptools could come via the snapcraft.yaml as well.

review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) :
Revision history for this message
Björn Tillenius (bjornt) wrote :

> <elopio> sergiusens: can't you specify the python-setuptools dependency in the
> yaml of your package?
> <elopio> there are other setup packages, so not all will require setuptools.

How would you specify python-setuptools in the yaml?

Anyway, I think setuptools is so widespread, that it makes sense to support it by
default. It will lower the entry bar a lot.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snapcraft/plugins/python2.py'
2--- snapcraft/plugins/python2.py 2015-08-05 15:39:18 +0000
3+++ snapcraft/plugins/python2.py 2015-08-06 02:15:41 +0000
4@@ -24,7 +24,7 @@
5 super().__init__(name, options)
6
7 class UbuntuOptions:
8- packages = ["python-dev"]
9+ packages = ["python-dev", "python-setuptools"]
10 self.ubuntu = ubuntu.UbuntuPlugin(name, UbuntuOptions())
11
12 # note that we don't need to set PYTHONHOME here,
13
14=== modified file 'snapcraft/plugins/python2_project.py'
15--- snapcraft/plugins/python2_project.py 2015-08-03 18:21:58 +0000
16+++ snapcraft/plugins/python2_project.py 2015-08-06 02:15:41 +0000
17@@ -14,6 +14,8 @@
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21+import os
22+
23 import snapcraft
24
25
26@@ -26,6 +28,11 @@
27 return self.handle_source_options()
28
29 def build(self):
30+ env = os.environ.copy()
31+ env['PYTHONPATH'] = "{}/usr/lib/python2.7/dist-packages/".format(self.installdir)
32+ # Install will fail if PYTHONPATH does not exist
33+ os.makedirs(env['PYTHONPATH'])
34 return self.run(
35 ["python2", "setup.py", "install", "--install-layout=deb",
36- "--prefix={}/usr".format(self.installdir)])
37+ "--prefix={}/usr".format(self.installdir)],
38+ env=env)

Subscribers

People subscribed via source and target branches