I'm trying to figure out how to construct a Python source package that is installable via pip. I tried creating a test project with the setup.py file described on http://packages.python.org/an_example_pypi_project/setuptools.html and a number of simple test files in the specified directories.
After creating a source tarball for the project named dist/an_example_pypi_project-0.0.4.tar.gz
with python setup.py sdist
, I tried installing it in a virtualenv environment called ~/TEST
with
~/TEST/bin/pip install dist/an_example_pypi_project-0.0.4.tar.gz
. Although pip didn't throw any error, it didn't seem to install the package:
$ ~/TEST/bin/pip install dist/an_example_pypi_project-0.0.4.tar.gz
Unpacking ./dist/an_example_pypi_project-0.0.4.tar.gz
Running setup.py egg_info for package from file:///home/lebedov/an_example_pypi_project/dist/an_example_pypi_project-0.0.4.tar.gz
Cleaning up...
$ find ~/TEST -name "an_example*"
$
Note that I was able to install from the tarball using easy_install:
$ ~/TEST/bin/easy_install dist/an_example_pypi_project-0.0.4.tar.gz
Processing an_example_pypi_project-0.0.4.tar.gz
Running an_example_pypi_project-0.0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-tfXxeW/an_example_pypi_project-0.0.4/egg-dist-tmp-N2QY_N
warning: build_py: byte-compiling is disabled, skipping.
warning: install_lib: byte-compiling is disabled, skipping.
zip_safe flag not set; analyzing archive contents...
Adding an-example-pypi-project 0.0.4 to easy-install.pth file
Installed /home/lebedov/TEST/lib/python2.7/site-packages/an_example_pypi_project-0.0.4-py2.7.egg
Processing dependencies for an-example-pypi-project==0.0.4
Finished processing dependencies for an-example-pypi-project==0.0.4
$ find ~/TEST/ -name "an_example*"
/home/lebedov/TEST/lib/python2.7/site-packages/an_example_pypi_project-0.0.4-py2.7.egg
Am I neglecting to configure something in the package in order to make it installable with pip? I'm using Python 2.7.2, distribute 0.6.21, virtualenv 1.7, and pip 1.0.2.
tree
? – Missy