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
=== modified file 'snapcraft/plugins/python2.py'
--- snapcraft/plugins/python2.py 2015-08-05 15:39:18 +0000
+++ snapcraft/plugins/python2.py 2015-08-06 02:15:41 +0000
@@ -24,7 +24,7 @@
24 super().__init__(name, options)24 super().__init__(name, options)
2525
26 class UbuntuOptions:26 class UbuntuOptions:
27 packages = ["python-dev"]27 packages = ["python-dev", "python-setuptools"]
28 self.ubuntu = ubuntu.UbuntuPlugin(name, UbuntuOptions())28 self.ubuntu = ubuntu.UbuntuPlugin(name, UbuntuOptions())
2929
30 # note that we don't need to set PYTHONHOME here,30 # note that we don't need to set PYTHONHOME here,
3131
=== modified file 'snapcraft/plugins/python2_project.py'
--- snapcraft/plugins/python2_project.py 2015-08-03 18:21:58 +0000
+++ snapcraft/plugins/python2_project.py 2015-08-06 02:15:41 +0000
@@ -14,6 +14,8 @@
14# You should have received a copy of the GNU General Public License14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os
18
17import snapcraft19import snapcraft
1820
1921
@@ -26,6 +28,11 @@
26 return self.handle_source_options()28 return self.handle_source_options()
2729
28 def build(self):30 def build(self):
31 env = os.environ.copy()
32 env['PYTHONPATH'] = "{}/usr/lib/python2.7/dist-packages/".format(self.installdir)
33 # Install will fail if PYTHONPATH does not exist
34 os.makedirs(env['PYTHONPATH'])
29 return self.run(35 return self.run(
30 ["python2", "setup.py", "install", "--install-layout=deb",36 ["python2", "setup.py", "install", "--install-layout=deb",
31 "--prefix={}/usr".format(self.installdir)])37 "--prefix={}/usr".format(self.installdir)],
38 env=env)

Subscribers

People subscribed via source and target branches