Please show the simple and up to date standard way to create a python package for python 2.x
I\'d prefer to use pip for installing the package later.
The pac
The following is copied from the Distutils Tutorial.
File layout:
top
|-- package
| |-- __init__.py
| |-- module.py
| `-- things
| |-- cross.png
| |-- fplogo.png
| `-- tick.png
|-- runner
|-- MANIFEST.in
|-- README
`-- setup.py
To make the installation tarball, you simply run:
python setup.py sdist
To install the package, use pip
or easy_install
:
pip install my_package-1.2.3.tar.bz2
or
easy_install my_package-1.2.3.tar.bz2
Also, you can upload it to PyPI, first register it:
python setup.py register
then upload the source tarball
python setup.py sdist upload
You can upload binary eggs as well (though not necessary):
python setup.py bdist_egg upload
Then folks can install it like this:
pip install my_package==1.2.3
or,
easy_install my_package==1.2.3