setuptools 在构建中包含 dist/ 文件夹
我正在使用 setuptools 创建 sdist 包并将其上传到 PyPI。
但是每次我运行 python setup.py sdist 时,它都会包含 dist/ 文件夹及其内容,这是我不想要的。当我使用 distutils 时,这种行为不会发生。
这是我的文件结构:
/
-myModule/
--__init_.py,
-- ...
-docs/
-examples/
-dist/
setup.py
这也是我的 svn 主干根目录。这是我的 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'
],
)
当看到这个输出时,这表明了问题
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
...
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
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试删除
find_packages()
语句并将其替换为Try to remove
find_packages()
statement and replace it with您也可以将参数传递给
find_packages()
:You could alternatively pass an argument to
find_packages()
:这发生在我身上,直到我运行 svn rm dist/foo.tar.gz ,然后它不再是硬链接,并且不在生成的 tarball 中。 setuptools 的文档确实提到了基于是否文件受 CVS 或 SVN 控制:
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: