repo-review 0.12.0__py3-none-any.whl → 0.12.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/_version.py +2 -2
- repo_review/html.py +5 -8
- repo_review/processor.py +21 -1
- {repo_review-0.12.0.dist-info → repo_review-0.12.1.dist-info}/METADATA +1 -1
- {repo_review-0.12.0.dist-info → repo_review-0.12.1.dist-info}/RECORD +8 -8
- {repo_review-0.12.0.dist-info → repo_review-0.12.1.dist-info}/WHEEL +0 -0
- {repo_review-0.12.0.dist-info → repo_review-0.12.1.dist-info}/entry_points.txt +0 -0
- {repo_review-0.12.0.dist-info → repo_review-0.12.1.dist-info}/licenses/LICENSE +0 -0
repo_review/_version.py
CHANGED
repo_review/html.py
CHANGED
@@ -6,10 +6,8 @@ import io
|
|
6
6
|
import typing
|
7
7
|
from collections.abc import Mapping, Sequence
|
8
8
|
|
9
|
-
import markdown_it
|
10
|
-
|
11
9
|
from .families import Family, get_family_description, get_family_name
|
12
|
-
from .processor import Result
|
10
|
+
from .processor import Result, md_as_html
|
13
11
|
|
14
12
|
if typing.TYPE_CHECKING:
|
15
13
|
from .__main__ import Status
|
@@ -37,16 +35,15 @@ def to_html(
|
|
37
35
|
"""
|
38
36
|
out = io.StringIO()
|
39
37
|
print = functools.partial(builtins.print, file=out)
|
40
|
-
md = markdown_it.MarkdownIt()
|
41
38
|
|
42
39
|
for family in families:
|
43
40
|
family_name = get_family_name(families, family)
|
44
41
|
family_description = get_family_description(families, family)
|
45
|
-
family_results = [r for r in processed if r.family == family]
|
42
|
+
family_results = [r.md_as_html() for r in processed if r.family == family]
|
46
43
|
if family_results or family_description:
|
47
44
|
print(f"<h3>{family_name}</h3>")
|
48
45
|
if family_description:
|
49
|
-
print(
|
46
|
+
print("<p>", md_as_html(family_description), "</p>")
|
50
47
|
if family_results:
|
51
48
|
print("<table>")
|
52
49
|
print(
|
@@ -82,7 +79,7 @@ def to_html(
|
|
82
79
|
if result.skip_reason:
|
83
80
|
description += (
|
84
81
|
f'<br/><span style="color:DarkKhaki;"><b>Skipped:</b> '
|
85
|
-
f"<em>{
|
82
|
+
f"<em>{result.skip_reason}</em></span>"
|
86
83
|
)
|
87
84
|
print(f'<tr style="color: {color};">')
|
88
85
|
print(f'<td><span role="img" aria-label="{result_txt}">{icon}</span></td>')
|
@@ -93,7 +90,7 @@ def to_html(
|
|
93
90
|
print("<td>")
|
94
91
|
print(description)
|
95
92
|
print("<br/>")
|
96
|
-
print(
|
93
|
+
print(result.err_msg)
|
97
94
|
print("</td>")
|
98
95
|
print("</tr>")
|
99
96
|
if family_results:
|
repo_review/processor.py
CHANGED
@@ -3,11 +3,12 @@ from __future__ import annotations
|
|
3
3
|
import copy
|
4
4
|
import dataclasses
|
5
5
|
import graphlib
|
6
|
+
import sys
|
6
7
|
import textwrap
|
7
8
|
import typing
|
8
9
|
import warnings
|
9
10
|
from collections.abc import Mapping, Set
|
10
|
-
from typing import Any, TypeVar
|
11
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
11
12
|
|
12
13
|
import markdown_it
|
13
14
|
|
@@ -24,6 +25,12 @@ from .families import Family, collect_families
|
|
24
25
|
from .fixtures import apply_fixtures, collect_fixtures, compute_fixtures, pyproject
|
25
26
|
from .ghpath import EmptyTraversable
|
26
27
|
|
28
|
+
if TYPE_CHECKING:
|
29
|
+
if sys.version_info >= (3, 11):
|
30
|
+
from typing import Self
|
31
|
+
else:
|
32
|
+
from typing_extensions import Self
|
33
|
+
|
27
34
|
__all__ = [
|
28
35
|
"CollectionReturn",
|
29
36
|
"ProcessReturn",
|
@@ -84,9 +91,22 @@ class Result:
|
|
84
91
|
def err_as_html(self) -> str:
|
85
92
|
"""
|
86
93
|
Produces HTML from the error message, assuming it is in markdown.
|
94
|
+
Deprecated, use :meth:`md_as_html` directly instead.
|
87
95
|
"""
|
88
96
|
return md_as_html(self.err_msg)
|
89
97
|
|
98
|
+
def md_as_html(self) -> Self:
|
99
|
+
"""
|
100
|
+
Process fields that are assumed to be markdown.
|
101
|
+
|
102
|
+
.. versionadded:: 0.12.1
|
103
|
+
"""
|
104
|
+
return dataclasses.replace(
|
105
|
+
self,
|
106
|
+
err_msg=md_as_html(self.err_msg),
|
107
|
+
skip_reason=md_as_html(self.skip_reason),
|
108
|
+
)
|
109
|
+
|
90
110
|
|
91
111
|
class ProcessReturn(typing.NamedTuple):
|
92
112
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: repo_review
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.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
|
@@ -1,13 +1,13 @@
|
|
1
1
|
repo_review/__init__.py,sha256=U03wTpj7PjSsIROp8O4VRG_NVG-plkx14d_MvqpmJ_w,229
|
2
2
|
repo_review/__main__.py,sha256=-4cUtsnRua2Cwl5ESuBEzXljxWUY2kaAj3kZCFAfwh4,14863
|
3
|
-
repo_review/_version.py,sha256=
|
3
|
+
repo_review/_version.py,sha256=OSJc7-JxViAvW4SmGUZQQX05ZpGw9KopFINBSBZ_tHs,413
|
4
4
|
repo_review/_version.pyi,sha256=j5kbzfm6lOn8BzASXWjGIA1yT0OlHTWqlbyZ8Si_o0E,118
|
5
5
|
repo_review/checks.py,sha256=Iz5T1d0wDfBIyaO3f5waHEqhmfP_4-9eNOngJpRnpGo,4845
|
6
6
|
repo_review/families.py,sha256=TEMQY3whMj8b3iVlWyVsTa0CAZexXRCFXq5uPIkV6bs,2389
|
7
7
|
repo_review/fixtures.py,sha256=ypeEj-Ae3_3bUWUE0n-wuOrKlEVFU6rp7zK-UoC_t6E,3607
|
8
8
|
repo_review/ghpath.py,sha256=fkzUD1G_kuzCmVhTH2yAJoJxxYwjAXfjnBwtaj6nqg0,6123
|
9
|
-
repo_review/html.py,sha256=
|
10
|
-
repo_review/processor.py,sha256
|
9
|
+
repo_review/html.py,sha256=Mazyng90X31DTOk23ZKtIMwyN-LeHnwG7StwdySwMAA,3716
|
10
|
+
repo_review/processor.py,sha256=Cfw65EGfFQosLh6g1jeghWR0xTIg0HRpXXJVsCpiqX0,9524
|
11
11
|
repo_review/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
repo_review/schema.py,sha256=U_iox0khN1oEHCCB5ILffjRvZLG7BR-aaip9QEpMkJk,593
|
13
13
|
repo_review/testing.py,sha256=tA0c-baQ2-0UQMKnY59NgBuLmBqsVcFUBP4uYsL3n6Q,1915
|
@@ -19,8 +19,8 @@ repo_review/_compat/importlib/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
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
21
|
repo_review/resources/repo-review.schema.json,sha256=jAc7ZQV-Hc16ENrNFZm7nlIjiRQGTanq8EjBICkJKpE,791
|
22
|
-
repo_review-0.12.
|
23
|
-
repo_review-0.12.
|
24
|
-
repo_review-0.12.
|
25
|
-
repo_review-0.12.
|
26
|
-
repo_review-0.12.
|
22
|
+
repo_review-0.12.1.dist-info/METADATA,sha256=usuR22S6tkCFLYZ04RoX0v4WaXXgFVCdHUBNi_sS4ho,10613
|
23
|
+
repo_review-0.12.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
24
|
+
repo_review-0.12.1.dist-info/entry_points.txt,sha256=9XaDWanm31NNpXOpjZh2HxSXR5owVdYJ2cbNG5D8wY8,244
|
25
|
+
repo_review-0.12.1.dist-info/licenses/LICENSE,sha256=X7yOxzyAEckYl17p01lZzbraqDVmWEWXE8BnKKRrh7c,1525
|
26
|
+
repo_review-0.12.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|