prometheus / prometheus/client_python

Unbundle the `decorator` dependency, or at least upgrade it

未关闭
#1,107 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
4.4k
派生
876
平均合并
8 天 4 小时
30 天内合并 PR
1

描述

Hi,

In #91 years ago, it was decided to add the decorator to fix a problem. Back then choices was made to not add a new dependency, but really bundle the only decorar file needed. Distributions (in my case Fedora) usually prefer to rely on the actual package than bundled dependencies. Fedora does apply a patch to unbundle decorator, maybe other distro do that too.

Do we still want to avoid dependencies in 2025 ? I have seen other discussions where it was discussed adding a protobuf dependency, which pulls many more dependencies, so isn't ok now to depend on decorator ?

If not, would it make sense at least to upgrade it ? By doing so, you hit the issue that decorator.getargspec has been removed years ago. In python 3 there is now inspect.getfullargspec which is not strictly equivalent but does provide a similar feature. Fedora uses a minimal patch here: https://src.fedoraproject.org/rpms/python-prometheus_client/blob/rawhide/f/0001-Remove-the-bundled-decorator-package.patch#_506 but tries to avoid adding much code, most likely the "real" change is more verbose.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

Issue 中没有指明任何 repository 文件或测试。首先检查当前 bundled decorator 实现和链接的 Fedora unbundling patch,然后确定项目将依赖外部 package,还是保留更新后的 bundled 版本。选定的依赖策略能够在当前 Python 版本上正常工作,并且其兼容性由现有测试套件覆盖,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
build-system
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。