r/Python 3d ago

Discussion Contribution to pyperf

I am recently came across the library pyperf because I have to benchmark my changes in a certain open source project to add metrics to the PR I was creating for the changes, but one thing I feel off is types, I don't know why but pyperf has lot of unknown types which is kind of weird so I was planning to contribute to it to make it a little bit better typed.

So I am wondering do projects like pyperf which comes under pdf accept contribution in generally? If there are any maintainers/contributors of pyperf here then then could answer my question.

Thanks in advance.

My Dev Environment

OS: Windows

Type Checker: Pyrefly

10 Upvotes

13 comments sorted by

View all comments

2

u/11krish11 2d ago

Yes, PSF-managed projects generally welcome community contributions, but for type annotations, the best approach is to open an issue or discussion on their GitHub repo first.

A few tips before submitting a PR:

  • Scope it incrementally: Instead of typing the entire codebase in one massive PR, propose adding types module-by-module. Large typing PRs are hard to review and often stall.
  • Align on tooling: Make sure your annotations pass their existing CI checks (typically mypy or pyright in strict mode) and support the project's minimum Python version.
  • Check prior discussions: Look through their closed PRs/issues to see if typing has been discussed or requested before so you can follow their preferred style conventions.

1

u/DxNovaNT 2d ago

Yeah I also want that way, as I am ok with long running task.

1

u/11krish11 2d ago

That's a great mindset to have for open source!

A good way to start is by picking a small, self-contained utility module first (something without too many circular imports) and submitting a draft PR. That gives the maintainers an easy first review and lets you establish the exact typing rules/patterns they prefer before tackling the core benchmark modules.

Good luck with the contribution!

1

u/DxNovaNT 2d ago

Well I raised an Issue for this, if I get a green light then I will start working.

1

u/11krish11 2d ago

Perfect, that's the best way to do it. Fingers crossed you get a quick response from the maintainers. Hope to see the PR merged soon!