astropy/astropy — Issue #26: sdist doesn't include wcs header files and scripts directory.
Author: phn
Created: 2011-10-20 06:37:29+00:00
State: open

Hello,

I tried Python 2.6 and Python 2.7. Running ``python setup.py install`` in the ``astropy`` repo, doesn't create any problems since all the files are accessible. But this is a problem when trying to install this from a ``sdist``, for example by automated testing software like ``tox``.

Bug in setuptools/distutils?

Using ``recursive-include astropy/wcs/src *.h`` in ``MANIFEST.in`` works.

If ``MANIFEST.in`` is specified then only the files mentioned in it gets copied; setuptools/distutils does not use its default file finding algorithm in this case.

Additional comments (with what I think are the reasons):

The ``scripts `` directory doesn't get copied, since ``setup.py`` removes the only file ``README.rst`` in this directory.

The contents of ``AstroPy.egg-info/`` doesn't get cleared/updated between two runs of ``setup.py``. For example, say we run ``setup.py sdist`` using the ``MANIFEST.in`` mentioned above. Now remove the line from MANIFEST.in, ad run ``setup.py`` again. This time the header files will get included, even though they are not specified in MANIFEST.in. I guess that this is because the header files get listed in ``AstroPy.egg-info/SOURCES.txt`` the first time, and the list gets reused. This leads to major confusion: I just lost 1.5 hours. Deleting ``AstroPy.egg-info`` leads to the previous behaviour.

If ``AstroPy.egg-info`` is deleted, without deleting ``version.py`` AND ``version.pyc``, then the ``import astropy`` line in ``setup.py`` complains that ``AstroPy`` distribution doesn't exist. The ``astropy/__init__.py`` tried to run ``version.py`` which uses ``AstroPy``, causing error.

Prasanth