Search code examples
python-2.7setuptoolspython-modulepypi

Python custom module installalation won't copy static files


hi I'm developing a python module and when I create the install package using python setup.py sdist bdist_egg all the files are included on the zip file, but when I run python setup.py install all files are copied except the static files. the full project is on:

https://github.com/efirvida/python-gearbox

my setup.py

from setuptools import setup, find_packages
version = '0.1.0a'
setup(
    name='python-gearbox',
    version=version,
    author='Eduardo M. Firvida Donestevez',
    packages=find_packages(),
    include_data_package=True,
    author_email='[email protected]',
    description='Python library for gear transmission design',
    requires=['numpy', 'scipy'],
    url='https://github.com/efirvida/python-gearbox',
    download_url='https://github.com/efirvida/python-gearbox/archive/master.zip',
    keywords=['gearbox', 'gear', 'agma', 'iso', 'gear transmission', 'engineering'],
    platforms='any',
    license='MIT',
    zip_safe=False,
    classifiers=['Intended Audience :: Developers',
             'Intended Audience :: Manufacturing',
             'Intended Audience :: Science/Research',
             'Natural Language :: English',
             'Programming Language :: Python',
             'Programming Language :: Python :: 2.7',
             'Topic :: Scientific/Engineering',
             'Topic :: Scientific/Engineering :: Human Machine Interfaces',
             'Topic :: Software Development',
             'Topic :: Software Development :: Libraries',
             'Topic :: Software Development :: Libraries :: Application Frameworks'
             ]
)

Solution

  • I think I've got this. In your setup.py change

     include_data_package=True,
    

    into:

     include_package_data=True
    

    If you look at the log when doing python setup.py install, you'll find the clue:

    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: 
    UserWarning: Unknown distribution option: 'include_data_package'
    

    Besides, I also made some modifications to the MANIFEST.in, to make it clearer:

    include Makefile CHANGES LICENSE AUTHORS README 
    recursive-include gearbox/doc/source *.rst
    recursive-include gearbox/export/templates *
    recursive-exclude gearbox *.pyc