Skip to content

Commit

Permalink
In order for files listed in MANIFEST to be included in package dir a…
Browse files Browse the repository at this point in the history
…t installation, setup() needs to be passed include_package_data=True
  • Loading branch information
Scott Torborg committed Oct 3, 2013
1 parent 1cba71b commit 79cd7aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions funniest/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ def readme():
entry_points={
'console_scripts': ['funniest-joke=funniest.command_line:main'],
},
include_package_data=True,
zip_safe=False)
2 changes: 2 additions & 0 deletions metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The ``setuptools.setup()`` call accepts a variety of keyword arguments to specif
install_requires=[
'markdown',
],
include_package_data=True,
zip_safe=False)

For a full list of the possible arguments to ``classifiers``, visit http://pypi.python.org/pypi?%3Aaction=list_classifiers.
Expand Down Expand Up @@ -86,6 +87,7 @@ Now we can use it in setup.py like::
install_requires=[
'markdown',
],
include_package_data=True,
zip_safe=False)

When the repo is hosted on GitHub or BitBucket, the README.rst file will also automatically be picked up and used as a 'homepage' for the project.
2 changes: 2 additions & 0 deletions non-code-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The mechanism that provides this is the ``MANIFEST.in`` file. This is relatively
include docs/*.txt
include funniest/data.json

In order for these files to be copied at install time to the package's folder inside ``site-packages``, you'll need to supply ``include_package_true=True`` to the ``setup()`` function.

.. note::

Files which are to be used by your installed library (e.g. data files to support a particular computation method) should usually be placed inside of the Python module directory itself. E.g. in our case, a data file might be at ``funniest/funniest/data.json``. That way, code which loads those files can easily specify a relative path from the consuming module's ``__file__`` variable.

0 comments on commit 79cd7aa

Please sign in to comment.