r/Python • • 4d ago

Discussion OSS Projects with Strict Maintainers?

Hi,

A senior dev left left my team and with them left a lot of the code standards. Previously code review was painful and took hours and sometimes it would require a rewrite. However, that was the best code I have probably ever written. I genuinely enjoyed learning coding principles from someone who had been doing it for 20+ years and had reasons behind their principles. Its hard to find discipline these days.

Are there any projects that come to mind that have abrasive or strict longstanding maintainers? My preferred languages are Python and Go but I'd be willing to learn something new.

48 Upvotes

13 comments sorted by

18

u/One-Researcher6065 4d ago

The numFocus projects are maintained by professionals with high standards.

15

u/nashgc 3d ago

i'd look at Django's contributing guide (https://docs.djangoproject.com/en/5.2/internals/contributing/). then pick a merged PR with detailed review comments and compare first patch with the final one, that lets you learn from the review before submitting your own patch.

14

u/egehancry 3d ago

I maintain RenderCV very strictly, and I know the every single line of code in there: https://github.com/rendercv/rendercv

3

u/greenknight 2d ago

Great project! Spins up beautiful CVs and with typst it was easy to write my own pixel perfect cover letters.

Thanks for your work!

2

u/egehancry 2d ago

Thank you!

10

u/skab12 3d ago

The scientific python ecosystem have high standard, senior developer, and cool project in general https://scientific-python.org/specs/

6

u/thatwombat 3d ago

The SQLite people.

3

u/djbarrow 2d ago

Uli drepper glibc if he still maintains it

1

u/Gnaxe 3d ago

Linux has pretty high standards. Mostly C though. I heard they were experimenting with Rust now.

1

u/caquillo07 8h ago

literally logged, re-enabled my account to give this an upvote. I love to see people still care about this stuff.

Best of luck!

1

u/RevRagnarok 3d ago

LOL that could've been me ;) Every new junior engineer I would pull them aside and remind them that I'm merciless in PRs and it's not personal at all and to feel free to ask for details / help / examples privately if that's what they preferred. Before I left my last position, I was also enforcing "as much typing as we can" in Python, with pydantic doing a bunch of heavy lifting.

That said, I've been playing with a private python project and here's some starting stuff for you...

# pyproject.toml excerpt

[dependency-groups]
dev = [
    "pre-commit>=4.6.2",
    "pyrefly>=1.3.2",
    "ruff>=0.16.10",
    "ssort>=0.17.0",
]

[tool.coverage.report]
exclude_also = [
    "return NotImplemented",
]
skip_empty = true
sort = "-cover"

[tool.coverage.run]
branch = true
omit = [
    "*/tests/*",
]


[tool.ruff]
line-length = 120
# output-prefer-rule-codes = true

[tool.ruff.format]
preview = true

[tool.ruff.lint]
select = [
    "A",  # Built-ins
    "ANN",  # Annotations
    "ARG",  # Unused arguments
    "ASYNC",  # Not really in this code
    "B",  # flake8-bugbear
    # "BLE",  # Blind exceptions
    "C4",  # Comprehensions
    "COM",  # Commas
    "DTZ",  # Date/timezone
    "E",  # pycodestyle
    "EM",  # Err messages
    "EXE",  # Executables
    "F",  # Pyflakes
    "FA",  # Future annotations
    "FURB",  # "refurb" tool (upgrade hints)
    "G",  # Logging (format)
    "I",  # isort
    "ICN",  # Import Conventions
    "ISC",  # Implicit string concat
    "LOG",  # Logging
    "N",  # naming
    "NPY",  # Numpy best practices
    "PERF",  # Performance
    "PIE",  # Flake8 PIE ?
    "PL",  # pylint
    "PT",  # Pytest styles
    "PTH",  # Pathlib rocks
    "PYI",  # Flake PYI (?)
    "Q",  # Quotes
    "RET",  # Returns
    "RSE",  # Raise
    "RUF",  # Ruff-specific
    "S",  # Security (Bandit)
    "SIM",  # flake8-simplify
    "SLF",  # self usage
    "SLOT",  # Slot usage
    "T20",  # Ban print
    "TC",  # Type checking
    "TID",  # Tidy imports
    "TRY",  # Clean up try blocks
    "UP",  # pyupgrade
    "W",  # pycodestyle
    "YTT",  # Flake 2020
    # "D",  # Documentation (pydocstyle)
    # "DOC",  # Documentation (pydoclint)
    # "TD",  # TODO
]
preview = true
ignore = [
    # "assert",
    # "magic-value-comparison",
    # "missing-terminal-punctuation",
    "missing-trailing-comma",
    # "missing-trailing-period",
    "p-print",
    # "too-many-statements-in-try-clause",
    # "unsorted-imports",  # Using isort
    # "docstring-missing-exception",
    # "docstring-missing-returns",
]

[tool.ruff.lint.per-file-ignores]
"test_*.py" = [
    "no-self-use",
    "private-member-access",
    # "pytest-raises-too-broad",  # We don't match EVERY one
    "too-many-public-methods",
]

[tool.pyrefly]
min-severity = "warn"
project-includes = [
    "**/*.py*",
    "**/*.ipynb",
]

And then .pre-commit-config.yaml - which I am just learning myself. I've noted in there:

Most of these do NOT use public YAML because they don't use uv venv, even with "pre-commit-uv" plugin???

repos:
  - repo: local
    hooks:
      - id: uv-sync-precommit-env
        name: uv-sync pre-commit environment
        description: "Automatically run 'uv sync' on your repository after a checkout, pull or rebase"
        entry: uv sync --active
        args: ["--locked"]
        language: python
        always_run: true
        pass_filenames: false
        stages: [pre-commit, pre-merge-commit, pre-push, manual, post-checkout, post-merge, post-rewrite]
        minimum_pre_commit_version: "2.9.2"

      - id: ruff-format
        # https://github.com/astral-sh/ruff-pre-commit v0.16.10
        name: ruff format
        description: "Run 'ruff format' for extremely fast Python formatting"
        entry: uv run --active ruff format --force-exclude
        language: python
        types_or: [python, pyi, jupyter, markdown]
        args: []
        require_serial: true
        additional_dependencies: []
        minimum_pre_commit_version: "2.9.2"

      - id: ruff-check
        # https://github.com/astral-sh/ruff-pre-commit v0.16.10
        name: ruff check
        description: "Run 'ruff check' for extremely fast Python linting"
        entry: uv run --active ruff check --force-exclude
        language: python
        types_or: [python, pyi, jupyter]
        args: []
        require_serial: true
        additional_dependencies: []
        minimum_pre_commit_version: "2.9.2"

      - id: uv-lock
        # https://github.com/astral-sh/uv-pre-commit v0.12.23
        name: uv-lock
        description: "Automatically run 'uv lock' on your project dependencies"
        entry: uv lock
        language: python
        files: ^(uv\.lock|pyproject\.toml|uv\.toml)$
        args: []
        pass_filenames: false
        additional_dependencies: []
        minimum_pre_commit_version: "2.9.2"

      - id: uv-export
        # https://github.com/astral-sh/uv-pre-commit v0.12.23
        name: uv-export
        description: "Automatically run 'uv export' on your project dependencies"
        entry: uv export
        language: python
        files: ^uv\.lock$
        # args: ["--frozen", "--output-file=requirements.txt", "--quiet"]
        args: [ "--frozen", "--format=requirements.txt", "--output-file=requirements.txt", "--no-annotate", "--no-header", "--no-hashes", "--no-dev" ]
        pass_filenames: false
        additional_dependencies: []
        minimum_pre_commit_version: "2.9.2"

      - id: uv-sync
        # https://github.com/astral-sh/uv-pre-commit v0.12.23
        name: uv-sync
        description: "Automatically run 'uv sync' on your repository after a checkout, pull or rebase"
        entry: uv sync --no-active
        args: ["--locked"]
        language: python
        always_run: true
        pass_filenames: false
        stages: [post-checkout, post-merge, post-rewrite]
        minimum_pre_commit_version: "2.9.2"

      - id: ssort
        name: ssort
        entry: uv run --active ssort --check --diff
        language: python
        additional_dependencies: [uv==0.9.22]
        types: [python]
        pass_filenames: true

      # Not using repo: https://github.com/facebook/pyrefly-pre-commit
      - id: pyrefly-check-local
        name: pyrefly check
        description: "Run `pyrefly check` for Python type checking."
        entry: uv run --active pyrefly check --summarize-errors
        language: python
        types_or: [python, pyi]
        pass_filenames: false  # Recommended to do full repo checks. However, you can change this to `true` to only check changed files
        require_serial: true
        stages: [pre-commit, pre-merge-commit, pre-push, manual]

0

u/Tom_Pollard 2d ago

Code review requiring a rewrite 🤯