Setuptools python setup.py install does not copy all child modules

The package directory structure is

repodir/ -------- setup.py -------- MANIFEST.in -------- bin/ ----------- awsm.sh -------- sound/ ------------ init.py ------------ echo/ ----------------- init.py ----------------- module1.py ----------------- module2.py ------------ effects/ ------------------- init.py ------------------- module3.py ------------------- module4.py 

setup.py

 from setuptools import setup setup( name = 'sound', version = '0.1', author = 'awesomeo', author_email = ' awesomeo@email.com ', description = 'awesomeo', license = 'Proprietary', packages = ['sound'], scripts = ['bin/awsm.sh'], install_requires = ['Django==1.8.2', 'billiard', 'kombu', 'celery', 'django-celery' ], zip_safe = False, ) 

When I do - install python setup.py, only the sound / init .py file is copied to the / Library / Python / 2.7 / site-packages / sound / directory.

The rest of the echo, surround subpackages and effects are not copied at all. Setuptools creates a sound.egg file containing the SOURCES.txt file

SOURCES.txt

 MANIFEST.in setup.py bin/awsm.sh sound/__init__.py sound.egg-info/PKG-INFO sound.egg-info/SOURCES.txt sound.egg-info/dependency_links.txt sound.egg-info/not-zip-safe sound.egg-info/requires.txt sound.egg-info/top_level.txt 

It seems that the installation does not include subpackages in the SOURCES.txt file for copying during installation, and this is what creates the problem.

Any idea why this might happen?

+7
python setuptools
source share
2 answers

Add sound.echo and sound.effects to packages . distutils will not recursively compile subpackages.

According to the excellent documentation :

Distutils will not recursively scan the source tree looking for any directory with the __init__.py file

Note. Also, be sure to create __init__.py files for your packages (in your question you called them init.py ).

+4
source share

You are already using setuptools so you can import find_packages to get all subpackages:

 from setuptools import setup, find_packages setup( ... packages=find_packages(), ... ) 
+10
source share

All Articles