Including static data in setup.py (setuptools)

I am currently encoding setup.py using setuptools. And I want to copy static data (which is not a Python module) to the site packages.

The fact is that the hierarchy of the current folder is structured as follows:

setup.py src Pure Python Module skeleton example __init__.py resources static error.css example.css logo_shadow.png template error.html example.html server.tmplt 

I want to copy the skeleton directory to the WHILE site packages , maintaining the folder structure / hierarchy , but how do I do this?

+8
python setuptools
source share
1 answer

I solved the problem by processing static files separately without using setuptools.

 from sys import argv try: if argv[1] == 'install': from os.path import join from distutils.sysconfig import get_python_lib from shutil import copytree OrigSkeleton = join('src', 'skeleton') DestSkeleton = join(get_python_lib(), 'cumulus', 'skeleton') copytree(OrigSkeleton, DestSkeleton) except IndexError: pass 
+2
source share

All Articles