Skip to main content

Review repos for compliance to the Scientific-Python development guidelines

Project description

sp-repo-review provides checks based on the Scientific-Python Development Guide at scientific-python/cookie for repo-review.

This tool can check the style of a repository. Use like this:

uvx sp-repo-review[cli] <path to repository>

This will produce a list of results - green checkmarks mean this rule is followed, red x’s mean the rule is not. A yellow warning sign means that the check was skipped because a previous required check failed. Some checks will fail, that’s okay - the goal is bring all possible issues to your attention, not to force compliance with arbitrary checks. Eventually there might be a way to mark checks as ignored.

For example, GH101 expects all your action files to have a nice name: field. If you are happy with the file-based names you see in CI, you should feel free to simply ignore this check (you can specify ignored checks in pyproject.toml or by passing args to repo-review, see the repo-review docs).

All checks are mentioned at least in some way in the Scientific-Python Development Guide. You should read that first - if you are not attempting to follow them, some of the checks might not work. For example, the guidelines specify pytest configuration be placed in pyproject.toml. If you place it somewhere else, then all the pytest checks will be skipped.

This was originally developed for Scikit-HEP before moving to Scientific Python.

Extras

  • cli: Dependencies to run the CLI (not needed for programmatic access, like on Web Assembly)
  • pyproject: Include validate pyproject with schema store.
  • all: All extras

Other ways to use

You can also use GitHub Actions:

- uses: scientific-python/cookie@<version>

Or pre-commit:

- repo: https://github.com/scientific-python/cookie
  rev: <version>
  hooks:
    - id: sp-repo-review

If you use additional_dependencies to add more plugins, like validate-pyproject, you should also include "repo-review[cli]" to ensure the CLI requirements are included.

List of checks

General

  • PY001: Has a pyproject.toml
  • PY002: Has a README.(md|rst) file
  • PY003: Has a LICENSE* file
  • PY004: Has docs folder
  • PY005: Has tests folder
  • PY006: Has pre-commit config
  • PY007: Supports an easy task runner (nox, tox, pixi, etc.)

PyProject

  • PP002: Has a proper build-system table
  • PP003: Does not list wheel as a build-dep
  • PP004: Does not upper cap Python requires
  • PP005: Using SPDX project.license should not use deprecated trove classifiers
  • PP301: Has pytest in pyproject
  • PP302: Sets a minimum pytest to at least 6
  • PP303: Sets the test paths
  • PP304: Sets the log level in pytest
  • PP305: Specifies xfail_strict
  • PP306: Specifies strict config
  • PP307: Specifies strict markers
  • PP308: Specifies useful pytest summary
  • PP309: Filter warnings specified

Documentation

  • RTD100: Uses ReadTheDocs (pyproject config)
  • RTD101: You have to set the RTD version number to 2
  • RTD102: You have to set the RTD build image
  • RTD103: You have to set the RTD python version
  • RTD104: You have to specify a build configuration now for readthedocs.

GitHub Actions

  • GH100: Has GitHub Actions config
  • GH101: Has nice names
  • GH102: Auto-cancel on repeated PRs
  • GH103: At least one workflow with manual dispatch trigger
  • GH104: Use unique names for upload-artifact
  • GH200: Maintained by Dependabot
  • GH210: Maintains the GitHub action versions with Dependabot
  • GH211: Do not pin core actions as major versions
  • GH212: Require GHA update grouping

MyPy

  • MY100: Uses MyPy (pyproject config)
  • MY101: MyPy strict mode
  • MY102: MyPy show_error_codes deprecated
  • MY103: MyPy warn unreachable
  • MY104: MyPy enables ignore-without-code
  • MY105: MyPy enables redundant-expr
  • MY106: MyPy enables truthy-bool

Pre-commit

  • PC100: Has pre-commit-hooks
  • PC110: Uses black or ruff-format
  • PC111: Uses blacken-docs
  • PC140: Uses a type checker
  • PC160: Uses a spell checker
  • PC170: Uses PyGrep hooks (only needed if rST present)
  • PC180: Uses a markdown formatter
  • PC190: Uses Ruff
  • PC191: Ruff show fixes if fixes enabled
  • PC901: Custom pre-commit CI message

Ruff

  • RF001: Has Ruff config
  • RF002: Target version must be set
  • RF003: src directory doesn't need to be specified anymore (0.6+)
  • RF101: Bugbear must be selected
  • RF102: isort must be selected
  • RF103: pyupgrade must be selected
  • RF201: Avoid using deprecated config settings
  • RF202: Use (new) lint config section

Setuptools Config

  • SCFG001: Avoid deprecated setup.cfg names

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sp_repo_review-2025.5.2.tar.gz (158.5 kB view details)

Uploaded Source

Built Distribution

sp_repo_review-2025.5.2-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file sp_repo_review-2025.5.2.tar.gz.

File metadata

  • Download URL: sp_repo_review-2025.5.2.tar.gz
  • Upload date:
  • Size: 158.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sp_repo_review-2025.5.2.tar.gz
Algorithm Hash digest
SHA256 3bf9074ea64c780d15916dc426438315b30bfc8e0b802b0c46026a9a8b4a9288
MD5 6c67bd1407231d32d6aa092f64ed450e
BLAKE2b-256 ec3e8d8c72e1ea8c4e9e8494c08057a98dd420327bdd7f5d2341cc626209d06b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sp_repo_review-2025.5.2.tar.gz:

Publisher: cd.yml on scientific-python/cookie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sp_repo_review-2025.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sp_repo_review-2025.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4160ace19bffdef0452ed98cd27d2aea014cc75678fe18b80c8c60c2ba5a634f
MD5 0eafa05f45d17cbca67f1848b5f6643e
BLAKE2b-256 beb52b737b035e651f1e5b2b6291d67ba3367d5d21f0577466b003f73aefa69f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sp_repo_review-2025.5.2-py3-none-any.whl:

Publisher: cd.yml on scientific-python/cookie

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page