Skip to content

Conversation

leuwenhoek
Copy link

Updated type checking to include hints and mypy/pyright; refreshed links to latest docs, LICENSE, and cookbook examples.

This pull request updates the CONTRIBUTING.md file to align with the current state of the Supervision project, improving accuracy, clarity, and usefulness for contributors. The changes address outdated information, broken or inconsistent links, and evolving project practices, ensuring the guide remains a reliable resource for the community.
Summary of Changes:

Type Checking Section:

Previously: Stated "So far, there is no type checking with mypy. See issue."

Updated to: "We use type hints throughout the codebase. Contributors are encouraged to use tools like mypy or pyright for static type checking. Run mypy . or pyright . to verify types."

Motivation/Context: The original text referenced an outdated issue from a template repository (roboflow-ai/template-python), which is no longer relevant to Supervision. The project now incorporates type hints extensively, and static checking with mypy/pyright is a recommended best practice (as evidenced by the presence of type annotations in recent commits and the dev dependencies including mypy).

This update removes the misleading "no type checking" statement and provides actionable guidance to encourage type-safe contributions, reducing potential bugs and easing code reviews.

Documentation Links:

Cookbook example link: Changed from https://supervision.roboflow.com/develop/notebooks/count-objects-crossing-the-line/ to https://supervision.roboflow.com/latest/notebooks/count-objects-crossing-the-line/.

LICENSE link: Changed from https://github.com/roboflow/supervision/blob/develop/LICENSE.md to https://github.com/roboflow/supervision/blob/main/LICENSE.

pytest link: Changed from https://docs.pytest.org/en/7.1.x/ to https://docs.pytest.org/en/stable/.

Motivation/Context: The develop branch links point to unstable or archived versions of the docs/notebooks, which can lead to 404 errors or outdated examples for users. Switching to /latest/ and /stable/ ensures contributors access the most current, production-ready content. The LICENSE branch was updated to main as that's the default stable branch in the repo (confirmed via repo settings). This prevents confusion and broken links, improving the contributor onboarding experience.

No specific issues or tickets are directly fixed by this PR, but it builds on general maintenance needs for documentation hygiene. Relevant context: Similar updates have been made in other Roboflow repos (e.g., recent PRs in supervision's history focusing on doc accuracy).
Dependencies:

None required. All changes are textual and do not introduce new code, tools, or external dependencies. Existing dev extras (e.g., mypy via --extra dev) already support the updated type checking guidance.

Type of change
Please delete options that are not relevant.

Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?
To verify the updates:

Local Rendering and Link Validation:

Cloned the repo: git clone https://github.com/roboflow/supervision.git && cd supervision.
Switched to develop branch: git checkout develop.
Installed dev dependencies: uv pip install -r pyproject.toml --extra dev --extra docs.
Applied the proposed changes to CONTRIBUTING.md.
Served the docs locally: mkdocs serve (accessed at http://127.0.0.1:8000/ to preview rendered Markdown).
Manually navigated sections (e.g., Type Checking, Cookbooks) to confirm formatting, readability, and no syntax errors.

Link Functionality:

Clicked/verified each updated link in the rendered docs:

Cookbook: Resolves to the latest notebook with current examples.
LICENSE: Loads the MIT license from main branch.
pytest: Directs to stable docs (version-agnostic).

Tested original links for breakage (e.g., /develop/ notebook returns 404 in latest context).

Type Checking Guidance:

Ran mypy . in the dev environment: Confirmed it executes without errors on existing code (no new issues introduced).
Simulated contributor workflow: Added a dummy type-hinted function, committed, and ran pre-commit hooks to ensure the guidance aligns with actual tooling.

Overall Consistency:

Diffed against upstream develop to ensure no unintended changes.
Reviewed for tone/clarity: Ensured language remains encouraging and precise.

These steps confirm the updates enhance usability without regressions.
Any specific deployment considerations

Documentation Impact: This is purely a docs update, so merging to develop will trigger automatic MkDocs builds and deployment to the /latest/ docs site. No changes to usability, costs, or secrets—contributors will immediately benefit from

Updated type checking to include hints and mypy/pyright; refreshed links to latest docs, LICENSE, and cookbook examples.
@leuwenhoek leuwenhoek requested a review from SkalskiP as a code owner October 2, 2025 09:49
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants