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
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.tomlPY002
: Has a README.(md|rst) filePY003
: Has a LICENSE* filePY004
: Has docs folderPY005
: Has tests folderPY006
: Has pre-commit configPY007
: Supports an easy task runner (nox or tox)
PyProject
PP002
: Has a proper build-system tablePP003
: Does not list wheel as a build-depPP301
: Has pytest in pyprojectPP302
: Sets a minimum pytest to at least 6PP303
: Sets the test pathsPP304
: Sets the log level in pytestPP305
: Specifies xfail_strictPP306
: Specifies strict configPP307
: Specifies strict markersPP308
: Specifies useful pytest summaryPP309
: Filter warnings specified
Documentation
RTD100
: Uses ReadTheDocs (pyproject config)RTD101
: You have to set the RTD version number to 2RTD102
: You have to set the RTD build imageRTD103
: You have to set the RTD python version
GitHub Actions
GH100
: Has GitHub Actions configGH101
: Has nice namesGH102
: Auto-cancel on repeated PRsGH103
: At least one workflow with manual dispatch triggerGH104
: Use unique names for upload-artifactGH200
: Maintained by DependabotGH210
: Maintains the GitHub action versions with DependabotGH211
: Do not pin core actions as major versionsGH212
: Require GHA update grouping
MyPy
MY100
: Uses MyPy (pyproject config)MY101
: MyPy strict modeMY102
: MyPy show_error_codes deprecatedMY103
: MyPy warn unreachableMY104
: MyPy enables ignore-without-codeMY105
: MyPy enables redundant-exprMY106
: MyPy enables truthy-bool
Pre-commit
PC100
: Has pre-commit-hooksPC110
: Uses black or ruff-formatPC111
: Uses blacken-docsPC140
: Uses mypyPC160
: Uses codespellPC170
: Uses PyGrep hooks (only needed if RST present)PC180
: Uses prettierPC190
: Uses RuffPC191
: Ruff show fixes if fixes enabledPC901
: Custom pre-commit CI message
Ruff
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sp_repo_review-2024.1.24.tar.gz
.
File metadata
- Download URL: sp_repo_review-2024.1.24.tar.gz
- Upload date:
- Size: 148.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e4668ae7966e331bb199d73a6ddb80602b72c1cc5b2a5ecd56bbbdeb9400c6 |
|
MD5 | 0d88270dcf69b2a17f49b7cd4be3187b |
|
BLAKE2b-256 | 569a3c133badd156b45a9180736a6efef84edf5e241d73e8b20eed9df5e57c57 |
File details
Details for the file sp_repo_review-2024.1.24-py3-none-any.whl
.
File metadata
- Download URL: sp_repo_review-2024.1.24-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 928fb345068f5a113bcc7a3a2932496dd409e8b2295f0d2d772ac27095d096e6 |
|
MD5 | 0189361a612d8f97643a8f49bffa28e4 |
|
BLAKE2b-256 | c47d6520f9a9c0024df0794add95929018e555ae3da965019de0788082c82d0b |