Fpm: Python Packaging Not Working?

Created on 12 Jan 2017  Â·  4Comments  Â·  Source: jordansissel/fpm

Heyo! Excuse me if I'm missing something here. I'm a new fpm user.

I spent some time digging around, however, and I can't seem to get this working, which leads to me believe that either:

a) I'm totally missing something obvious (likely), or
b) The python packaging support isn't working currently.

Here's what I'm attempting to do: package up a python CLI program I've written. The python program works just fine when installed via pip. What I'm trying to do now is build this into a cross-platform package that I can distribute without pip / python as a dependency.

The python package I'm trying to get packaged up is stormpath-cli (and on github).

Here's what I've tried with fpm (just testing against OSX currently). I can get the osx package to build successfully, but here's the problem: no matter what I do, after installing the osx package that fpm outputs, it installs stormpath-cli but never any of its required python dependencies :( This means I can't successfully run the stormpath CLI tool because while the script is installed to the right place, none of it's required dependencies are :(

Here's what I did:

$ fpm -s python -t osxpkg stormpath-cli

I also tried manually specifying the dependencies like so:

fpm --output-type osxpkg \
  --input-type python \
  --license Apache2 \
  --vendor stormpath-cli \
  --depends docopt \
  --depends pyquery \
  --depends requests \
  --depends stormpath \
  --depends termcolor \
  --provides stormpath-cli \
  --maintainer "Randall Degges <[email protected]>" \
  --description "The official Stormpath command line client." \
  --url https://github.com/stormpath/stormpath-cli stormpath-cli

Neither of the above two commands builds the package with the dependencies properly specified.

Anyone know what I'm doing wrong? Or is this a known bug? I looked through the existing issues, but couldn't find anything about this.

Most helpful comment

As far as Debian is concerned, use this before dpkg -i…

apt-get install $(dpkg-deb -f foobar*.deb Depends | tr , ' ')

All 4 comments

I'm facing the same issue. I'm trying to package the PyOpenCL package (actually can't use the Python package but have to install from source for some custom configuration).
So I'm doing a local install (in the PyOpenCL source directory):

python setup.py install --user

and copying the files from ~/.local/lib/python2.7/site-packages/ to a dummy directory usr/local/lib/python2.7/dist-packages in the packaging directory. Eventually I run

fpm -s dir -t deb -n python-pyopencl -d [dependencies] usr

I copied the dependencies from the output of apt-cache depends python-pyopencl, see also here. However installing the package via sudo dpkg -i python-pyopencl.deb returns an error:

2017-04-03-103449_601x152_scrot

Manually running sudo apt-get install python-cffi python-pytools prior to installing the deb obviously fixes this. I'm also curious if I'm missing an fpm command line option or if my procedure can be improved.

@pylipp Sorry you are having issues. I think I can explain what is happening.

dpkg is aware of dependencies and knows when dependencies are not met. However, it will not actually try to satisfy those dependencies by downloading them.

apt-get is aware also but has the added feature that it actually downloads and installs any necessary dependencies.

So, unfortunately, this means that dpkg will fail if you don't' have all dependencies already installed.

Neither of the above two commands builds the package with the dependencies properly specified.

@rdegges hmm.. When I look at the code, I don't see any references to dependencies. Also, glancing at the pkgbuild manpage, I don't see any hints that dependencies are supported. It is possible that OSX's pkg format doesn't support dependencies.

As far as Debian is concerned, use this before dpkg -i…

apt-get install $(dpkg-deb -f foobar*.deb Depends | tr , ' ')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

FlorinAndrei picture FlorinAndrei  Â·  7Comments

hellosputnik picture hellosputnik  Â·  4Comments

vadi2 picture vadi2  Â·  3Comments

jameshfisher picture jameshfisher  Â·  7Comments

nandosola picture nandosola  Â·  3Comments