如何从 Conda 项目创建 setuptools sdist .tar.gz 包?

发布于 2025-01-14 09:50:27 字数 748 浏览 3 评论 0 原文

我有一个 PyTorch 培训项目,其中使用 conda 管理依赖项。我需要将我的项目打包为 setuptools 软件分发 (sdist) 放在 .tar.gz 文件中,以便我可以将其作为 Google Cloud Platform 的 Vertex.AI Training 服务中的自定义作业运行。

我找到了一个官方指南,解释了 如何使用 Conda 生成 bdist 包,但我认为我不能在 Vertex.AI 中使用它。

是否有用于生成 sdist 发行版的 Conda 命令?或者我可以使用任何其他工具来自动完成此操作吗?

请注意:我知道我可以在我的 setuptools setup.py 文件,但我不想这样做,因为手动维护同一列表的两个副本可能会链接到同步问题和错误。

I have a PyTorch training project where dependencies are managed using conda. I need to package my project as a setuptools software distribution (sdist) in a .tar.gz file so that I can run it as a custom job in Google Cloud Platform's Vertex.AI Training service.

I've found an official guide that explains how to generate a bdist package using Conda but I don't think I can use that in Vertex.AI.

Is there a Conda command for generating an sdist distribution? Or are there any other tools I can use to get this done automatically?

Please note: I know I can manually recreate the list of dependencies in my setuptools setup.py file but I would rather not do that because manually maintaining two copies of the same list could link to sync issues and errors.

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

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

发布评论

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

评论(1

不再见 2025-01-21 09:50:27

您可以使用 python setuptools 来实现它。在 vertex ai 文档中,有关使用 Setuptools构建一个与 Vertex AI 一起使用的源发行版,有关于如何实现它的完整指南。

它为您提供了在处理自己的软件包时要考虑的步骤:

  • 按照 开始之前应用程序结构
  • 创建您的设置。
  • 添加依赖项(可以是 Python 或自定义依赖项 - 如果有)
  • 设置 Python 模块(如果有)
  • 将源代码分发上传到 Cloud Storage

注意:Vertex AI 建议使用一些替代方案,如 创建源代码分发的替代方案

You can use python setuptools to achieve it. On vertex ai documentation about using Setuptools to build a source distribution to use with Vertex AI there is a complete guide on how to achieve it.

Its provide you with this steps to consider when dealing with your own packages:

  • Follow the instructions on Before you begin and Application structure
  • Create your setup.
  • Add dependencies ( Could be Python or Custom dependencies - If any )
  • Setup Python Modules ( If any )
  • Upload your source distribution to Cloud Storage

Note: Vertex AI suggest some alternatives to it as described on Alternatives to creating a source distribution.

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