如何使 setuptools 尊重 .gitignore?

发布于 2025-01-15 20:31:40 字数 441 浏览 3 评论 0原文

我有以下目录结构:

lib/
   lib/
      pkg1/
         __init__.py
      pkg2/
         __init__.py
      data/ # has many subdirectories and files
   tests/
   .gitignore
   setup.py

data 文件夹(不是包)包含文件和其他子文件夹,其中一些由于 .gitignore 而被排除在 git 存储库之外。

我想要 python setup.py bdist_wheel 这个项目并将文件包含在 data 中,但我不想要任何 .gitignore 文件在最后的轮子里。 setuptools 支持吗?

I have the following directory structure:

lib/
   lib/
      pkg1/
         __init__.py
      pkg2/
         __init__.py
      data/ # has many subdirectories and files
   tests/
   .gitignore
   setup.py

The data folder (not a package) has files and other subfolders, and some of them are excluded from the git repo due to .gitignore.

I want to python setup.py bdist_wheel this project and include the files in data, but I don't want any .gitignore'd file in the final wheel. Does setuptools support that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡看悲欢离合 2025-01-22 20:31:40

setuptools 支持吗?

不,事实并非如此。也许使用额外的库,例如 pbrsetuptools-scm 位于 setuptools 之上。

Does setuptools support that?

No, it does not. Maybe with an additional library such as pbr or setuptools-scm on top of setuptools.

青瓷清茶倾城歌 2025-01-22 20:31:40

您可以使用 setuptools_scm 代替。

You can use setuptools_scm instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文