Question about Pip Distribution Etiquette

9 views
Skip to first unread message

Andrew Frances

unread,
Apr 8, 2016, 2:32:03 PM4/8/16
to montrealpython
Hi Folks:

I am using a package that is not installed using pip. The application uses Cython. I want to install this package on Heroku. Heroku recommends that anything that can be installed by pip, is okay. I have asked the owners if they can create a version installed by pip. I have not received an answer. I have not tried my hand at making a pipable distribution before. I am starting to read up on this. How should I proceed? For example, can I have pip grab from a private repository?

Cheers,
Andrew

Frédéric Osterrath

unread,
Apr 8, 2016, 2:51:51 PM4/8/16
to montrea...@googlegroups.com
Hi Andrew,

You can point pip at a repo but that repo needs to have a valid setup.py file at top level that essentially defines how pip should handle the installation.

I'd recommend forking and creating a setup.py . If it works you can send a pull request to the authors...

Cheers,
Fred.


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Montréal-Python".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
Pour envoyer un message à ce groupe, envoyez un e-mail à l'adresse montrea...@googlegroups.com.
Visitez ce groupe à l'adresse https://groups.google.com/group/montrealpython.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Mathieu Longtin

unread,
Apr 8, 2016, 2:55:50 PM4/8/16
to montrea...@googlegroups.com
If it has a setup.py, you can install it using pip. If it doesn't have a setup.py, that should be easy enough to create.
--
Mathieu Longtin
1-514-803-8977

Ronan Jouchet

unread,
Apr 8, 2016, 2:58:54 PM4/8/16
to montrea...@googlegroups.com
The PyPA-maintained Python Packaging User Guide should help.

Ronan

Andrew Frances

unread,
Apr 8, 2016, 3:21:51 PM4/8/16
to montrealpython
Hi Matthieu and Folks:

The package has a setup.py. However there are additional setups done manually like compiling a C library and installing cython. Should I be modifying the existing setup.py?

Right now, I'll look up how to set up a repo. Any advice would be appreciated.


Cheers,
Andrew

2016-04-08 14:55 GMT-04:00 Mathieu Longtin <mat...@closetwork.org>:

Andrew Frances

unread,
Apr 8, 2016, 3:22:53 PM4/8/16
to montrealpython
Hi Frederic and Ronan:

Thanks for the advice. I am new to this so I'll look up how to set up a repo.

Cheers,
Andrew

Leif Halldór Ásgeirsson

unread,
Apr 8, 2016, 3:23:05 PM4/8/16
to montrea...@googlegroups.com

Cython should be installed as a dependency

Mathieu Longtin

unread,
Apr 8, 2016, 3:24:13 PM4/8/16
to montrealpython
In that case, make a wheel: pip wheel  --wheel-dir /path/to/dest/dir    /path/to/your/package 

After that, you can distribute the wheel and install it using pip.

Leif Halldór Ásgeirsson

unread,
Apr 8, 2016, 3:27:56 PM4/8/16
to montrea...@googlegroups.com
Sorry, accidentally hit the send button early on my touch screen.

Cython should be installed as a dependency by pip. If it isn't, it should be added to the install_requires argument to the setup function.

Andrew Frances

unread,
Apr 8, 2016, 3:30:12 PM4/8/16
to montrealpython
Hi Matthieu:


Let me read up more on wheel. At some point, don't I have to put the repo somewhere that can be reached by a Heroku buildpack (cedar)? And
once that is working, tell the original folks about the work done?

Cheers,
Andrew

Andrew Frances

unread,
Apr 8, 2016, 3:34:25 PM4/8/16
to montrealpython
Hi Leif:

Thanks for the head's up.

Cheers,
Andrew

Frédéric Osterrath

unread,
Apr 8, 2016, 3:50:12 PM4/8/16
to montrea...@googlegroups.com
Andrew,

Just as a side note; compiling C extensions that Cython needs can (and probably should) be defined in the setup.py as well. See:

Of course there might also be valid reasons for not having included the compilation directives in the setup file.

Cheers,
Reply all
Reply to author
Forward
0 new messages