repo-review 0.9.2__py3-none-any.whl → 0.9.3__py3-none-any.whl

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.
repo_review/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # file generated by setuptools_scm
2
2
  # don't change, don't track in version control
3
- __version__ = version = '0.9.2'
4
- __version_tuple__ = version_tuple = (0, 9, 2)
3
+ __version__ = version = '0.9.3'
4
+ __version_tuple__ = version_tuple = (0, 9, 3)
@@ -0,0 +1,8 @@
1
+ from __future__ import annotations
2
+
3
+ import importlib.resources
4
+
5
+ __all__ = ["resources"]
6
+
7
+
8
+ resources = importlib.resources.files(__name__)
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://github.com/scientific-python/repo-review/blob/main/src/repo_review/resources/repo-review.schema.json",
4
+ "description": "Repo-review's settings.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "select": {
9
+ "$ref": "#/$defs/checks"
10
+ },
11
+ "ignore": {
12
+ "$ref": "#/$defs/checks"
13
+ }
14
+ },
15
+ "$defs": {
16
+ "checks": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "string",
20
+ "pattern": "^[A-Z]+[0-9]*$"
21
+ }
22
+ }
23
+ }
24
+ }
repo_review/schema.py ADDED
@@ -0,0 +1,24 @@
1
+ """
2
+ This accesses the schema for repo-review's tool section.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ import json
8
+ from typing import Any
9
+
10
+ from .resources import resources
11
+
12
+ __all__ = ["get_schema"]
13
+
14
+
15
+ def __dir__() -> list[str]:
16
+ return __all__
17
+
18
+
19
+ def get_schema(tool_name: str = "repo-review") -> dict[str, Any]:
20
+ "Get the stored complete schema for repo-review settings."
21
+ assert tool_name == "repo-review", "Only repo-review is supported."
22
+
23
+ with resources.joinpath("repo-review.schema.json").open(encoding="utf-8") as f:
24
+ return json.load(f) # type: ignore[no-any-return]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: repo_review
3
- Version: 0.9.2
3
+ Version: 0.9.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
@@ -47,7 +47,8 @@ Requires-Dist: sphinxcontrib-programoutput; extra == 'docs'
47
47
  Requires-Dist: sphinxext-opengraph; extra == 'docs'
48
48
  Provides-Extra: test
49
49
  Requires-Dist: pytest>=7; extra == 'test'
50
- Requires-Dist: sp-repo-review; extra == 'test'
50
+ Requires-Dist: sp-repo-review>=2023.08.23; extra == 'test'
51
+ Requires-Dist: validate-pyproject>=0.14; extra == 'test'
51
52
  Description-Content-Type: text/markdown
52
53
 
53
54
  # repo-review
@@ -71,22 +72,25 @@ output formats are supported; `rich`, `svg`, `html`, and `json`.
71
72
 
72
73
  `sp-repo-review` provides checks based on the
73
74
  [Scientific-Python Development Guide][] at [scientific-python/cookie][]. A live
74
- WebAssembly demo using `sp-repo-review` is
75
+ WebAssembly demo using [sp-repo-review][] is
75
76
  [here][repo-review-demo].
76
77
 
77
78
  ## Running repo-review
78
79
 
79
80
  Repo-review supports running multiple ways:
80
81
 
81
- - From the command line on a local folder
82
+ - [From the command line][cli] on a local folder
82
83
  - From the command line on a remote repository on GitHub (`gh:org/repo@branch`)
83
- - From WebAssembly in [Pyodide][] (example in `docs/index.html`)
84
+ - [From WebAssembly][webapp] in [Pyodide][] (example in `docs/index.html`)
85
+ - [From pre-commit][intro-pre-commit]
86
+ - [From GitHub Actions][intro-github-actions]
87
+ - [From Python][programmatic-usage]
84
88
 
85
89
  If the root of a package is not the repository root, pass `--package-dir a/b/c`.
86
90
 
87
91
  ## Configuration
88
92
 
89
- Repo-review supports configuration via `pyproject.toml`:
93
+ Repo-review [supports configuration][intro-configuring] via `pyproject.toml`:
90
94
 
91
95
  ```toml
92
96
  [tool.repo-review]
@@ -119,7 +123,7 @@ This project is intended to be fun and easy to develop and design checks for -
119
123
  it requires and uses Python 3.10, and uses a lot of the new features in 3.9 and
120
124
  3.10. It's maybe not entirely conventional, but it enables very simple plugin
121
125
  development. It works locally, remotely, and in WebAssembly (using
122
- [Pyodide][]).
126
+ [Pyodide][]). [See the docs][writing-a-plugin].
123
127
 
124
128
  There are a few key designs that are very useful and make this possible. First,
125
129
  all paths are handled as Traversables. This allows a simple Traversable
@@ -127,13 +131,14 @@ implementation based on `open_url` to provide a web interface for use in the
127
131
  webapp. It also would allow `zipfile.Path` to work just as well, too - no need
128
132
  to extract.
129
133
 
130
- Checks can request fixtures (like [pytest][]) as arguments. Check files can add new
131
- fixtures as needed. Fixtures are are specified with entry points, and take any
132
- other fixture as arguments as well - the `root` and `package` fixtures
133
- represents the root of the repository and of the package you are checking,
134
- respectively, and are the basis for all other fixtures. `pyproject` is provided
135
- as well. Checks are specified via an entrypoint that returns a dict of checks;
136
- this also can accept fixtures, allowing dynamic check listings.
134
+ [Checks][] can request [fixtures][] (like [pytest][]) as arguments. Check files
135
+ can add new fixtures as needed. Fixtures are are specified with entry points,
136
+ and take any other fixture as arguments as well - the `root` and `package`
137
+ fixtures represents the root of the repository and of the package you are
138
+ checking, respectively, and are the basis for the other fixtures, which are
139
+ topologically sorted and cached. `pyproject` is provided as well. Checks are
140
+ specified via an entrypoint that returns a dict of checks; this can also can
141
+ accept fixtures, allowing dynamic check listings.
137
142
 
138
143
  Check files do not depend on the main library, and can be extended (similar to
139
144
  Flake8). You register new check files via entry-points - so extending this is
@@ -154,6 +159,17 @@ get a `None` result and the check method will not run. The front-end (Rich
154
159
  powered CLI or Pyodide webapp) will render the markdown-formatted check
155
160
  docstring only if the result is `False`.
156
161
 
162
+ Checks are organized by [Families][]. A plugin can customize the display name,
163
+ change the sort order, and add an optional (dynamic) description. Like the other
164
+ collection functions, the family entry-point also supports fixtures.
165
+
166
+ ## Plugins
167
+
168
+ Feel free to request your plugin be added to this list.
169
+
170
+ - [sp-repo-review][]: Checks based on the [Scientific-Python Development Guide][].
171
+ - [validate-pyproject][]: Adds a check to validate pyproject sections, also supports plugins.
172
+
157
173
  ## Links
158
174
 
159
175
  This project inspired [Try-PyHF](https://kratsg.github.io/try-pyhf/), an
@@ -182,5 +198,21 @@ This was developed for [Scikit-HEP][] before moving to Scientific-Python.
182
198
  [scientific-python development guide]: https://learn.scientific-python.org/development
183
199
  [scientific-python/cookie]: https://github.com/scientific-python/cookie
184
200
  [scikit-hep]: https://scikit-hep.org
201
+ [sp-repo-review]: https://pypi.org/project/sp-repo-review
202
+ [validate-pyproject]: https://validate-pyproject.readthedocs.io
203
+
204
+ [intro-pre-commit]: https://repo-review.readthedocs.io/en/latest/intro.html#pre-commit
205
+ [intro-github-actions]: https://repo-review.readthedocs.io/en/latest/intro.html#github-actions
206
+ [cli]: https://repo-review.readthedocs.io/en/latest/cli.html
207
+ [programmatic-usage]: https://repo-review.readthedocs.io/en/latest/programmatic.html
208
+ [webapp]: https://repo-review.readthedocs.io/en/latest/webapp.html
209
+ [intro-configuring]: https://repo-review.readthedocs.io/en/latest/intro.html#configuring
210
+ [writing-a-plugin]: https://repo-review.readthedocs.io/en/latest/plugins.html
211
+ [fixtures]: https://repo-review.readthedocs.io/en/latest/fixtures.html
212
+ [checks]: https://repo-review.readthedocs.io/en/latest/checks.html
213
+ [families]: https://repo-review.readthedocs.io/en/latest/families.html
214
+ [changelog]: https://repo-review.readthedocs.io/en/latest/changelog.html
215
+ [api]: https://repo-review.readthedocs.io/en/latest/api/repo_review.html
216
+
185
217
 
186
218
  <!-- prettier-ignore-end -->
@@ -1,6 +1,6 @@
1
1
  repo_review/__init__.py,sha256=Mwl2Lp046LmlrYhaYX-_krbiWhPG5VLFHVrDvSTtnq8,230
2
2
  repo_review/__main__.py,sha256=o_-WXKt_lcwyUpL4uHttxoqGfeZ6wcDaebYpsBF8LPo,8157
3
- repo_review/_version.py,sha256=t2HJ5q34aM9MjZF2siod7ZXTvaH_aHYeO-QChiNfrq4,160
3
+ repo_review/_version.py,sha256=pBH2D3-n2O0-LXZHMYk_Esnj71yN3IieWKkVDv2_kk4,160
4
4
  repo_review/_version.pyi,sha256=j5kbzfm6lOn8BzASXWjGIA1yT0OlHTWqlbyZ8Si_o0E,118
5
5
  repo_review/checks.py,sha256=jyW_sHwNU0L3BNSDNRjPlW9YJYrMEc6R5o13s6sdHa4,3625
6
6
  repo_review/families.py,sha256=TEMQY3whMj8b3iVlWyVsTa0CAZexXRCFXq5uPIkV6bs,2389
@@ -9,14 +9,17 @@ repo_review/ghpath.py,sha256=CArlWT4yNgIIoDZ4pVNxucmAdUUMkJSkkROtk35q5qc,6010
9
9
  repo_review/html.py,sha256=0eXaCAjvXRRGcffqBuUJJ7010Wzfc6aXGwet7MrodEQ,2449
10
10
  repo_review/processor.py,sha256=l_rt39yLI8xXbSUQzGam4YRUdxWnV5q2dm7TVDUZCZk,7820
11
11
  repo_review/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ repo_review/schema.py,sha256=U_iox0khN1oEHCCB5ILffjRvZLG7BR-aaip9QEpMkJk,593
12
13
  repo_review/_compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
14
  repo_review/_compat/tomllib.py,sha256=caR8Mj-hSBLE2zqdLLjzwOdCBOfikVqS8pWkc4K5vgc,233
14
15
  repo_review/_compat/typing.py,sha256=vXfYiJHUaqMShRMbJi0VUg2V59UV-oxceZKSBZ3tfts,246
15
16
  repo_review/_compat/importlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
17
  repo_review/_compat/importlib/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
18
  repo_review/_compat/importlib/resources/abc.py,sha256=0DXPlrQLCeUNTmY2ex5FlR8_T3FfNllfvVF8n2-ta9w,256
18
- repo_review-0.9.2.dist-info/METADATA,sha256=WX6rM9DxNBdpXxywX--5CG8lrwRpiTnbx_kHt6G3Kyc,8397
19
- repo_review-0.9.2.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
20
- repo_review-0.9.2.dist-info/entry_points.txt,sha256=U2kE_SW4dEAVBESDopUDYPD8Nc46gG7ilSVScPFG1Lo,166
21
- repo_review-0.9.2.dist-info/licenses/LICENSE,sha256=X7yOxzyAEckYl17p01lZzbraqDVmWEWXE8BnKKRrh7c,1525
22
- repo_review-0.9.2.dist-info/RECORD,,
19
+ repo_review/resources/__init__.py,sha256=RBBaUp-hQrIYBqbAT0MytCXEjDmqVsCjiEgdK_K3dN4,138
20
+ repo_review/resources/repo-review.schema.json,sha256=Ljna-BRuoKihOnJ5_78Fgs0ZrYHlgohmtS6x37TJbDg,556
21
+ repo_review-0.9.3.dist-info/METADATA,sha256=IEVTueu0WtFn9zzHbnUYF-H0LlL1YFvhIhv4495KWRw,10233
22
+ repo_review-0.9.3.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
23
+ repo_review-0.9.3.dist-info/entry_points.txt,sha256=9XaDWanm31NNpXOpjZh2HxSXR5owVdYJ2cbNG5D8wY8,244
24
+ repo_review-0.9.3.dist-info/licenses/LICENSE,sha256=X7yOxzyAEckYl17p01lZzbraqDVmWEWXE8BnKKRrh7c,1525
25
+ repo_review-0.9.3.dist-info/RECORD,,
@@ -4,3 +4,6 @@ repo-review = repo_review.__main__:main
4
4
  [repo_review.fixtures]
5
5
  list_all = repo_review.fixtures:list_all
6
6
  pyproject = repo_review.fixtures:pyproject
7
+
8
+ [validate_pyproject.tool_schema]
9
+ repo-review = repo_review.schema:get_schema