repo-review 0.11.1__tar.gz → 0.11.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. {repo_review-0.11.1 → repo_review-0.11.3}/.github/CONTRIBUTING.md +5 -11
  2. {repo_review-0.11.1 → repo_review-0.11.3}/.github/workflows/ci.yml +1 -1
  3. {repo_review-0.11.1 → repo_review-0.11.3}/.pre-commit-config.yaml +9 -8
  4. {repo_review-0.11.1 → repo_review-0.11.3}/.readthedocs.yaml +1 -3
  5. {repo_review-0.11.1 → repo_review-0.11.3}/PKG-INFO +3 -27
  6. {repo_review-0.11.1 → repo_review-0.11.3}/README.md +2 -2
  7. {repo_review-0.11.1 → repo_review-0.11.3}/docs/checks.md +1 -1
  8. {repo_review-0.11.1 → repo_review-0.11.3}/docs/cli.md +1 -1
  9. {repo_review-0.11.1 → repo_review-0.11.3}/docs/families.md +2 -2
  10. {repo_review-0.11.1 → repo_review-0.11.3}/docs/index.html +1 -1
  11. {repo_review-0.11.1 → repo_review-0.11.3}/docs/intro.md +1 -1
  12. {repo_review-0.11.1 → repo_review-0.11.3}/pyproject.toml +43 -27
  13. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/__main__.py +53 -18
  14. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_version.py +2 -2
  15. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/checks.py +1 -1
  16. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/fixtures.py +4 -5
  17. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/ghpath.py +1 -1
  18. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/processor.py +9 -2
  19. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/testing.py +1 -1
  20. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_self.py +1 -1
  21. {repo_review-0.11.1 → repo_review-0.11.3}/.devcontainer/devcontainer.json +0 -0
  22. {repo_review-0.11.1 → repo_review-0.11.3}/.git_archival.txt +0 -0
  23. {repo_review-0.11.1 → repo_review-0.11.3}/.gitattributes +0 -0
  24. {repo_review-0.11.1 → repo_review-0.11.3}/.github/ISSUE_TEMPLATE/new-issue.md +0 -0
  25. {repo_review-0.11.1 → repo_review-0.11.3}/.github/dependabot.yml +0 -0
  26. {repo_review-0.11.1 → repo_review-0.11.3}/.github/release.yml +0 -0
  27. {repo_review-0.11.1 → repo_review-0.11.3}/.github/workflows/cd.yml +0 -0
  28. {repo_review-0.11.1 → repo_review-0.11.3}/.gitignore +0 -0
  29. {repo_review-0.11.1 → repo_review-0.11.3}/.pre-commit-hooks.yaml +0 -0
  30. {repo_review-0.11.1 → repo_review-0.11.3}/LICENSE +0 -0
  31. {repo_review-0.11.1 → repo_review-0.11.3}/action.yml +0 -0
  32. {repo_review-0.11.1 → repo_review-0.11.3}/docs/.nojekyll +0 -0
  33. {repo_review-0.11.1 → repo_review-0.11.3}/docs/api/repo_review.resources.rst +0 -0
  34. {repo_review-0.11.1 → repo_review-0.11.3}/docs/api/repo_review.rst +0 -0
  35. {repo_review-0.11.1 → repo_review-0.11.3}/docs/changelog.md +0 -0
  36. {repo_review-0.11.1 → repo_review-0.11.3}/docs/conf.py +0 -0
  37. {repo_review-0.11.1 → repo_review-0.11.3}/docs/fixtures.md +0 -0
  38. {repo_review-0.11.1 → repo_review-0.11.3}/docs/index.md +0 -0
  39. {repo_review-0.11.1 → repo_review-0.11.3}/docs/plugins.md +0 -0
  40. {repo_review-0.11.1 → repo_review-0.11.3}/docs/programmatic.md +0 -0
  41. {repo_review-0.11.1 → repo_review-0.11.3}/docs/webapp.js +0 -0
  42. {repo_review-0.11.1 → repo_review-0.11.3}/docs/webapp.md +0 -0
  43. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/__init__.py +0 -0
  44. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_compat/__init__.py +0 -0
  45. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_compat/importlib/__init__.py +0 -0
  46. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_compat/importlib/resources/__init__.py +0 -0
  47. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_compat/importlib/resources/abc.py +0 -0
  48. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_compat/tomllib.py +0 -0
  49. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_compat/typing.py +0 -0
  50. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/_version.pyi +0 -0
  51. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/families.py +0 -0
  52. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/html.py +0 -0
  53. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/py.typed +0 -0
  54. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/resources/__init__.py +0 -0
  55. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/resources/repo-review.schema.json +0 -0
  56. {repo_review-0.11.1 → repo_review-0.11.3}/src/repo_review/schema.py +0 -0
  57. {repo_review-0.11.1 → repo_review-0.11.3}/tests/conftest.py +0 -0
  58. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_checks.py +0 -0
  59. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_cmd.py +0 -0
  60. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_depends.py +0 -0
  61. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_families.py +0 -0
  62. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_fixtures.py +0 -0
  63. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_multi.py +0 -0
  64. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_package.py +0 -0
  65. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_utilities/pyproject.py +0 -0
  66. {repo_review-0.11.1 → repo_review-0.11.3}/tests/test_utilities/pyproject.toml +0 -0
@@ -32,23 +32,17 @@ $ hatch run example:repo-review <args> # Run an example
32
32
  Hatch handles everything for you, including setting up an temporary virtual
33
33
  environment.
34
34
 
35
+ Using `uv run` directly is also supported.
36
+
35
37
  ## Setting up a development environment manually
36
38
 
37
- You can set up a development environment by running:
39
+ You can set up a development environment in `.venv` by running:
38
40
 
39
41
  ```bash
40
- python3 -m venv .venv
41
- source ./.venv/bin/activate
42
- pip install -v -e .[dev]
42
+ uv sync
43
43
  ```
44
44
 
45
- If you have the [Python Launcher for Unix](https://github.com/brettcannon/python-launcher),
46
- you can instead do:
47
-
48
- ```bash
49
- py -m venv .venv
50
- py -m install -v -e .[dev]
51
- ```
45
+ Or just prefix every command by `uv run`.
52
46
 
53
47
  # Post setup
54
48
 
@@ -112,4 +112,4 @@ jobs:
112
112
  - name: Run repo-review action
113
113
  uses: ./
114
114
  with:
115
- plugins: sp-repo-review==2024.04.23
115
+ plugins: sp-repo-review==2024.08.19
@@ -5,26 +5,26 @@ ci:
5
5
 
6
6
  repos:
7
7
  - repo: https://github.com/adamchainz/blacken-docs
8
- rev: 1.18.0
8
+ rev: 1.19.1
9
9
  hooks:
10
10
  - id: blacken-docs
11
- additional_dependencies: [black==23.*]
11
+ additional_dependencies: [black==24.*]
12
12
 
13
13
  - repo: https://github.com/astral-sh/ruff-pre-commit
14
- rev: "v0.6.1"
14
+ rev: "v0.8.3"
15
15
  hooks:
16
16
  - id: ruff
17
17
  args: ["--fix", "--show-fixes"]
18
18
  - id: ruff-format
19
19
 
20
20
  - repo: https://github.com/rbubley/mirrors-prettier
21
- rev: "v3.3.3"
21
+ rev: "v3.4.2"
22
22
  hooks:
23
23
  - id: prettier
24
24
  types_or: [yaml, markdown, html, css, scss, javascript, json]
25
25
 
26
26
  - repo: https://github.com/pre-commit/pre-commit-hooks
27
- rev: v4.6.0
27
+ rev: v5.0.0
28
28
  hooks:
29
29
  - id: check-added-large-files
30
30
  - id: check-case-conflict
@@ -45,7 +45,7 @@ repos:
45
45
  - id: rst-inline-touching-normal
46
46
 
47
47
  - repo: https://github.com/pre-commit/mirrors-mypy
48
- rev: v1.11.1
48
+ rev: v1.13.0
49
49
  hooks:
50
50
  - id: mypy
51
51
  files: (src|web|tests)
@@ -53,6 +53,7 @@ repos:
53
53
  additional_dependencies:
54
54
  - click>=8.1.5
55
55
  - markdown-it-py
56
+ - orjson
56
57
  - pytest
57
58
  - rich
58
59
  - tomli
@@ -78,12 +79,12 @@ repos:
78
79
  exclude: .pre-commit-config.yaml
79
80
 
80
81
  - repo: https://github.com/henryiii/validate-pyproject-schema-store
81
- rev: 2024.08.19
82
+ rev: 2024.11.25
82
83
  hooks:
83
84
  - id: validate-pyproject
84
85
 
85
86
  - repo: https://github.com/python-jsonschema/check-jsonschema
86
- rev: 0.29.1
87
+ rev: 0.30.0
87
88
  hooks:
88
89
  - id: check-dependabot
89
90
  - id: check-github-workflows
@@ -13,6 +13,4 @@ build:
13
13
  - asdf plugin add uv
14
14
  - asdf install uv latest
15
15
  - asdf global uv latest
16
- - uv venv
17
- - uv pip install .[docs]
18
- - . .venv/bin/activate && sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
16
+ - uv run --group docs sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: repo_review
3
- Version: 0.11.1
3
+ Version: 0.11.3
4
4
  Summary: Framework that can run checks on repos
5
5
  Project-URL: Changelog, https://github.com/scientific-python/repo-review/releases
6
6
  Project-URL: Demo, https://scientific-python.github.io/repo-review
@@ -8,7 +8,6 @@ Project-URL: Documentation, https://repo-review.readthedocs.io
8
8
  Project-URL: Homepage, https://repo-review.readthedocs.io
9
9
  Project-URL: Source, https://github.com/scientific-python/repo-review
10
10
  Author-email: Henry Schreiner <henryfs@princeton.edu>
11
- License-File: LICENSE
12
11
  Classifier: Development Status :: 4 - Beta
13
12
  Classifier: Environment :: Console
14
13
  Classifier: Environment :: WebAssembly :: Emscripten
@@ -34,29 +33,6 @@ Provides-Extra: cli
34
33
  Requires-Dist: click>=8; extra == 'cli'
35
34
  Requires-Dist: rich-click; extra == 'cli'
36
35
  Requires-Dist: rich>=12.2; extra == 'cli'
37
- Provides-Extra: dev
38
- Requires-Dist: click>=8; extra == 'dev'
39
- Requires-Dist: pytest>=7; extra == 'dev'
40
- Requires-Dist: rich-click; extra == 'dev'
41
- Requires-Dist: rich>=12.2; extra == 'dev'
42
- Requires-Dist: sp-repo-review>=2024.04.23; extra == 'dev'
43
- Requires-Dist: validate-pyproject>=0.14; extra == 'dev'
44
- Provides-Extra: docs
45
- Requires-Dist: click>=8; extra == 'docs'
46
- Requires-Dist: furo; extra == 'docs'
47
- Requires-Dist: myst-parser>=0.13; extra == 'docs'
48
- Requires-Dist: rich-click; extra == 'docs'
49
- Requires-Dist: rich>=12.2; extra == 'docs'
50
- Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
51
- Requires-Dist: sphinx-copybutton; extra == 'docs'
52
- Requires-Dist: sphinx-github-changelog; extra == 'docs'
53
- Requires-Dist: sphinx>=4.0; extra == 'docs'
54
- Requires-Dist: sphinxcontrib-programoutput; extra == 'docs'
55
- Requires-Dist: sphinxext-opengraph; extra == 'docs'
56
- Provides-Extra: test
57
- Requires-Dist: pytest>=7; extra == 'test'
58
- Requires-Dist: sp-repo-review>=2024.04.23; extra == 'test'
59
- Requires-Dist: validate-pyproject>=0.14; extra == 'test'
60
36
  Description-Content-Type: text/markdown
61
37
 
62
38
  # repo-review
@@ -159,7 +135,7 @@ webapp. It also would allow `zipfile.Path` to work just as well, too - no need
159
135
  to extract.
160
136
 
161
137
  [Checks][] can request [fixtures][] (like [pytest][]) as arguments. Check files
162
- can add new fixtures as needed. Fixtures are are specified with entry points,
138
+ can add new fixtures as needed. Fixtures are specified with entry points,
163
139
  and take any other fixture as arguments as well - the `root` and `package`
164
140
  fixtures represents the root of the repository and of the package you are
165
141
  checking, respectively, and are the basis for the other fixtures, which are
@@ -195,7 +171,7 @@ collection functions, the family entry-point also supports fixtures.
195
171
  This project inspired [Try-PyHF](https://kratsg.github.io/try-pyhf/), an
196
172
  interface for a High Energy Physics package in Scikit-HEP.
197
173
 
198
- This project inspired [abSENSE](https://princetonuniversity.github.io/abSENSE/), an
174
+ This project inspired [abSENSE](https://princetonuniversity.github.io/abSENSE/), a
199
175
  web interface to abSENSE.
200
176
 
201
177
  This was developed for [Scikit-HEP][] before moving to Scientific-Python.
@@ -98,7 +98,7 @@ webapp. It also would allow `zipfile.Path` to work just as well, too - no need
98
98
  to extract.
99
99
 
100
100
  [Checks][] can request [fixtures][] (like [pytest][]) as arguments. Check files
101
- can add new fixtures as needed. Fixtures are are specified with entry points,
101
+ can add new fixtures as needed. Fixtures are specified with entry points,
102
102
  and take any other fixture as arguments as well - the `root` and `package`
103
103
  fixtures represents the root of the repository and of the package you are
104
104
  checking, respectively, and are the basis for the other fixtures, which are
@@ -134,7 +134,7 @@ collection functions, the family entry-point also supports fixtures.
134
134
  This project inspired [Try-PyHF](https://kratsg.github.io/try-pyhf/), an
135
135
  interface for a High Energy Physics package in Scikit-HEP.
136
136
 
137
- This project inspired [abSENSE](https://princetonuniversity.github.io/abSENSE/), an
137
+ This project inspired [abSENSE](https://princetonuniversity.github.io/abSENSE/), a
138
138
  web interface to abSENSE.
139
139
 
140
140
  This was developed for [Scikit-HEP][] before moving to Scientific-Python.
@@ -30,7 +30,7 @@ explanation instead of the `check()` docstring, you can return a non-empty
30
30
  string from the check instead of `False`. Returning `None` makes a check
31
31
  "skipped". Docstrings/error messages can access their own object with `{self}`
32
32
  and check name with `{name}` (these are processed with `.format()`, so escape `{}`
33
- as `{{}}`). The error message is in markdown format.
33
+ as `{{}}`). The error message is in Markdown format.
34
34
 
35
35
  ```{versionchanged} 0.9
36
36
  The string return value is not processed via `.format`. You can use `self` and
@@ -17,7 +17,7 @@ pass `--package-dir <path>`.
17
17
 
18
18
  There are four output formats; `rich` produces great terminal output, `svg`
19
19
  produces an SVG based on the rich output, `html` produces a custom HTML report,
20
- and `json` produces a output that can be processed easily. To make it easier to
20
+ and `json` produces an output that can be processed easily. To make it easier to
21
21
  support tools like GitHub Actions, there is also a `--stderr FORMAT` output
22
22
  option that produces the selected format on stderr as well, and disables
23
23
  producing terminal escape codes on stdout, even if `FORCE_COLOR` is set. This
@@ -15,7 +15,7 @@ class Family(typing.TypedDict, total=False):
15
15
 
16
16
  The `name` will be shown instead if given. The families will be sorted by
17
17
  `order` then key. And a `description` will be shown after the name if provided;
18
- it is expected to be in markdown format.
18
+ it is expected to be in Markdown format.
19
19
 
20
20
  ```{versionadded} 0.9
21
21
  Descriptions are now supported.
@@ -24,7 +24,7 @@ Descriptions are now supported.
24
24
  Then you can provide a function that maps family strings to this extra information:
25
25
 
26
26
  ```python
27
- def get_familes() -> dict[str, Family]:
27
+ def get_families() -> dict[str, Family]:
28
28
  return {
29
29
  "general": Family(
30
30
  name="General",
@@ -65,7 +65,7 @@
65
65
  header={true}
66
66
  deps={[
67
67
  "repo-review~=0.11.0",
68
- "sp-repo-review==2024.04.23",
68
+ "sp-repo-review==2024.08.19",
69
69
  "validate-pyproject-schema-store== 2024.08.19",
70
70
  "validate-pyproject[all]~=0.19.0",
71
71
  ]}
@@ -15,7 +15,7 @@ to use it is:
15
15
  pipx run <plugin-name>[cli] .
16
16
  ```
17
17
 
18
- This uses [pipx][] (pip for executables) to download the plugin and all of it's
18
+ This uses [pipx][] (pip for executables) to download the plugin and all of its
19
19
  dependencies (including repo-review itself) into a temporary virtual
20
20
  environment (cached for a week), then runs it. For example:
21
21
 
@@ -37,19 +37,40 @@ dependencies = [
37
37
  "typing-extensions; python_version < '3.11'",
38
38
  ]
39
39
 
40
+ [project.urls]
41
+ Changelog = "https://github.com/scientific-python/repo-review/releases"
42
+ Demo = "https://scientific-python.github.io/repo-review"
43
+ Documentation = "https://repo-review.readthedocs.io"
44
+ Homepage = "https://repo-review.readthedocs.io"
45
+ Source = "https://github.com/scientific-python/repo-review"
46
+
47
+ [project.scripts]
48
+ repo-review = "repo_review.__main__:main"
49
+
50
+ [project.entry-points."repo_review.fixtures"]
51
+ pyproject = "repo_review.fixtures:pyproject"
52
+ list_all = "repo_review.fixtures:list_all"
53
+
54
+ [project.entry-points."validate_pyproject.tool_schema"]
55
+ repo-review = "repo_review.schema:get_schema"
56
+
40
57
  [project.optional-dependencies]
41
58
  cli = [
42
59
  "click >=8",
43
60
  "rich >=12.2",
44
61
  "rich-click",
45
62
  ]
63
+
64
+ [dependency-groups]
46
65
  test = [
47
66
  "pytest >=7",
48
- "sp-repo-review >=2024.04.23",
67
+ "sp-repo-review >=2024.08.19",
49
68
  "validate-pyproject >=0.14",
50
69
  ]
51
70
  dev = [
52
- "repo-review[test,cli]",
71
+ { include-group = "test" },
72
+ "sp-repo-review[cli]",
73
+ "validate-pyproject-schema-store[all]",
53
74
  ]
54
75
  docs = [
55
76
  "furo",
@@ -63,24 +84,6 @@ docs = [
63
84
  "sphinx-github-changelog",
64
85
  ]
65
86
 
66
- [project.urls]
67
- Changelog = "https://github.com/scientific-python/repo-review/releases"
68
- Demo = "https://scientific-python.github.io/repo-review"
69
- Documentation = "https://repo-review.readthedocs.io"
70
- Homepage = "https://repo-review.readthedocs.io"
71
- Source = "https://github.com/scientific-python/repo-review"
72
-
73
- [project.scripts]
74
- repo-review = "repo_review.__main__:main"
75
-
76
- [project.entry-points."repo_review.fixtures"]
77
- pyproject = "repo_review.fixtures:pyproject"
78
- list_all = "repo_review.fixtures:list_all"
79
-
80
- [project.entry-points."validate_pyproject.tool_schema"]
81
- repo-review = "repo_review.schema:get_schema"
82
-
83
-
84
87
  [tool.hatch]
85
88
  version.source = "vcs"
86
89
  build.hooks.vcs.version-file = "src/repo_review/_version.py"
@@ -89,7 +92,13 @@ build.hooks.vcs.version-file = "src/repo_review/_version.py"
89
92
  installer = "uv"
90
93
 
91
94
  [tool.hatch.envs.hatch-test]
92
- features = ["test", "cli"]
95
+ features = ["cli"]
96
+ # duplicated since hatch doesn't support groups yet
97
+ dependencies = [
98
+ "pytest >=7",
99
+ "sp-repo-review >=2024.08.19",
100
+ "validate-pyproject >=0.14",
101
+ ]
93
102
  env-vars.PYTHONWARNDEFAULTENCODING = "1"
94
103
 
95
104
  [tool.hatch.envs.lint]
@@ -103,8 +112,19 @@ dependencies = ["pylint>=3.2"]
103
112
  scripts.lint = "pylint repo_review {args}"
104
113
 
105
114
  [tool.hatch.envs.docs]
106
- features = ["docs"]
107
- dependencies = ["sphinx-autobuild"]
115
+ # duplicated since hatch doesn't support groups yet
116
+ dependencies = [
117
+ "furo",
118
+ "myst_parser >=0.13",
119
+ "repo-review[cli]",
120
+ "sphinx >=4.0",
121
+ "sphinx-autodoc-typehints",
122
+ "sphinx-copybutton",
123
+ "sphinxcontrib-programoutput",
124
+ "sphinxext-opengraph",
125
+ "sphinx-github-changelog",
126
+ "sphinx-autobuild",
127
+ ]
108
128
  scripts.linkcheck = "sphinx-build -b=linkcheck docs docs/_build/linkcheck {args}"
109
129
  scripts.html = "sphinx-build --keep-going -n -T -b=html docs docs/_build/html {args}"
110
130
  scripts.serve = "sphinx-autobuild -n -T -b=html docs docs/_build/html {args}"
@@ -204,7 +224,6 @@ extend-select = [
204
224
  ]
205
225
  ignore = [
206
226
  "ISC001", # May collide with formatter
207
- "PT004", # Incorrect check, usefixtures is the correct way to do this
208
227
  "PLR09", # Too many X
209
228
  "PLR2004", # Magic value in comparison
210
229
  ]
@@ -223,6 +242,3 @@ typing-modules = ["repo_review._compat.typing"]
223
242
  [tool.ruff.lint.per-file-ignores]
224
243
  "src/repo_review/_compat/**.py" = ["TID251"]
225
244
  "src/**/__main__.py" = ["T20"]
226
-
227
- [tool.repo-review]
228
- ignore = ["RF003", "PC180"] # Will be fixed in next sp-repo-review release
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import importlib.metadata
3
4
  import itertools
4
5
  import json
5
6
  import os
@@ -33,9 +34,9 @@ from .ghpath import GHPath
33
34
  from .html import to_html
34
35
  from .processor import Result, as_simple_dict, collect_all, process
35
36
 
36
- __all__ = ["main", "Formats", "Show", "Status"]
37
+ __all__ = ["Formats", "Show", "Status", "main"]
37
38
 
38
- CODE_THEME = "default"
39
+ CODE_THEME = "ansi_light"
39
40
 
40
41
 
41
42
  def __dir__() -> list[str]:
@@ -74,6 +75,29 @@ def list_all(ctx: click.Context, _param: click.Parameter, value: bool) -> None:
74
75
  ctx.exit()
75
76
 
76
77
 
78
+ def all_versions(ctx: click.Context, _param: click.Parameter, value: bool) -> None:
79
+ if not value or ctx.resilient_parsing:
80
+ return
81
+
82
+ groups = ["repo_review.checks", "repo_review.families", "repo_review.fixtures"]
83
+ packages = {
84
+ dist.name: dist.version
85
+ for group in groups
86
+ for ep in importlib.metadata.entry_points(group=group)
87
+ if (dist := ep.dist) is not None
88
+ }
89
+ deps = ["rich", "rich-click", "click", "markdown-it-py", "pyyaml"]
90
+ rich.print("Repo-review's dependencies:")
91
+ for name in deps:
92
+ rich.print(
93
+ f" [bold]{name}[/bold]: [magenta]{importlib.metadata.version(name)}[/magenta]"
94
+ )
95
+ rich.print("Packages providing repo-review plugins:")
96
+ for name, version in sorted(packages.items()):
97
+ rich.print(f" [bold]{name}[/bold]: [green]{version}[/green]")
98
+ ctx.exit()
99
+
100
+
77
101
  def rich_printer(
78
102
  families: Mapping[str, Family],
79
103
  processed: list[Result],
@@ -243,9 +267,25 @@ def _remote_path_processor(package: Path) -> Path | GHPath:
243
267
  "packages",
244
268
  type=click.Path(dir_okay=True, path_type=Path),
245
269
  nargs=-1,
246
- required=True,
270
+ required=False,
247
271
  callback=remote_path_support,
248
272
  )
273
+ @click.option(
274
+ "--versions",
275
+ is_flag=True,
276
+ callback=all_versions,
277
+ expose_value=False,
278
+ is_eager=True,
279
+ help="List all plugin versions and exit",
280
+ )
281
+ @click.option(
282
+ "--list-all",
283
+ is_flag=True,
284
+ callback=list_all,
285
+ expose_value=False,
286
+ is_eager=True,
287
+ help="List all checks and exit",
288
+ )
249
289
  @click.option(
250
290
  "--format",
251
291
  "format_opt",
@@ -259,6 +299,12 @@ def _remote_path_processor(package: Path) -> Path | GHPath:
259
299
  type=click.Choice(["rich", "json", "html", "svg"]),
260
300
  help="Select additional output format for stderr. Will disable terminal escape codes for stdout for easy redirection.",
261
301
  )
302
+ @click.option(
303
+ "--show",
304
+ type=click.Choice(["all", "err", "errskip"]),
305
+ default="all",
306
+ help="Show all (default), or just errors, or errors and skips",
307
+ )
262
308
  @click.option(
263
309
  "--select",
264
310
  help="Only run certain checks, comma separated. All checks run if empty.",
@@ -275,20 +321,6 @@ def _remote_path_processor(package: Path) -> Path | GHPath:
275
321
  help="Path to python package.",
276
322
  default="",
277
323
  )
278
- @click.option(
279
- "--list-all",
280
- is_flag=True,
281
- callback=list_all,
282
- expose_value=False,
283
- is_eager=True,
284
- help="List all checks and exit",
285
- )
286
- @click.option(
287
- "--show",
288
- type=click.Choice(["all", "err", "errskip"]),
289
- default="all",
290
- help="Show all (default), or just errors, or errors and skips",
291
- )
292
324
  def main(
293
325
  packages: list[Path | GHPath],
294
326
  format_opt: Formats,
@@ -299,8 +331,11 @@ def main(
299
331
  show: Show,
300
332
  ) -> None:
301
333
  """
302
- Pass in a local Path or gh:org/repo@branch.
334
+ Pass in a local Path or gh:org/repo@branch. Will run on the current
335
+ directory if no path passed.
303
336
  """
337
+ if not packages:
338
+ packages = [Path()]
304
339
 
305
340
  if len(packages) > 1:
306
341
  if format_opt == "json":
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.11.1'
16
- __version_tuple__ = version_tuple = (0, 11, 1)
15
+ __version__ = version = '0.11.3'
16
+ __version_tuple__ = version_tuple = (0, 11, 3)
@@ -6,7 +6,7 @@ from typing import Any, Protocol
6
6
 
7
7
  from .fixtures import apply_fixtures
8
8
 
9
- __all__ = ["Check", "collect_checks", "is_allowed", "get_check_url"]
9
+ __all__ = ["Check", "collect_checks", "get_check_url", "is_allowed"]
10
10
 
11
11
 
12
12
  def __dir__() -> list[str]:
@@ -12,11 +12,11 @@ from ._compat.importlib.resources.abc import Traversable
12
12
  from .ghpath import EmptyTraversable
13
13
 
14
14
  __all__ = [
15
- "pyproject",
16
- "list_all",
17
- "compute_fixtures",
18
15
  "apply_fixtures",
19
16
  "collect_fixtures",
17
+ "compute_fixtures",
18
+ "list_all",
19
+ "pyproject",
20
20
  ]
21
21
 
22
22
 
@@ -36,8 +36,7 @@ def pyproject(package: Traversable) -> dict[str, Any]:
36
36
  pyproject_path = package.joinpath("pyproject.toml")
37
37
  if pyproject_path.is_file():
38
38
  with pyproject_path.open("rb") as f:
39
- # Type ignore fixed in https://github.com/hukkin/tomli/pull/215
40
- return tomllib.load(f) # type: ignore[arg-type]
39
+ return tomllib.load(f)
41
40
  return {}
42
41
 
43
42
 
@@ -14,7 +14,7 @@ from typing import Literal
14
14
 
15
15
  from ._compat.importlib.resources.abc import Traversable
16
16
 
17
- __all__ = ["GHPath", "EmptyTraversable"]
17
+ __all__ = ["EmptyTraversable", "GHPath"]
18
18
 
19
19
 
20
20
  def __dir__() -> list[str]:
@@ -1,9 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import copy
3
4
  import dataclasses
4
5
  import graphlib
5
6
  import textwrap
6
7
  import typing
8
+ import warnings
7
9
  from collections.abc import Mapping, Set
8
10
  from typing import Any, TypeVar
9
11
 
@@ -28,8 +30,8 @@ __all__ = [
28
30
  "ResultDict",
29
31
  "as_simple_dict",
30
32
  "collect_all",
31
- "process",
32
33
  "md_as_html",
34
+ "process",
33
35
  ]
34
36
 
35
37
 
@@ -211,13 +213,18 @@ def process(
211
213
 
212
214
  # Keep track of which checks have been completed
213
215
  completed: dict[str, str | None] = {}
216
+ fixtures_copy = copy.deepcopy(fixtures)
214
217
 
215
218
  # Run all the checks in topological order based on their dependencies
216
219
  ts = graphlib.TopologicalSorter(graph)
217
220
  for name in ts.static_order():
218
221
  if all(completed.get(n, "") == "" for n in graph[name]):
219
- result = apply_fixtures({"name": name, **fixtures}, tasks[name].check)
222
+ result = apply_fixtures({"name": name, **fixtures_copy}, tasks[name].check)
220
223
  completed[name] = process_result_bool(result, tasks[name], name)
224
+ if fixtures != fixtures_copy:
225
+ fixtures_copy = copy.deepcopy(fixtures)
226
+ msg = f"{name} modified the input fixtures! Making a deepcopy to fix and continue."
227
+ warnings.warn(msg, stacklevel=1)
221
228
  else:
222
229
  completed[name] = None
223
230
 
@@ -13,7 +13,7 @@ from .checks import Check, get_check_url, process_result_bool
13
13
  from .fixtures import apply_fixtures
14
14
  from .processor import Result
15
15
 
16
- __all__ = ["toml_loads", "compute_check"]
16
+ __all__ = ["compute_check", "toml_loads"]
17
17
 
18
18
 
19
19
  def __dir__() -> list[str]:
@@ -6,7 +6,7 @@ import repo_review.processor
6
6
 
7
7
 
8
8
  @pytest.fixture(autouse=True)
9
- def patch_entry_points(local_entry_points: object) -> None: # noqa: ARG001
9
+ def patch_entry_points(local_entry_points: object) -> None:
10
10
  pass
11
11
 
12
12
 
File without changes
File without changes
File without changes
File without changes
File without changes