python - python setup.py sdist bdist_wheel 的输出目录

标签 python package setuptools sdist

做的时候

python setup.py sdist bdist_wheel
它创建 build , dist , packagename.egg-info目录。我想将它们从当前文件夹中删除。
我试过:
  • --dist-dir=../dist : 与 sdist 一起使用但是 packagename.egg-info还在
  • --bdist-dir=../dist : 例如:
       python setup.py sdist bdist_wheel --dist-dir=../dist  --bdist-dir=../dist2
    
    工作,最终的 bdist 包在 ../dist .但当前文件夹仍然获得新目录 build , dist , packagename.egg-info ,这是我不想要的。

  • 问题:如何将所有内容(sdist 和 bdist_wheel 的输出)放在当前文件夹之外?
    当然我可以用mv写一个脚本, rm -r等,但我想知道是否存在内置解决方案。

    最佳答案

    我用 -d 再次尝试了一段时间, --dist-dir , --bdist-dir但我发现没有办法在一行中做到这一点。
    恐怕我们能找到的最短时间(在 Windows 上)是:

    python setup.py sdist bdist_wheel
    rmdir /s /q packagename.egg-info build ..\dist
    move dist ..
    

    关于python - python setup.py sdist bdist_wheel 的输出目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64952572/

    相关文章:

    python - 使用 setup.py 安装的脚本引发 ImportError

    python - 无法将 Django 应用程序连接到外部 PostgreSQL 数据库

    python - 基于外键的 Django 选择

    python - 如何在sqlalchemy中选择多列联接的特定列?

    python - 来自 requirements.txt 的 Python 包的磁盘缓存

    python - setuptools 'entry_points' 参数使用

    python - 在pypi中重命名项目的推荐方法是什么?

    python - 了解有关 DataFrame 操作的 Dask 分布式行为

    centos - 如何使用 yum 搜索或获取远程包的信息

    r - 有没有办法避免每次在 R 中安装软件包?