简体   繁体   中英

How to include setup.py in the built distribution

I have a typical project structure that looks as follows:

EngineEmulator        
    ship
        engine
            emulator
            mapping
            __init__.py
        tests
            emulator
            mapping
            __init__.py           
        setup.py
        MANIFEST.in
        setup.cfg
        README.rst

My setup.py looks as follows:

from setuptools import setup, find_packages
setup(
   name='Engine',
   version=1.0.0,
   description='Engine Project',      
   packages=find_packages(
   exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
   install_requires =['pycrypto', 
                      'kombu >=1.1.3'],
   author='Demo',
   author_email='demo@eliza.net'
   license='MIT',
   classifiers=[
    'Topic :: Demo Engine',
    'Development Status:: 3 - Iteration',
    'Programming Language :: Python -2.6'
]

)

My setup.cfg looks as follows:

[egg_info]
tag_build = .dev
tag_svn_revision = 1

[rotate]
#keep last 15 eggs, clean up order
match = .egg
keep = 15   

And My MANIFEST.in looks as follows:

include README.rst
include setup.py
recursive-include engine *

When I run python setup.py bdist the tar file it generates does not include the setup.py file. When I run pip install it complains the setup.py is missing. However when I did python setup.py sdist , it generates the tar file that has the setup.py. Any idea why?

Pip does not install Distutils dumb bdist format distributions . A more general distribution format is the sdist format which generally can be "built" for installation with any Python instance. An sdist is what would typically be uploaded to PyPI, particularly for pure Python distributions, eg contain no C code that would require a compiler on the target system. Current versions of pip can also install wheels , a smart bdist format which can include pure Python distributions or impure ones targeted at specific platforms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM