我使用哪些 Python Trove 分类器?

发布于 2025-01-05 05:34:28 字数 997 浏览 0 评论 0原文

Trove 分类器列表位于: http://pypi.python.org/pypi?:action =list_classifiers

当我创建 PyPI 包时,我不确定是否需要将“父级”包含到显然适用于我的项目的 trove 分类器中。

例如,如果我在 Windows XP 上测试了我的项目,那么我应该包括以下哪一项:

'Operating System :: Microsoft',
'Operating System :: Microsoft :: Windows',
'Operating System :: Microsoft :: Windows :: Windows NT/2000',

我实际上只在 Window 7 上测试过,有时在 Windows XP 上测试过。但这些都不是分类器列表中的选项,因此我选择“NT/2000”作为结束匹配,并包括“父”分类器。这是正确的做法吗?

同样,如果我的项目是在 Python 2.7 下测试的,那么我显然包含分类器:

'Programming Language :: Python :: 2.7',

我是否还需要包含:

'Programming Language :: Python',
'Programming Language :: Python :: 2',

如果原始分类器第一个是严格的“父级”,那么是否包含它大概与是否包含相同包括上面的“Windows”父母。

但请注意,“Python :: 2”不是“2.7”分类器的父级 - 它是同级分类器。如果它旨在表明我的项目在某些 2.x Python 版本下运行,则包含它是有意义的,但如果它旨在暗示我的项目在所有下运行,则包含它是有意义的2.x 版本。

The list of Trove classifers is at: http://pypi.python.org/pypi?:action=list_classifiers

When I'm creating a PyPI package, I'm unsure whether I need to include the 'parents' to the trove classifiers that obviously apply to my project.

For example, if I've tested my project on Windows XP, then which of the following should I include:

'Operating System :: Microsoft',
'Operating System :: Microsoft :: Windows',
'Operating System :: Microsoft :: Windows :: Windows NT/2000',

I've only actually tested on Window 7, or sometimes Windows XP. But neither of these are options in the classifier list, so I'm choosing "NT/2000" as the closes match, and including the 'parent' classifiers. Is this the right thing to do?

Similarly, if my project is tested under Python 2.7, then I obviously include the classifier:

'Programming Language :: Python :: 2.7',

Do I need to also include:

'Programming Language :: Python',
'Programming Language :: Python :: 2',

The first is a strict 'parent' if the original classifier, so whether to include this is presumably the same as whether to include the "Windows" parents above.

Note, however, that "Python :: 2" isn't a parent of the "2.7" classifier - it's a sibling. Including it would make sense if it is intended to indicate that my project works under some 2.x Python releases, but not if it's intended to imply that my project works under all 2.x releases.

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

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

发布评论

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

评论(1

沙沙粒小 2025-01-12 05:34:28

从技术上讲,您不需要包含父标签。例如 lxml 列出了这些标签(但没有它们的父标签):

Topic :: Text Processing :: Markup :: HTML
Topic :: Text Processing :: Markup :: XML 

并浏览到分类为 主题::文本处理::标记,包括lxml。

我不确定包含父标签是否会让用户更清楚。

我将Programming Language :: Python :: 2 表示一些 Python 2.x 版本,而不是全部 Python 2.x - 并且它似乎很多项目都这样使用它(例如再次 lxml )。

至于操作系统,我会用它来定义包预期工作的内容,而不仅仅是您已经能够测试的环境。因此,我只会将 Windows 分类器用于特定于 Windows 的工具,该工具无法在其他操作系统上运行。它不构成支持合同。

Windows 和 Windows NT/2000 标签现在可能大致相同。

Technically, you don't need to include parent tags. For instance lxml lists these tags (but none of their parents):

Topic :: Text Processing :: Markup :: HTML
Topic :: Text Processing :: Markup :: XML 

And browsing to the list of packages classified Topic :: Text Processing :: Markup, lxml is included.

Whether including parent tags makes it any clearer to users, I'm not sure.

I would take Programming Language :: Python :: 2 to mean some Python 2.x releases, not all Python 2.x - and it seems many projects use it like this (e.g. lxml again).

As for operating system, I'd use it to define what the package is expected to work on, not only the environments you've been able to test. So I'd only use a Windows classifier for a Windows-specific tool that couldn't work on other operating systems. It doesn't constitute a support contract.

The Windows and Windows NT/2000 tags are probably about equivalent by now.

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