2015-05-27 11 views
7

La struttura del pacchetto dir è questosetuptools python setup.py install non la copia di tutti i moduli bambino

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 = '[email protected]', 
     description = 'awesomeo', 
     license = 'Proprietary', 
     packages = ['sound'], 
     scripts = ['bin/awsm.sh'], 
     install_requires = ['Django==1.8.2', 'billiard', 'kombu', 'celery', 'django-celery' ], 
     zip_safe = False, 
    ) 

Quando faccio - python setup.py install , solo suono/init .py viene copiato in /Library/Python/2.7/site-packages/sound/ directory.

Il resto dei pacchetti secondari eco, surround ed effetti non vengono copiati affatto. Setuptools crea un sound.egg-info, che contiene il file SOURCES.txt

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 

Sembra che l'installazione non include i pacchetti secondari nel file SOURCES.txt da copiare su installare e questo è ciò che sta creando il problema.

Qualche idea del motivo per cui ciò potrebbe accadere?

risposta

3

Aggiungi sound.echo e sound.effects a packages. distutils non raccoglierà in modo ricorsivo i sotto-pacchetti.

Come per il fine documentation:

Distutils non ricorsivamente scansione il vostro albero sorgente alla ricerca di qualsiasi directory con un __init__.py file di

Nota: Anche essere sicuri di creare __init__.py file per i pacchetti (Nella tua domanda li hai nominati init.py).

+0

che ha funzionato per me, grazie! Non conoscevo nessuna scansione ricorsiva prima. – Manas

+0

Si potrebbe "accettare" la risposta se fosse utile .-) – knitti

9

Stai già utilizzando setuptools modo da poter importare find_packages per ottenere tutti i pacchetti sotto:

from setuptools import setup, find_packages 
setup(
    ... 
    packages=find_packages(), 
    ... 
) 
Problemi correlati