Change default dist folder with setuptools

送分小仙女□ 提交于 2019-11-29 11:36:30

问题


I'm using setuptools 0.6 to package my code. By default when I type python setup.py sdist, the tool creates a folder dist directly in the same folder of my script. What I can do to change this default folder? Edit: Another question is, if my setup script and my package folder are not in the same folder, what can I do to specify the exact path of the package? Thanks


回答1:


Use the --dist-dir=[differentdir] option. From python setup.py sdist --help:

  --dist-dir (-d)   directory to put the source distribution archive(s) in
                    [default: dist]

You can specify the top-level package directory with the package_dir keyword argument to setup():

package_dir = {'': 'src'},

I can recommend the Python Packaging User Guide for a good tutorial on how to package your python projects.



来源:https://stackoverflow.com/questions/13643167/change-default-dist-folder-with-setuptools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!