repo-review 0.10.6__py3-none-any.whl → 0.11.1__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/__main__.py CHANGED
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import itertools
4
4
  import json
5
+ import os
5
6
  import sys
6
7
  import typing
7
8
  from collections.abc import Mapping, Sequence
@@ -83,6 +84,17 @@ def rich_printer(
83
84
  status: Status,
84
85
  header: str = "",
85
86
  ) -> None:
87
+ # Before Python 3.15, this isn't always unicode
88
+ if (
89
+ sys.version_info < (3, 15)
90
+ and "PYTHONIOENCODING" not in os.environ
91
+ and "PYTHONUTF8" not in os.environ
92
+ ):
93
+ if sys.stdout.encoding != "utf-8":
94
+ sys.stdout.reconfigure(encoding="utf-8") # type: ignore[union-attr]
95
+ if sys.stderr.encoding != "utf-8":
96
+ sys.stderr.reconfigure(encoding="utf-8") # type: ignore[union-attr]
97
+
86
98
  console = rich.console.Console(
87
99
  record=svg, quiet=svg, stderr=stderr, color_system="auto" if color else None
88
100
  )
repo_review/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.10.6'
16
- __version_tuple__ = version_tuple = (0, 10, 6)
15
+ __version__ = version = '0.11.1'
16
+ __version_tuple__ = version_tuple = (0, 11, 1)
repo_review/checks.py CHANGED
@@ -89,9 +89,8 @@ def is_allowed(select: Set[str], ignore: Set[str], name: str) -> bool:
89
89
  and "*" not in select
90
90
  ):
91
91
  return False
92
- if name in ignore or name.rstrip("0123456789") in ignore:
93
- return False
94
- return True
92
+
93
+ return name not in ignore and name.rstrip("0123456789") not in ignore
95
94
 
96
95
 
97
96
  def get_check_url(name: str, check: Check) -> str:
repo_review/ghpath.py CHANGED
@@ -7,6 +7,7 @@ from __future__ import annotations
7
7
  import dataclasses
8
8
  import io
9
9
  import json
10
+ import sys
10
11
  import typing
11
12
  from collections.abc import Iterator
12
13
  from typing import Literal
@@ -47,7 +48,12 @@ class GHPath(Traversable):
47
48
 
48
49
  @staticmethod
49
50
  def open_url(url: str) -> io.StringIO:
50
- "This method can be overridden for pyodide with pyodide.open_url"
51
+ "This method can be overridden manually for WASM. Supports pyodide currently."
52
+ if sys.platform == "emscripten":
53
+ import pyodide.http
54
+
55
+ return pyodide.http.open_url(url)
56
+
51
57
  import urllib.request # pylint: disable=import-outside-toplevel
52
58
 
53
59
  with urllib.request.urlopen(url) as response:
@@ -9,7 +9,18 @@
9
9
  "$ref": "#/$defs/checks"
10
10
  },
11
11
  "ignore": {
12
- "$ref": "#/$defs/checks"
12
+ "oneOf": [
13
+ {
14
+ "$ref": "#/$defs/checks"
15
+ },
16
+ {
17
+ "type": "object",
18
+ "patternProperties": {
19
+ "^[A-Z]+[0-9]*$": { "type": "string" }
20
+ },
21
+ "additionalProperties": false
22
+ }
23
+ ]
13
24
  }
14
25
  },
15
26
  "$defs": {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: repo_review
3
- Version: 0.10.6
3
+ Version: 0.11.1
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
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3
21
21
  Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
24
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
26
  Classifier: Topic :: Software Development :: Quality Assurance
26
27
  Classifier: Typing :: Typed
@@ -38,7 +39,7 @@ Requires-Dist: click>=8; extra == 'dev'
38
39
  Requires-Dist: pytest>=7; extra == 'dev'
39
40
  Requires-Dist: rich-click; extra == 'dev'
40
41
  Requires-Dist: rich>=12.2; extra == 'dev'
41
- Requires-Dist: sp-repo-review>=2023.12.21; extra == 'dev'
42
+ Requires-Dist: sp-repo-review>=2024.04.23; extra == 'dev'
42
43
  Requires-Dist: validate-pyproject>=0.14; extra == 'dev'
43
44
  Provides-Extra: docs
44
45
  Requires-Dist: click>=8; extra == 'docs'
@@ -54,7 +55,7 @@ Requires-Dist: sphinxcontrib-programoutput; extra == 'docs'
54
55
  Requires-Dist: sphinxext-opengraph; extra == 'docs'
55
56
  Provides-Extra: test
56
57
  Requires-Dist: pytest>=7; extra == 'test'
57
- Requires-Dist: sp-repo-review>=2023.12.21; extra == 'test'
58
+ Requires-Dist: sp-repo-review>=2024.04.23; extra == 'test'
58
59
  Requires-Dist: validate-pyproject>=0.14; extra == 'test'
59
60
  Description-Content-Type: text/markdown
60
61
 
@@ -76,7 +77,7 @@ least one plugin to be installed.
76
77
  With one or more plugins, it will produce a list of results - green checkmarks
77
78
  mean this rule is followed, red x’s mean the rule is not. A yellow warning sign
78
79
  means that the check was skipped because a previous required check failed. Four
79
- output formats are supported; `rich`, `svg`, `html`, and `json`.
80
+ output formats are supported: `rich`, `svg`, `html`, and `json`.
80
81
 
81
82
  ## Plugins
82
83
 
@@ -140,7 +141,7 @@ the files that interest the plugin in question.
140
141
 
141
142
  So if you want to lint Python code, use Flake8 or Ruff. But if you want to
142
143
  check Flake8 or Ruff's configuration, use repo-review! Generally, repo-review
143
- plugins are more about requiring things to be present, like making use all your
144
+ plugins are more about requiring things to be present, like making sure all your
144
145
  repos have some [pre-commit][] check.
145
146
 
146
147
  ## Development of repo-review and plugins
@@ -169,7 +170,7 @@ accept fixtures, allowing dynamic check listings.
169
170
  Check files do not depend on the main library, and can be extended (similar to
170
171
  Flake8). You register new check files via entry-points - so extending this is
171
172
  with custom checks or custom fixtures is easy and trivial. There's no need to
172
- subclass or do anything with the base library - no dependency required.
173
+ subclass or do anything with the base library - no dependency on repo-review required.
173
174
 
174
175
  Checks are as simple as possible so they are easy to write. A check is a class
175
176
  with the name (1-2 letters + number) and a docstring (the check message). It
@@ -1,11 +1,11 @@
1
1
  repo_review/__init__.py,sha256=U03wTpj7PjSsIROp8O4VRG_NVG-plkx14d_MvqpmJ_w,229
2
- repo_review/__main__.py,sha256=YG78gWDM5ExHNTEhdtMNGvJBV44JU_IkR5mc_3a5fqs,12262
3
- repo_review/_version.py,sha256=0ek8_w_jF04UB6FpW1K7d1RgH0zQMd77H5TbKzdthjI,413
2
+ repo_review/__main__.py,sha256=Nu6vzaaL6QtYf6N84WJ7n1ujt1TFe5ciyTDxZQMKLtY,12716
3
+ repo_review/_version.py,sha256=GfnRHfD9z98AbNAoXaNE50CPUnbpEikyDWn-_mn0J2Q,413
4
4
  repo_review/_version.pyi,sha256=j5kbzfm6lOn8BzASXWjGIA1yT0OlHTWqlbyZ8Si_o0E,118
5
- repo_review/checks.py,sha256=hIwQARm0JESf0yMCfjR5jaI-AdnCO7ePTY28eQ2iOy4,4340
5
+ repo_review/checks.py,sha256=SzTnMxj756xMb9Rffl9K65o2rUGDYfG6CQCj-pNWQzk,4316
6
6
  repo_review/families.py,sha256=TEMQY3whMj8b3iVlWyVsTa0CAZexXRCFXq5uPIkV6bs,2389
7
7
  repo_review/fixtures.py,sha256=AHdUhDU--SOrlhWSymiyECp5LmaCGYNRcZHuPpzFUts,3709
8
- repo_review/ghpath.py,sha256=s83SiaSyfINvtuLn3wpNPQeiU3FipulgTQJObQ9m7tg,5978
8
+ repo_review/ghpath.py,sha256=YadsOkd2hGOrDffSU3PtQiDLgvrVe1GuMKeDFKXwtLs,6123
9
9
  repo_review/html.py,sha256=LwoZUqiWC84qSuhwbzqQtwhWDhE8JiPWWTI4nKXF3nA,3485
10
10
  repo_review/processor.py,sha256=2NSbuC7jt_eMjIB9VpY0c5-TtKr9GWzA8Gr6Pvj2SqU,7951
11
11
  repo_review/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -18,9 +18,9 @@ repo_review/_compat/importlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
18
18
  repo_review/_compat/importlib/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  repo_review/_compat/importlib/resources/abc.py,sha256=KLv7AqUaY-ezZ32lA5yVcZLfMqY6VEo8Q-1jyWpGRbk,300
20
20
  repo_review/resources/__init__.py,sha256=RBBaUp-hQrIYBqbAT0MytCXEjDmqVsCjiEgdK_K3dN4,138
21
- repo_review/resources/repo-review.schema.json,sha256=Ljna-BRuoKihOnJ5_78Fgs0ZrYHlgohmtS6x37TJbDg,556
22
- repo_review-0.10.6.dist-info/METADATA,sha256=AQbYlfGOEwgyws3DLqvTdWNoZesRfZZYUmsNF-7bG5A,11370
23
- repo_review-0.10.6.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
24
- repo_review-0.10.6.dist-info/entry_points.txt,sha256=9XaDWanm31NNpXOpjZh2HxSXR5owVdYJ2cbNG5D8wY8,244
25
- repo_review-0.10.6.dist-info/licenses/LICENSE,sha256=X7yOxzyAEckYl17p01lZzbraqDVmWEWXE8BnKKRrh7c,1525
26
- repo_review-0.10.6.dist-info/RECORD,,
21
+ repo_review/resources/repo-review.schema.json,sha256=jAc7ZQV-Hc16ENrNFZm7nlIjiRQGTanq8EjBICkJKpE,791
22
+ repo_review-0.11.1.dist-info/METADATA,sha256=WdkUmLpDSoIJsMp-KRBCYVIba555Zctujo5I-i3f71g,11437
23
+ repo_review-0.11.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
24
+ repo_review-0.11.1.dist-info/entry_points.txt,sha256=9XaDWanm31NNpXOpjZh2HxSXR5owVdYJ2cbNG5D8wY8,244
25
+ repo_review-0.11.1.dist-info/licenses/LICENSE,sha256=X7yOxzyAEckYl17p01lZzbraqDVmWEWXE8BnKKRrh7c,1525
26
+ repo_review-0.11.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.24.2
2
+ Generator: hatchling 1.25.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any