Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to create a pip package

Reply
Thread Tools

how to create a pip package

 
 
Phlip
Guest
Posts: n/a
 
      11-10-2009
Py hont:

I have a single file that I need my crew to pip install.

When I Google for "how to create a pip package" I don't hit anything.
Of course that info is out there; I can't seem to pick up the trail of
breadcrumbs to it.

While I'm looking, could someone push the link in here? Purely for
posterity? Thanks!

--
Phlip
http://c2.com/cgi/wiki?ZeekLand
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      11-10-2009
En Tue, 10 Nov 2009 00:48:26 -0300, Phlip <(E-Mail Removed)> escribió:

> I have a single file that I need my crew to pip install.
>
> When I Google for "how to create a pip package" I don't hit anything.
> Of course that info is out there; I can't seem to pick up the trail of
> breadcrumbs to it.


See http://pip.openplans.org/
You're looking for the "freeze" command.

--
Gabriel Genellina

 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      11-10-2009
On Mon, 9 Nov 2009 19:48:26 -0800 (PST), Phlip <(E-Mail Removed)>
declaimed the following in gmane.comp.python.general:
> I have a single file that I need my crew to pip install.
>

And what is "pip"?

My vague memory has it as either the CP/M or DEC PDP-11 command
equivalent to Xerox CP/V PCL (Peripheral Conversion Language -- the
program used for generic copy, rename, and print of files)

> When I Google for "how to create a pip package" I don't hit anything.


Okay, I find http://pypi.python.org/pypi/pip on googling for "pip
package"... Based upon that, I'd conclude you are asking the wrong
question -- PIP being a limited substitute for an "easy-install"
package, so you need to create a package that easy-install can work
with, but which doesn't use any of the features PIP doesn't support
(so... no "egg" format, for example).
--
Wulfraed Dennis Lee Bieber KD6MOG
http://www.velocityreviews.com/forums/(E-Mail Removed) HTTP://wlfraed.home.netcom.com/

 
Reply With Quote
 
Wolodja Wentland
Guest
Posts: n/a
 
      11-10-2009
On Mon, Nov 09, 2009 at 19:48 -0800, Phlip wrote:
> I have a single file that I need my crew to pip install.


Where do you plan to host this file? Will it be available on PiPy?

> When I Google for "how to create a pip package" I don't hit anything.
> Of course that info is out there; I can't seem to pick up the trail of
> breadcrumbs to it.


As has already been noted in this thread you do not create a file
specifically for pip, but rather use the standard (or soon to be) way of
distributing Python distributions outlined in:

http://docs.python.org/library/distu...dule-distutils
http://packages.python.org/distribute/

If you do not plan to host your "file" on pypi you can easily create a
pip requirements file that references a VCS of your choice. Read how to
do this in the pip documentation on "editable" packages:

http://pypi.python.org/pypi/pip/

kind regards

Wolodja

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJK+TheAAoJEIt/fTDK8U78tD4QAJyvwxMZww8cQaqwzCEQ3J/i
kkcKmmDkmOiUVyllJrWlzFRNaVB4BTLqn47fsQKB9r/myVejB9nsUdMRUXgaktiT
m2mKi+crlBUtcJkh6aNOFew79JsKrm2D2F99VJ6H63ScNQZ2dm b9ap63auBm1x4Q
TrfEhYjVy2qZE/lWdgeleOi8PQqDazxvlVBl4L7cXoHdHhI+F8L9/i4jlpxPyX+C
UBMgVc0/x4TA41rUmiF2o7UUIBra+x3OLkJiGE+xaH9T3aJ6QtZvyDgJFr PaJYnS
5LRsTw9V8HceFyS7ny98l5fy8EthBlUy9a1l1USUTCBpXOWI1L 3iwQMVWjbZOy+2
d3KagRapHb/abmuCR5a7ui7atDXLCIKNP3vWP1LFr5zMLQghiCPbgL82LNGxH t0Q
S9rCK2THbuUD7YYyUe172p389jUFS2lgy0+ZRgVcuxQ3JRMKTd E4WmP63lBs6KFU
gKYtn8twBvwmtq1KLLyXXlc+CHPzEV2NgvVdRRXhCylavw2LeE JVNJN1V4AEw0Qw
NmfbXWroeXHXoWupqPoLc0Ff9MxITISkdjReZhVTOkato92/eP+MktLDQ2bQVLBK
VxwKreXicBisqgRzMYB20x4Vg+kyipSNCSkckrXTDpmiLJkUd2/JhYg/HafjSW94
dWYbQBTnQCQ99oHtgHGC
=4tM+
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      11-10-2009
On Nov 10, 1:54*am, Wolodja Wentland <(E-Mail Removed)-heidelberg.de>
wrote:

> http://docs.python.org/library/distu...dule-distutils
> http://packages.python.org/distribute/


ktx... now some utterly retarded questions to prevent false starts.

the distutils page starts with "from distutils.core import setup".

but a sample project on github, presumably a pippable project, starts
with:

from setuptools import setup, find_packages

(and it also has ez_setup())

I don't foresee my project growing larger than one* file any time
soon. 'pip freeze' prob'ly won't write a setup.py. What is the
absolute simplest setup.py to stick my project on the PYTHONPATH, and
be done with it?

[*but rest assured it has a developer test suite and a customer test
script!]

--
Phlip
http://c2.com/cgi/wiki?ZeekLand
 
Reply With Quote
 
Wolodja Wentland
Guest
Posts: n/a
 
      11-10-2009
On Tue, Nov 10, 2009 at 06:30 -0800, Phlip wrote:
> On Nov 10, 1:54*am, Wolodja Wentland <(E-Mail Removed)-heidelberg.de>
> wrote:
>
> > http://docs.python.org/library/distu...dule-distutils
> > http://packages.python.org/distribute/

>
> ktx... now some utterly retarded questions to prevent false starts.


> the distutils page starts with "from distutils.core import setup".


[..]

> from setuptools import setup, find_packages


It will be enough to use the method outlined in the distutils
documentation. Setuptools is a third-party library that used to be the
de-facto standard for Python packaging. I don't want to go into detail
why setuptools might not be the best choice for a project and leave that
to [1] and [2].

The Distribute project was started in order to fix several bugs in
setuptools which was essentially unmaintained for a year and provides a
backward compatible fork in the 0.6 branch.

kind regards

Wolodja

[1] http://www.b-list.org/weblog/2008/dec/14/packaging/
[2] http://blog.ianbicking.org/2008/12/1...-on-packaging/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJK+YNKAAoJEIt/fTDK8U78l/AP/1vS9VkxGq512Q/8U9xLE9Fq
1vTyCCuHJqZ+GpVaf+GKr+0QmtG7/WN/EFA6jKSBFaGJfunYcUbfDNcqcRUGEQYd
vGY15QzcyZKJ9RviwmBiQEu2HuaEz6DR0XgPbc7P1bdfsXNXV5 QAr/SHCkvWPNny
jteThaW9Tz3WgEJDQfTB4U9+TomvMx7e10G90FwNJ+c7+cow+W XITL8i86L/7Izq
aLTNZ/S1p0MmIOewxjRzNcDgZ3H5j4PGwYb8dtcduAcVStDkM5xEcBfk ZtWJqGkr
CKzYkJp2848evw0EXA0qpPdzMu28qfqPs8sZomGR2QcTz5c8Xe hDiTOMujjCHFx6
QDSeRpwUBVvfM2bCfvEwzzG+r8JEE58oukGEdhVq6FarY31JFV HT0oXOtQxYbNYo
w9BXf5UDWgu/hbhScHXl997Cwjf4IvCNrh7/2IQ8rsX6SdI0MkmimhLZa0sL/VP8
N2BTEpmvoogg7Y4WaFt+gy4Z9KexjDxbk3kp8U1ztq8kWKjP1w tQDDvUlNP9Wbm3
uNJgqwPJrlk2DvXFuW/gAmQkocJ47csajf2sftJJoDqnecsFXnJIAkM7bEQ3eINQ
dxGdrTyBajwVQVdpZl9UmzU4sV832fEv8hmLMvVFXWfajwRdFC wICSz9d2nAYVp2
UvK74mibzbuT9S2OjqXu
=3Nkg
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Floris Bruynooghe
Guest
Posts: n/a
 
      11-10-2009
On Nov 10, 2:30*pm, Phlip <(E-Mail Removed)> wrote:
> On Nov 10, 1:54*am, Wolodja Wentland <(E-Mail Removed)-heidelberg.de>
> wrote:
>
> >http://docs.python.org/library/distu...dule-distutils
> >http://packages.python.org/distribute/

>
> ktx... now some utterly retarded questions to prevent false starts.
>
> the distutils page starts with "from distutils.core import setup".
>
> but a sample project on github, presumably a pippable project, starts
> with:
>
> * * from setuptools import setup, find_packages
>
> (and it also has ez_setup())
>
> I don't foresee my project growing larger than one* file any time
> soon. 'pip freeze' prob'ly won't write a setup.py. What is the
> absolute simplest setup.py to stick my project on the PYTHONPATH, and
> be done with it?


Do what the distutils page says, setuptools tries to extend distutils
with many fancy things but if you don't need those (and that's what it
sounds like) then sticking to distutils is better as you only require
the python stdlib.

Regards
Floris
 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      11-10-2009
> > * * from setuptools import setup, find_packages
>
> It will be enough to use the method outlined in the distutils
> documentation. Setuptools is a third-party library that used to be the
> de-facto standard for Python packaging. I don't want to go into detail
> why setuptools might not be the best choice for a project...


Good - thanks, all! Those were the exact details I sought to avoid...

 
Reply With Quote
 
Phlip
Guest
Posts: n/a
 
      11-10-2009
except...

will pip pull from a simple GitHub repo? or do I need to package
something up and put it in a pythonic repository somewhere?
 
Reply With Quote
 
Wolodja Wentland
Guest
Posts: n/a
 
      11-10-2009
On Tue, Nov 10, 2009 at 13:09 -0800, Phlip wrote:
> will pip pull from a simple GitHub repo? or do I need to package
> something up and put it in a pythonic repository somewhere?


I don't quite understand, but would say: both

You can't tell pip to pull from arbitrary git repositories, but only
from those that contain the packaging code as outlined in the distutils
documentation.

These git repositories do *not* have to be hosted on pypi. You should
however be able to do the following:

$ git clone git://example.com/repo.git
$ cd repo
$ python setup.py install

The pip requirement file would contain the following line:

-e git+git://example.com/repo.git#egg=rep

I hope this answers your questions

--
.''`. Wolodja Wentland <(E-Mail Removed)-heidelberg.de>
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJK+fM9AAoJEIt/fTDK8U78/28P/0kiDBnzPjW2QKkbSSuAnS+X
/inKhndhGg43Ky614Ayv+InkEpLlo9Lc+eu+5MEPmVjAdAQSPuO 4Z9+FXUMJNmLn
uMkWMmh0kux56Q8ZAxh/XdNaQJU+q3pEHqxVRLJxuEg2LNsIl+UCqkzPKEfd3sRZ
M+8RDNziN7OD0jHUHPEMWcWxMKpE7VERMBi5d3jsWwEj+Ob/Yy36m7xHfngPT+t+
A3CC+QzCX/o9eam/x8Hu8/1n+Jj3CAsxG7nAQTG3v0scl7yYno7R09p/oxIdpMu+
wiYBMIEqof8gkl4ddjPs4JcIuBZpkQywIG615Q0zEQjCfgDP4W E6eIQsStMpBM82
95aOvFm/xeBKl6GaF2JPwmXgphPwG5bbTO13LCj4agfHdcViiX8A6Knxxv Dkh4gP
LNhbbUJx96Gj8VBKbtAWJg1lQpJljmmoxOLrLxfCWtTJy3ntvw KyFm2zKtcs1VRi
XdDD0wR9zCFDqIfDLnGX056x4kOnLjoCq03zXyIshViA2tBZVC Dk6V48dABh+Err
utDD5saWFHsq2QknaWmWwjixG0gU9vrsau5tp+WtfIVwZBwuZd 4vqdbrqx0vEmgE
6uZrGT8sE8rYAF7sbjYh6bXC1jqg98JCpgM3Amm1rhpVgCIrwP c/xT3myFu8RQ2J
y2FNrPAVYKg47qJIZQOW
=cmuU
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to get a package pip installable? nbvfour@gmail.com Python 0 04-13-2012 03:00 PM
Replace pip installed package with latest git version? Alec Taylor Python 0 09-14-2011 08:44 AM
[ANN] BPT (Boxed Package Tool) 0.4a -- now with PIP support Giuseppe Ottaviano Python 0 05-15-2009 08:29 AM
PIP/Recording to VCR bmitd67 DVD Video 1 11-09-2005 06:57 PM



Advertisments