Skip to content

Commit

Permalink
fix: add pixi support for PY007
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Sep 20, 2024
1 parent 3daf6dd commit 9413e8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ for family, grp in itertools.groupby(collected.checks.items(), key=lambda x: x[1
- [`PY004`](https://learn.scientific-python.org/development/guides/packaging-simple#PY004): Has docs folder
- [`PY005`](https://learn.scientific-python.org/development/guides/packaging-simple#PY005): Has tests folder
- [`PY006`](https://learn.scientific-python.org/development/guides/style#PY006): Has pre-commit config
- [`PY007`](https://learn.scientific-python.org/development/guides/tasks#PY007): Supports an easy task runner (nox or tox)
- [`PY007`](https://learn.scientific-python.org/development/guides/tasks#PY007): Supports an easy task runner (nox, tox, pixi, etc.)

### PyProject
- [`PP002`](https://learn.scientific-python.org/development/guides/packaging-simple#PP002): Has a proper build-system table
Expand Down
6 changes: 5 additions & 1 deletion src/sp_repo_review/checks/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def check(root: Traversable) -> bool:


class PY007(General):
"Supports an easy task runner (nox or tox)"
"Supports an easy task runner (nox, tox, pixi, etc.)"

url = mk_url("tasks")

Expand All @@ -119,13 +119,17 @@ def check(root: Traversable, pyproject: dict[str, Any]) -> bool:
return True
if root.joinpath("tox.ini").is_file():
return True
if root.joinpath("pixi.toml").is_file():
return True
match pyproject.get("tool", {}):
case {"hatch": {"envs": object()}}:
return True
case {"spin": object()}:
return True
case {"tox": object()}:
return True
case {"pixi": {"tasks": object()}}:
return True
case _:
return False

Expand Down

0 comments on commit 9413e8b

Please sign in to comment.