您如何管理您的自定义模块?

发布于 2024-07-05 19:22:45 字数 1449 浏览 6 评论 0原文

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

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

发布评论

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

评论(3

嘿咻 2024-07-12 19:22:45

我也一直在做同样的事情。 提取常用功能,用额外的文档和单元测试/文档测试来美化代码,创建一个 easy_install setup.py,然后在 PyPi 上发布。 最近,我创建了一个 Google 代码网站,我可以在其中管理源代码并保持 wiki 的运行迄今为止。

I have been doing the same thing. Extract common functionality, pretty the code up with extra documentation and unit tests/ doctests, create an easy_install setup.py, and then release on PyPi. Recently, I created a single Google Code site where I manage the source and keep the wiki up to date.

美人骨 2024-07-12 19:22:45

我们在这里谈论什么样的模块? 如果您计划将您的项目分发给其他 python 开发人员,setuptools 是很棒的选择。 但这通常不是向最终用户分发应用程序的好方法。 在后一种情况下,最好的选择是根据您要分发的平台定制您的包装。 当然,这很痛苦,但它使最终用户的生活变得更加轻松。

例如,在我的 Debian 系统中,我通常不使用 easy_install,因为让 Egg 与包管理器良好配合有点困难。 在 OS X 和 Windows 中,您可能希望分别使用 py2app 和 py2exe 来打包所有内容。 这使最终用户的生活更加美好。 毕竟,他们不应该知道或关心您的脚本是用什么语言编写的。他们只需要安装它们。

What kind of modules are we talking about here? If you're planning on distributing your projects to other python developers, setuptools is great. But it's usually not a very good way to distribute apps to end users. Your best bet in the latter case is to tailor your packaging to the platforms you're distributing it for. Sure, it's a pain, but it makes life for end users far easier.

For example, in my Debian system, I usually don't use easy_install because it is a little bit more difficult to get eggs to work well with the package manager. In OS X and windows, you'd probably want to package everything up using py2app and py2exe respectively. This makes life for the end user better. After all, they shouldn't know or care what language your scripts are written in. They just need them to install.

墨小沫ゞ 2024-07-12 19:22:45

我将其全部离线存储在逻辑目录结构中,并将常用模块分组为实用程序。 这意味着可以更轻松地控制我发布和管理的版本。 我还自动化构建过程来解释逻辑目录结构。

I store it all offline in a logical directory structure, with commonly used modules grouped as utilities. This means it's easier to control which versions I publish, and manage. I also automate the build process to interpret the logical directory structure.

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