Swig isn't executed with snapcraft python plugin

Bug #1648039 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

1. Use a project having a swift module:
requirements.txt:
https://github.com/didrocks/python-midi/archive/v0.2.3+2016.11.tar.gz

2. Use the python plugin in your snapcraft.yaml:
parts:
  foo:
    source: .
    plugin: python
    python-version: python2
    requirements: requirements.txt
    build-packages: [swig3.0]

After snapcrafting this parts (not a cleanbuild, so swig is available on the system), you will notice that the .so file is compiled:
parts/foo/install/lib/python2.7/site-packages/midi/sequencer/_sequencer_alsa.so
But you don't have the binding generated by swift, "sequencer_alsa.py".

On the same machine, I can create a virtualenv and then get the module compiles:
$ virtualenv venv
$ . venv/bin/active
$ pip install --r requirements.txt
-> venv/lib/python2.7/site-packages/midi/sequencer/sequencer_alsa.py was generated

As a quick try, I tried removing "--no-compile" in pip_install() in the python plugin, without success. Nothing in the verbose pip outputs explains why swig isn't ran.

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1648039] [NEW] Swig isn't executed with snapcraft python plugin

El 07/12/16 a las 07:33, Didier Roche escribió:
> Public bug reported:
>
> 1. Use a project having a swift module:
> requirements.txt:
> https://github.com/didrocks/python-midi/archive/v0.2.3+2016.11.tar.gz
>
> 2. Use the python plugin in your snapcraft.yaml:
> parts:
> foo:
> source: .
> plugin: python
> python-version: python2
> requirements: requirements.txt
> build-packages: [swig3.0]
>
> After snapcrafting this parts (not a cleanbuild, so swig is available on the system), you will notice that the .so file is compiled:
> parts/foo/install/lib/python2.7/site-packages/midi/sequencer/_sequencer_alsa.so
> But you don't have the binding generated by swift, "sequencer_alsa.py".
>
> On the same machine, I can create a virtualenv and then get the module compiles:
> $ virtualenv venv
> $ . venv/bin/active
> $ pip install --r requirements.txt
> -> venv/lib/python2.7/site-packages/midi/sequencer/sequencer_alsa.py was generated
>
> As a quick try, I tried removing "--no-compile" in pip_install() in the
> python plugin, without success. Nothing in the verbose pip outputs
> explains why swig isn't ran.

We will have to look at the source code for venv/virtualenv and pip to
figure this one out (which is what I did to get most of the new plugin
code).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.