how to create a pip package

srid sridhar.ratna at gmail.com
Wed Nov 11 18:39:07 EST 2009


On Nov 10, 8:25 pm, Phlip <phlip2... at gmail.com> wrote:
> On Nov 10, 3:11 pm, Wolodja Wentland <wentl... at cl.uni-heidelberg.de>
> wrote:
>
> > The pip requirement file would contain the following line:
>
> > -e git+git://example.com/repo.git#egg=rep
>
> > I hope this answers your questions :-D
>
> Let me ask it like this. What happens when a user types..?
>
>    sudo pip install repo

Hey Phlip,

If you run "pip install repo", it will try to find a package in
http://pypi.python.org/ named "repo".

Run the following commands:

$ pip install pastescript
$ paster create myapp
$ cd myapp/
$ python setup.py sdist register upload

That's all you need to do .. to have your "myapp" project uploaded to
PyPI. From now onwards, anyone connected to the internet will be able
to run "pip install myapp" to get your package.

For more details, may I suggest you to read the official distutils
tutorial: http://wiki.python.org/moin/Distutils/Tutorial

-srid

PS: Another advantage of using distutils (or setuptools/distribute)
and uploading your package to PyPI is that you would automatically
enable other package managers (such as PyPM - http://pypm.activestate.com/
) to support your package.






More information about the Python-list mailing list