Example of Packaging CFFI With py2app?

44 views
Skip to first unread message

David Riggs

unread,
Jan 24, 2017, 1:04:51 AM1/24/17
to python-cffi
Hi all,

I'm attempting to package an application using `py2app`, which "freezes" a Python interpreter, code, and all of its dependencies so that it can be distributed and launched as an executable on Mac OS X. My application has a dependency, sounddevice, which itself binds to the PortAudio C library using CFFI.

py2app does a fantastic job resolving pure-Python dependencies, and does a pretty good job with many C-based deps... However it's not able to make sense of this CFFI-based dependency, and - since my level of involvement is up the stack - I'm finding CFFI too over my head to understand where the disconnect is at.

I'd like to know if anyone could recommend an example `setup.py` which successfully packages up a CFFI-based dependency? I'm hoping that a successful example will turn up something simple that I've botched.

If anyone would like to examine the details of my specific example (this CFFI-newbie would be most appreciative!), this thread discusses my configuration:

    https://github.com/spatialaudio/python-sounddevice/issues/68

Many thanks for any help you can offer!

- DR
 

Armin Rigo

unread,
Jan 24, 2017, 7:41:00 AM1/24/17
to pytho...@googlegroups.com
Hi,

On 24 January 2017 at 07:04, David Riggs <david....@gmail.com> wrote:
> I'm attempting to package an application using `py2app`, which "freezes" a
> Python interpreter, code, and all of its dependencies so that it can be
> distributed and launched as an executable on Mac OS X. My application has a
> dependency, sounddevice, which itself binds to the PortAudio C library using
> CFFI.

According to the traceback, the problem seems to be that "ply" fails
when packaged with py2app. That sounds like an issue of "ply" itself,
or possibly its user pycparser; cffi is only a user of pycparser, so
it's very indirect.

Without a Mac myself, I can't help much more than recommending you
look towards pycparser or ply's mailing lists or open bugs.


A bientôt,

Armin.
Reply all
Reply to author
Forward
0 new messages