as3rdaccount
as3rdaccount

Reputation: 3951

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='[email protected]'
   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?

Upvotes: 0

Views: 1255

Answers (1)

Ned Deily
Ned Deily

Reputation: 85055

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, e.g. 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.

Upvotes: 4

Related Questions