【问题标题】:Change default dist folder with setuptools使用 setuptools 更改默认 dist 文件夹
【发布时间】:2012-11-18 13:16:00
【问题描述】:

我正在使用setuptools 0.6 来打包我的代码。默认情况下,当我键入 python setup.py sdist 时,该工具会直接在我的脚本的同一文件夹中创建一个文件夹 dist。我可以做些什么来更改这个默认文件夹? 编辑:另一个问题是,如果我的安装脚本和我的包文件夹不在同一个文件夹中,我该怎么做才能指定包的确切路径? 谢谢

【问题讨论】:

    标签: python directory packaging setuptools


    【解决方案1】:

    使用--dist-dir=[differentdir] 选项。来自python setup.py sdist --help

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

    您可以使用package_dir 关键字参数指定顶级包目录setup()

    package_dir = {'': 'src'},
    

    我可以推荐 Python Packaging User Guide 以获得有关如何打包 Python 项目的好教程。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-30
      • 2023-03-23
      • 2010-09-08
      • 2013-01-07
      • 1970-01-01
      • 1970-01-01
      • 2019-08-15
      相关资源
      最近更新 更多