2

I'm working on a website project.

When I use setup.py and run setup.py build, the build script excludes all of the resources in my web site (basically all of the non python files). What am I doing wrong?

101010
  • 13,695
  • 26
  • 85
  • 162

1 Answers1

3

The most reliable way I've found to include extra files in a distribution using distutils is to provide a MANIFEST.in file. Place this file in the same directory as your setup.py and include in it the list of resource files you require. For example, your MANIFEST.in file might like this:

include resources/somefile.txt resources/*.png 
recursive-include resources/static *.png *.jpg *.css *.js

See the distutils documentation for more details.

Though I prefer the MANIFEST.in method, if you are using setuptools or distribute, have a look at this answer for an alternative method of doing the same thing.

Community
  • 1
  • 1
Mark Gemmill
  • 5,789
  • 2
  • 25
  • 22