jaymd96-pants-baseline 0.1.0__py3-none-any.whl → 0.1.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.
- {jaymd96_pants_baseline-0.1.0.dist-info → jaymd96_pants_baseline-0.1.1.dist-info}/METADATA +7 -7
- {jaymd96_pants_baseline-0.1.0.dist-info → jaymd96_pants_baseline-0.1.1.dist-info}/RECORD +6 -6
- pants_baseline/__about__.py +1 -1
- pants_baseline/rules/audit_rules.py +1 -58
- {jaymd96_pants_baseline-0.1.0.dist-info → jaymd96_pants_baseline-0.1.1.dist-info}/WHEEL +0 -0
- {jaymd96_pants_baseline-0.1.0.dist-info → jaymd96_pants_baseline-0.1.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jaymd96-pants-baseline
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Opinionated Python code quality baseline plugin for Pants build system
|
|
5
5
|
Project-URL: Homepage, https://github.com/jaymd96/pants-baseline
|
|
6
6
|
Project-URL: Repository, https://github.com/jaymd96/pants-baseline.git
|
|
@@ -69,7 +69,7 @@ baseline_python_project(
|
|
|
69
69
|
name="my_project",
|
|
70
70
|
sources=["src/**/*.py"],
|
|
71
71
|
test_sources=["tests/**/*.py"],
|
|
72
|
-
python_version="3.
|
|
72
|
+
python_version="3.13",
|
|
73
73
|
line_length=120,
|
|
74
74
|
strict=True,
|
|
75
75
|
coverage_threshold=80,
|
|
@@ -105,7 +105,7 @@ pants baseline-audit ::
|
|
|
105
105
|
enabled = true
|
|
106
106
|
|
|
107
107
|
# Target Python version
|
|
108
|
-
python_version = "3.
|
|
108
|
+
python_version = "3.13"
|
|
109
109
|
|
|
110
110
|
# Maximum line length
|
|
111
111
|
line_length = 120
|
|
@@ -209,7 +209,7 @@ The `baseline_python_project` target supports the following fields:
|
|
|
209
209
|
|-------|------|---------|-------------|
|
|
210
210
|
| `sources` | `list[str]` | `["**/*.py"]` | Python source file patterns |
|
|
211
211
|
| `test_sources` | `list[str]` | `["tests/**/*.py"]` | Test file patterns |
|
|
212
|
-
| `python_version` | `str` | `"3.
|
|
212
|
+
| `python_version` | `str` | `"3.13"` | Target Python version |
|
|
213
213
|
| `line_length` | `int` | `120` | Maximum line length |
|
|
214
214
|
| `strict` | `bool` | `True` | Enable strict mode |
|
|
215
215
|
| `coverage_threshold` | `int` | `80` | Minimum coverage % |
|
|
@@ -303,7 +303,7 @@ baseline_python_project(
|
|
|
303
303
|
|
|
304
304
|
```toml
|
|
305
305
|
[GLOBAL]
|
|
306
|
-
pants_version = "2.
|
|
306
|
+
pants_version = "2.30.1"
|
|
307
307
|
backend_packages = [
|
|
308
308
|
"pants.backend.python",
|
|
309
309
|
"pants_baseline",
|
|
@@ -311,10 +311,10 @@ backend_packages = [
|
|
|
311
311
|
plugins = ["jaymd96-pants-baseline==0.1.0"]
|
|
312
312
|
|
|
313
313
|
[python]
|
|
314
|
-
interpreter_constraints = ["CPython>=3.
|
|
314
|
+
interpreter_constraints = ["CPython>=3.13,<4"]
|
|
315
315
|
|
|
316
316
|
[python-baseline]
|
|
317
|
-
python_version = "3.
|
|
317
|
+
python_version = "3.13"
|
|
318
318
|
line_length = 120
|
|
319
319
|
coverage_threshold = 80
|
|
320
320
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pants_baseline/__about__.py,sha256=
|
|
1
|
+
pants_baseline/__about__.py,sha256=97dvdwKxvj1F_4P14HXY73JzsW_NCT-SL4ygmx_RpM8,98
|
|
2
2
|
pants_baseline/__init__.py,sha256=uVRGi1D2gFjc7emmeewWdcvpO-NsUuKsMbX3rztOxWU,655
|
|
3
3
|
pants_baseline/register.py,sha256=AnQrzGYcPY4f7jMvgDVvs9bo-oY1XgOAwEO3fo813yg,1656
|
|
4
4
|
pants_baseline/targets.py,sha256=G8ejj3QYaGHtLHbxirTyTjnEAWYxlpHFHYKV-_B4lMo,3300
|
|
@@ -9,7 +9,7 @@ pants_baseline/goals/lint.py,sha256=hvIRPd-zfh5zC6Q_RvEWSbqJyszGEtvCpPdKwrTe0Vo,
|
|
|
9
9
|
pants_baseline/goals/test.py,sha256=cUSE7NyuXaEtZnBe22MqPAu-Fqjtn5oCpttmeU1XIk4,1590
|
|
10
10
|
pants_baseline/goals/typecheck.py,sha256=LuuOW3lvzOhgsNf5-W0SC1jvNnI5Nt4ZQAGwOPg6ZoA,1706
|
|
11
11
|
pants_baseline/rules/__init__.py,sha256=UpvDpGVImhRfp2_VeUNsRPGiWjBbMI6AV1-Yx3kS0Gg,252
|
|
12
|
-
pants_baseline/rules/audit_rules.py,sha256=
|
|
12
|
+
pants_baseline/rules/audit_rules.py,sha256=dCA1iMXHIH_ljLYWBZUhxTmq65tSzpkR-_0-ga0w13g,1916
|
|
13
13
|
pants_baseline/rules/fmt_rules.py,sha256=cObaRCS-9sqtPUhIGBHt3vTd2oW7veHwQnmex0XLaB4,3495
|
|
14
14
|
pants_baseline/rules/lint_rules.py,sha256=TLc4OU1dGQF3ZtDfXtiA1B267FQXgPGxEjIZiyja84g,3825
|
|
15
15
|
pants_baseline/rules/test_rules.py,sha256=BkrFKdVqj47E8lHBqsMpSC8CteaycoYpdx2rN45VQ-E,4136
|
|
@@ -19,7 +19,7 @@ pants_baseline/subsystems/baseline.py,sha256=M20muLytoWZnA4ZY3lkbSsdCXt6OMPH6IMJ
|
|
|
19
19
|
pants_baseline/subsystems/ruff.py,sha256=Yl5WB7InBRrr462aiowt6bZDPBiV6QJo5snrCcKds4E,2572
|
|
20
20
|
pants_baseline/subsystems/ty.py,sha256=boUryZIlJI8dm8jcBfhwmaDlhdC4sXSNTd3pg_NdZGY,2097
|
|
21
21
|
pants_baseline/subsystems/uv.py,sha256=Ws9KRZ5LVQA9FXEttMnNjw1fJrm9uE-urYo6zzePHXk,1822
|
|
22
|
-
jaymd96_pants_baseline-0.1.
|
|
23
|
-
jaymd96_pants_baseline-0.1.
|
|
24
|
-
jaymd96_pants_baseline-0.1.
|
|
25
|
-
jaymd96_pants_baseline-0.1.
|
|
22
|
+
jaymd96_pants_baseline-0.1.1.dist-info/METADATA,sha256=S9iOYD3aAHty-DTKKpjGhKeVB-6lAiHQhzy7KuhORi0,7934
|
|
23
|
+
jaymd96_pants_baseline-0.1.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
24
|
+
jaymd96_pants_baseline-0.1.1.dist-info/licenses/LICENSE,sha256=oLGLZv7XKM_oKCbdMW1bZB37SXsdexmhNSuh3Xg4m4I,10754
|
|
25
|
+
jaymd96_pants_baseline-0.1.1.dist-info/RECORD,,
|
pants_baseline/__about__.py
CHANGED
|
@@ -5,17 +5,10 @@ from __future__ import annotations
|
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from typing import Iterable
|
|
7
7
|
|
|
8
|
-
from pants.engine.console import Console
|
|
9
|
-
from pants.engine.fs import Digest
|
|
10
|
-
from pants.engine.goal import Goal, GoalSubsystem
|
|
11
8
|
from pants.engine.process import FallibleProcessResult, Process
|
|
12
|
-
from pants.engine.rules import Get, collect_rules,
|
|
13
|
-
from pants.engine.target import Targets
|
|
9
|
+
from pants.engine.rules import Get, collect_rules, rule
|
|
14
10
|
from pants.util.logging import LogLevel
|
|
15
11
|
|
|
16
|
-
from pants_baseline.subsystems.baseline import BaselineSubsystem
|
|
17
|
-
from pants_baseline.subsystems.uv import UvSubsystem
|
|
18
|
-
|
|
19
12
|
|
|
20
13
|
@dataclass(frozen=True)
|
|
21
14
|
class AuditResult:
|
|
@@ -27,19 +20,6 @@ class AuditResult:
|
|
|
27
20
|
vulnerabilities_found: int
|
|
28
21
|
|
|
29
22
|
|
|
30
|
-
class AuditSubsystem(GoalSubsystem):
|
|
31
|
-
"""Subsystem for the audit goal."""
|
|
32
|
-
|
|
33
|
-
name = "baseline-audit"
|
|
34
|
-
help = "Run security audit on dependencies using uv."
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class Audit(Goal):
|
|
38
|
-
"""Goal to run security audit."""
|
|
39
|
-
|
|
40
|
-
subsystem_cls = AuditSubsystem
|
|
41
|
-
|
|
42
|
-
|
|
43
23
|
@dataclass(frozen=True)
|
|
44
24
|
class UvAuditRequest:
|
|
45
25
|
"""Request to run uv audit."""
|
|
@@ -93,43 +73,6 @@ async def run_uv_audit(
|
|
|
93
73
|
)
|
|
94
74
|
|
|
95
75
|
|
|
96
|
-
@goal_rule
|
|
97
|
-
async def run_audit_goal(
|
|
98
|
-
console: Console,
|
|
99
|
-
targets: Targets,
|
|
100
|
-
uv_subsystem: UvSubsystem,
|
|
101
|
-
baseline_subsystem: BaselineSubsystem,
|
|
102
|
-
) -> Audit:
|
|
103
|
-
"""Execute the security audit goal."""
|
|
104
|
-
if not baseline_subsystem.enabled or not uv_subsystem.audit_enabled:
|
|
105
|
-
console.print_stdout("Security audit is disabled.")
|
|
106
|
-
return Audit(exit_code=0)
|
|
107
|
-
|
|
108
|
-
console.print_stdout("Running security audit with uv...")
|
|
109
|
-
|
|
110
|
-
result = await Get(
|
|
111
|
-
AuditResult,
|
|
112
|
-
UvAuditRequest(
|
|
113
|
-
lock_file=uv_subsystem.lock_file,
|
|
114
|
-
ignore_vulns=tuple(uv_subsystem.audit_ignore_vulns),
|
|
115
|
-
output_format=uv_subsystem.output_format,
|
|
116
|
-
),
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
console.print_stdout(result.stdout)
|
|
120
|
-
if result.stderr:
|
|
121
|
-
console.print_stderr(result.stderr)
|
|
122
|
-
|
|
123
|
-
if result.vulnerabilities_found > 0:
|
|
124
|
-
console.print_stderr(
|
|
125
|
-
f"\nFound {result.vulnerabilities_found} vulnerabilities!"
|
|
126
|
-
)
|
|
127
|
-
else:
|
|
128
|
-
console.print_stdout("\nNo vulnerabilities found.")
|
|
129
|
-
|
|
130
|
-
return Audit(exit_code=result.exit_code)
|
|
131
|
-
|
|
132
|
-
|
|
133
76
|
def rules() -> Iterable:
|
|
134
77
|
"""Return all audit rules."""
|
|
135
78
|
return collect_rules()
|
|
File without changes
|
{jaymd96_pants_baseline-0.1.0.dist-info → jaymd96_pants_baseline-0.1.1.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|