i am using setuptools to create and upload a sdist package to PyPI.
however everytime i run python setup.py sdist, it includes the dist/ folder and its contents, which i dont want . this behavoir does NOT happen when i use distutils.
here is my file structure:
/
-myModule/
--__init_.py,
-- ...
-docs/
-examples/
-dist/
setup.py
this is also my svn trunk root. here is my setup.py
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
setup(name='mymodule',
version='1.0',
license='gpl',
description='blahn',
author='me',
author_email='myemail',
url='http://code.google.com/p/mymodule/',
packages= find_packages(),
install_requires = [
开发者_开发百科 'numpy>=1.3.0',
'scipy>=0.7.1',
'matplotlib>=1.0.0'
],
)
when see this output, which indicates the problem
python setup.py sdist
...
making hard links in mwavepy-1.0...
hard linking MANIFEST.in -> mwavepy-1.0
hard linking ez_setup.py -> mwavepy-1.0
hard linking setup.py -> mwavepy-1.0
hard linking dist/mwavepy-1.0.tar.gz -> mwavepy-1.0/dist
hard linking dist/mwavepy-1.0.win32.exe -> mwavepy-1.0/dist
hard linking dist/mwavepy-1.0.zip -> mwavepy-1.0/dist
hard linking doc/generate_docs.py -> mwavepy-1.0/doc
hard linking doc/mwavepy.calibration.html -> mwavepy-1.0/doc
hard linking doc/mwavepy.calibrationAlgorithms.html -> mwavep
...
Try to remove find_packages()
statement and replace it with
setup(
...
packages = ['myModule'],
package_dir = {'myModule' : 'myModule_path'},
...)
You could alternatively pass an argument to find_packages()
:
setup(
#...
packages= find_packages(exclude='dist'),
# ...
)
This happened for me, until I ran svn rm dist/foo.tar.gz
, and then it wasn't hard-linked anymore, and wasn't in the resulting tarball. The documentation for setuptools does mention different behavior based on whether a file is under CVS or SVN control:
include_package_data
If set to True, this tells setuptools to automatically include any data files it finds inside your package directories, that are either under CVS or Subversion control, or which are specified by your MANIFEST.in file.
精彩评论