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:

pipx run '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 (just visually ignore it for the moment, a way to specify ignored checks will likely be added eventually).

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.

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
      additional_dependencies: ["repo-review[cli]"]

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 or tox)

PyProject

  • PP002: Has a proper build-system table
  • PP003: Does not list wheel as a build-dep
  • 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

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
  • GH200: Maintained by Dependabot
  • GH210: Maintains the GitHub action versions with Dependabot
  • GH211: Do not pin core actions as major versions

MyPy

  • MY100: Uses MyPy (pyproject config)
  • MY101: MyPy strict mode
  • MY102: MyPy show error codes
  • 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
  • PC111: Uses blacken-docs
  • PC140: Uses mypy
  • PC160: Uses codespell
  • PC170: Uses PyGrep hooks (only needed if RST present)
  • PC180: Uses prettier
  • 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 specified if used
  • RF101: Bugbear must be selected
  • RF102: isort must be selected
  • RF103: pyupgrade must be selected

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-2023.9.21.tar.gz (144.2 kB view details)

Uploaded Source

Built Distribution

sp_repo_review-2023.9.21-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sp_repo_review-2023.9.21.tar.gz
  • Upload date:
  • Size: 144.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for sp_repo_review-2023.9.21.tar.gz
Algorithm Hash digest
SHA256 11b4d16f5c587467286d88e9a4d2cc48417b78ba7d04986dcf86d465b8a47322
MD5 4f92e06181c84059f4f0d374743fcc63
BLAKE2b-256 7f12c96fb2749b5b968136082df07d9f325c5ceb60f565c17b289ea96e44aece

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sp_repo_review-2023.9.21-py3-none-any.whl
Algorithm Hash digest
SHA256 23edfe45623205d8a0b58d9aedfa79e0b4a88f3c81d927644294583c98162f90
MD5 df5c5c9a71d46d0ff5a2a88f1e01300f
BLAKE2b-256 c4e6a370396bc223cfb82687fb20afdda28a826736633c95538363e394e253f1

See more details on using hashes here.

Supported by

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