告诉HN:我分叉并重新发布了一个受欢迎的、被遗弃的Python库

1作者: zahlman22 天前原帖
`stringcase` 包在 PyPI 上相当受欢迎,日下载量约为 15 万次。然而,自 2023 年 6 月以来没有任何活动迹象,当时仅仅是合并了一个导致测试失败的拉取请求。作者最后的更改似乎是在 2017 年 8 月最后一次 PyPI 发布后的几天。尽管它是一个单文件的 Python 实现且没有依赖关系,但从未发布过 wheel 文件。(如果你认为这不需要构建步骤,请阅读 [2]。) 然后,像许多其他不使用 `pyproject.toml` 文件或不发布 wheel 的“遗留”项目 [3] 一样,它在 Setuptools 78.0.1 下构建失败,因此也阻止了所有依赖它的项目的安装。 作为一种未来保障措施,我重新发布了该项目为 `stringcase-new` [4][5]。(作为“深度防御”,我还将项目的打包迁移到了 Flit ;))Python 代码的导入名称保持不变;如果你受到影响,只需在依赖规范中将 `stringcase` 添加 `-new`。版本控制也旨在保持连续性。1.2.2 版本的行为应与 1.2.0 相同,以防你需要与现代打包兼容的版本;1.2.3 将包含作者显然计划的 1.2.1 修复,以及来自社区的适当错误修复。 我对此持相当保守的态度。如果你想要修复和额外功能,并且不介意不同的导入名称,你可能更愿意切换到 Casefy [6],它也已成为一个受欢迎的项目 [7]。 恢复 PyPI 上被遗弃项目名称的过程 [8] 可能需要很长时间,但我受到鼓励去跟进。如果我最终能够在 PyPI 上获得 `stringcase` 的名称,我将重建发布(以修复元数据)并在原始名称下提供它们。 如果你知道有任何项目依赖于 `stringcase` 的人,包括间接依赖,请告知他们。一个主要的依赖项目是 `frictionless` [9],他们显然决定将 `stringcase` 嵌入到自己的代码中 [10]。(请记住,如果你固定或限制 `frictionless` 的版本,你将无法保证未来的兼容性。) 我还想特别感谢 Pip 维护团队的 Damian Shaw [11],感谢他在协调讨论(以及对现有讨论的贡献)方面所做的非凡努力(例如 [12]),这些讨论围绕着允许从 Setuptools 中删除一个微不足道的、已被弃用多年的特性而引发的根本问题。这不仅仅是关于 Setuptools 的政策和被遗弃的项目:其他构建后端可以从中学习,构建前端(包括安装程序)可以为在构建隔离中使用的构建后端版本提供更好的覆盖,双方可以协调以使弃用警告对开发者更加可见。 希望有一天,Setuptools 真的能成为一个仅仅是构建后端的工具,就像它似乎想要的那样 [13]。
查看原文
The `stringcase` package on PyPI [0] is fairly popular, on the order of 150k daily downloads [1]. However, there has been no sign of activity since June of 2023, and that was only to merge a pull request that breaks tests. The author&#x27;s own last changes appear to have been a few days after the last PyPI release, in August 2017. A wheel was never distributed, despite being a single-file Python implementation with no dependencies. (If you think that shouldn&#x27;t require a build step, please read [2].)<p>And then, like many other &quot;legacy&quot; projects [3] not using a `pyproject.toml` file or distributing a wheel, it failed to build under Setuptools 78.0.1 , therefore also blocking the installation of all its dependents.<p>As a future-proofing measure, I&#x27;ve re-released the project as `stringcase-new` [4][5]. (As &quot;defense in depth&quot;, I&#x27;ve also migrated the project&#x27;s packaging to Flit ;) ) The import name for Python code is untouched; if you&#x27;re affected, you need only add `-new` to `stringcase` in your dependency specifications. Versioning is also intended to maintain continuity. The 1.2.2 release should behave identically to 1.2.0, just in case you need a bug-compatible version with modern packaging; 1.2.3 will incorporate the author&#x27;s apparent planned fixes for 1.2.1, as well as bugfixes from the community where appropriate.<p>I&#x27;m trying to be quite conservative with this. If you want fixes and additional functionality, and don&#x27;t mind a different import name, you may prefer to switch to Casefy [6], which has become popular in its own right [7].<p>The process [8] for recovering names on PyPI for abandoned projects can take a very long time, but I&#x27;ve been encouraged to follow up on that. If I ever do get the `stringcase` name on PyPI I will rebuild the releases (to fix metadata) and make them available under the original name as well.<p>If you know anyone with a project depending on `stringcase`, including transitively, please let them know. One major dependent is `frictionless` [9], who apparently have decided to vendor `stringcase` [10]. (Keep in mind you are not future-proofed if you pin or cap the `frictionless` version.)<p>I&#x27;d also like to specifically thank Damian Shaw [11] of the Pip maintenance team for extraordinary efforts (e.g. [12]) in coordinating discussion (and contributions to existing discussion) around the underlying problems that allowed removal of a trivial, years-deprecated feature from Setuptools to be so disruptive. This isn&#x27;t just about Setuptools&#x27; policies and abandoned projects: other build backends can learn from this, build frontends (including installers) can offer better overrides for build backend versions used in build isolation, and both sides can coordinate to make deprecation warnings more visible to developers.<p>And hopefully, maybe, one day Setuptools will become <i>just</i> a build backend, like it seemingly wants to be [13].<p>[0]: https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;stringcase<p>[1]: https:&#x2F;&#x2F;pypistats.org&#x2F;packages&#x2F;stringcase<p>[2]: https:&#x2F;&#x2F;pradyunsg.me&#x2F;blog&#x2F;2022&#x2F;12&#x2F;31&#x2F;wheels-are-faster-pure-python<p>[3]: https:&#x2F;&#x2F;github.com&#x2F;pypa&#x2F;setuptools&#x2F;issues&#x2F;4910<p>[4]: https:&#x2F;&#x2F;github.com&#x2F;zahlman&#x2F;stringcase-new<p>[5]: https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;stringcase-new<p>[6]: https:&#x2F;&#x2F;github.com&#x2F;dmlls&#x2F;python-casefy<p>[7]: https:&#x2F;&#x2F;pypistats.org&#x2F;packages&#x2F;casefy<p>[8]: https:&#x2F;&#x2F;peps.python.org&#x2F;pep-0541&#x2F;#how-to-request-a-name-transfer<p>[9]: https:&#x2F;&#x2F;github.com&#x2F;frictionlessdata&#x2F;frictionless-py<p>[10]: https:&#x2F;&#x2F;github.com&#x2F;frictionlessdata&#x2F;frictionless-py&#x2F;pull&#x2F;1727<p>[11]: https:&#x2F;&#x2F;github.com&#x2F;notatallshaw<p>[12]: https:&#x2F;&#x2F;discuss.python.org&#x2F;t&#x2F;_&#x2F;85847<p>[13]: https:&#x2F;&#x2F;blog.ganssle.io&#x2F;articles&#x2F;2021&#x2F;10&#x2F;setup-py-deprecated.html