jaymd96-pants-baseline 0.2.2__py3-none-any.whl → 0.2.4__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.2.2.dist-info → jaymd96_pants_baseline-0.2.4.dist-info}/METADATA +1 -1
- jaymd96_pants_baseline-0.2.4.dist-info/RECORD +26 -0
- pants_baseline/__about__.py +1 -1
- pants_baseline/register.py +8 -4
- pants_baseline/rules/audit_rules.py +16 -17
- pants_baseline/rules/fmt_rules.py +26 -30
- pants_baseline/rules/lint_rules.py +19 -18
- pants_baseline/rules/test_rules.py +14 -11
- pants_baseline/rules/typecheck_rules.py +18 -17
- pants_baseline/subsystems/baseline.py +6 -0
- pants_baseline/subsystems/ruff.py +11 -0
- pants_baseline/subsystems/ty.py +11 -0
- pants_baseline/subsystems/uv.py +11 -0
- jaymd96_pants_baseline-0.2.2.dist-info/RECORD +0 -26
- {jaymd96_pants_baseline-0.2.2.dist-info → jaymd96_pants_baseline-0.2.4.dist-info}/WHEEL +0 -0
- {jaymd96_pants_baseline-0.2.2.dist-info → jaymd96_pants_baseline-0.2.4.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.2.
|
|
3
|
+
Version: 0.2.4
|
|
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
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
pants_baseline/__about__.py,sha256=_NHv1GsoomF9pLIMakvm__h8kOX9KbA_ONs3BVVqMWg,98
|
|
2
|
+
pants_baseline/__init__.py,sha256=uVRGi1D2gFjc7emmeewWdcvpO-NsUuKsMbX3rztOxWU,655
|
|
3
|
+
pants_baseline/bundled_claude_plugins.py,sha256=rHchQRQ_UabOOKyQOxVwoyE2xLjE8eiUFVN7oERDCe0,1608
|
|
4
|
+
pants_baseline/register.py,sha256=Ls_2XC-q53O_vY1PskcPBP0_cxrCp2smLfdji0ZRSlc,1712
|
|
5
|
+
pants_baseline/targets.py,sha256=Z9O09Aqd5inMqwIUFt4HSE9HtWjn8pGSU4FZHg22Tpo,3379
|
|
6
|
+
pants_baseline/goals/__init__.py,sha256=pf6KU2CIQuDkx8ER3IS0H-kuNbBtX-AH5B5SnSP9_yw,192
|
|
7
|
+
pants_baseline/goals/audit.py,sha256=i7zyyKssWw6EE2zN5putWP9sikkcjUKn7g3Jrapv994,2380
|
|
8
|
+
pants_baseline/goals/fmt.py,sha256=CyUPhy42rscUzJp4DhSRp3FGhGYcIKN42b46l1hJ9tY,2432
|
|
9
|
+
pants_baseline/goals/lint.py,sha256=vGyG-wvjgjE4dgglmTOiFNnng2bQbOQXkZ3Fd2HdiOU,2435
|
|
10
|
+
pants_baseline/goals/test.py,sha256=THW4kJAFbAzPCjLbq1dxg81T19QdywXYiwTNKSB4z8M,1653
|
|
11
|
+
pants_baseline/goals/typecheck.py,sha256=nqfwy1BZqhEzlDX-_hme9mKuDI2KqH-XpN4ygzWMQ6Y,2626
|
|
12
|
+
pants_baseline/rules/__init__.py,sha256=UpvDpGVImhRfp2_VeUNsRPGiWjBbMI6AV1-Yx3kS0Gg,252
|
|
13
|
+
pants_baseline/rules/audit_rules.py,sha256=5VzHExJdvB00KrVIAuxlb7pwNfTC0djr5QzF8wXMYws,2906
|
|
14
|
+
pants_baseline/rules/fmt_rules.py,sha256=QB4qgWyN_7PCSIG1hy2vzDXr8LVA4L7-sAJZvFiEfy4,4259
|
|
15
|
+
pants_baseline/rules/lint_rules.py,sha256=dLWrZtTFY1KE_cIBbVN_i61JjtT63ItYMwkQjIO4PQU,4291
|
|
16
|
+
pants_baseline/rules/test_rules.py,sha256=Q_opWXkNS2IDSRQmDdYz-PETl9QEXgwaO_iPN4QWHjY,4268
|
|
17
|
+
pants_baseline/rules/typecheck_rules.py,sha256=5jr7S9IPzDQOdO5kwwpn3q6m45GKJVlEDO2FN8wN6Ac,4579
|
|
18
|
+
pants_baseline/subsystems/__init__.py,sha256=LteH_qmUIgRAnXYmmi7f6o894QfpY3hMNH5dlvJbSoM,387
|
|
19
|
+
pants_baseline/subsystems/baseline.py,sha256=CU8ZhNCJw8BSXSyuvZ1eH-Y2CSPggp2O-I2bVqF3WEU,2187
|
|
20
|
+
pants_baseline/subsystems/ruff.py,sha256=47fQg4fM_qzLGfxb_WFLYT1URL_4VxkJWw7LBOEQyT0,4248
|
|
21
|
+
pants_baseline/subsystems/ty.py,sha256=F9F2YyYlbt1PlvsVP8qMAa_l0C-JezyjiDnBs4RMTIc,3722
|
|
22
|
+
pants_baseline/subsystems/uv.py,sha256=z8gflmuuF0mEN4Bhlp29w2BlrM0M-4cYv7Y0wKhjOnk,3369
|
|
23
|
+
jaymd96_pants_baseline-0.2.4.dist-info/METADATA,sha256=T6KkhV2DegjJJpMfFR6CKB2xJtEDtAE2lG5onWNB77k,8764
|
|
24
|
+
jaymd96_pants_baseline-0.2.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
25
|
+
jaymd96_pants_baseline-0.2.4.dist-info/licenses/LICENSE,sha256=oLGLZv7XKM_oKCbdMW1bZB37SXsdexmhNSuh3Xg4m4I,10754
|
|
26
|
+
jaymd96_pants_baseline-0.2.4.dist-info/RECORD,,
|
pants_baseline/__about__.py
CHANGED
pants_baseline/register.py
CHANGED
|
@@ -14,10 +14,7 @@ from pants_baseline.goals import lint as lint_goal
|
|
|
14
14
|
from pants_baseline.goals import test as test_goal
|
|
15
15
|
from pants_baseline.goals import typecheck as typecheck_goal
|
|
16
16
|
from pants_baseline.rules import audit_rules, fmt_rules, lint_rules, test_rules, typecheck_rules
|
|
17
|
-
from pants_baseline.subsystems
|
|
18
|
-
from pants_baseline.subsystems.ruff import RuffSubsystem
|
|
19
|
-
from pants_baseline.subsystems.ty import TySubsystem
|
|
20
|
-
from pants_baseline.subsystems.uv import UvSubsystem
|
|
17
|
+
from pants_baseline.subsystems import baseline, ruff, ty, uv
|
|
21
18
|
from pants_baseline.targets import BaselinePythonProject
|
|
22
19
|
|
|
23
20
|
|
|
@@ -29,11 +26,18 @@ def rules() -> Iterable[Rule]:
|
|
|
29
26
|
rather than using collect_rules() which only collects @rule functions.
|
|
30
27
|
"""
|
|
31
28
|
return [
|
|
29
|
+
# Subsystem rules (must be registered first for dependencies)
|
|
30
|
+
*baseline.rules(),
|
|
31
|
+
*ruff.rules(),
|
|
32
|
+
*ty.rules(),
|
|
33
|
+
*uv.rules(),
|
|
34
|
+
# Tool rules
|
|
32
35
|
*lint_rules.rules(),
|
|
33
36
|
*fmt_rules.rules(),
|
|
34
37
|
*typecheck_rules.rules(),
|
|
35
38
|
*test_rules.rules(),
|
|
36
39
|
*audit_rules.rules(),
|
|
40
|
+
# Goal rules
|
|
37
41
|
*lint_goal.rules(),
|
|
38
42
|
*fmt_goal.rules(),
|
|
39
43
|
*typecheck_goal.rules(),
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from typing import Iterable
|
|
5
5
|
|
|
6
|
-
from pants.core.util_rules.external_tool import
|
|
7
|
-
from pants.engine.fs import
|
|
6
|
+
from pants.core.util_rules.external_tool import download_external_tool
|
|
7
|
+
from pants.engine.fs import MergeDigests, PathGlobs
|
|
8
|
+
from pants.engine.internals.selectors import concurrently
|
|
9
|
+
from pants.engine.intrinsics import merge_digests, execute_process, path_globs_to_digest
|
|
8
10
|
from pants.engine.platform import Platform
|
|
9
|
-
from pants.engine.process import
|
|
10
|
-
from pants.engine.rules import
|
|
11
|
+
from pants.engine.process import Process
|
|
12
|
+
from pants.engine.rules import collect_rules, implicitly, rule
|
|
11
13
|
from pants.util.logging import LogLevel
|
|
12
14
|
|
|
13
15
|
from pants_baseline.subsystems.uv import UvSubsystem
|
|
@@ -39,23 +41,20 @@ async def run_uv_audit(
|
|
|
39
41
|
platform: Platform,
|
|
40
42
|
) -> AuditResult:
|
|
41
43
|
"""Run uv audit on dependencies."""
|
|
42
|
-
# Download uv
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
uv_subsystem.get_request(platform),
|
|
44
|
+
# Download uv and get lock files in parallel using new intrinsics
|
|
45
|
+
downloaded_uv_get = download_external_tool(uv_subsystem.get_request(platform))
|
|
46
|
+
lock_file_digest_get = path_globs_to_digest(
|
|
47
|
+
PathGlobs([request.lock_file, "pyproject.toml", "requirements.txt"])
|
|
47
48
|
)
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
PathGlobs([request.lock_file, "pyproject.toml", "requirements.txt"]),
|
|
50
|
+
downloaded_uv, lock_file_digest = await concurrently(
|
|
51
|
+
downloaded_uv_get,
|
|
52
|
+
lock_file_digest_get,
|
|
53
53
|
)
|
|
54
54
|
|
|
55
55
|
# Merge the uv binary with lock files
|
|
56
|
-
input_digest = await
|
|
57
|
-
|
|
58
|
-
MergeDigests([downloaded_uv.digest, lock_file_snapshot.digest]),
|
|
56
|
+
input_digest = await merge_digests(
|
|
57
|
+
MergeDigests([downloaded_uv.digest, lock_file_digest]),
|
|
59
58
|
)
|
|
60
59
|
|
|
61
60
|
# Build ignore args
|
|
@@ -78,7 +77,7 @@ async def run_uv_audit(
|
|
|
78
77
|
level=LogLevel.DEBUG,
|
|
79
78
|
)
|
|
80
79
|
|
|
81
|
-
result = await
|
|
80
|
+
result = await execute_process(process, **implicitly())
|
|
82
81
|
|
|
83
82
|
stdout = result.stdout.decode()
|
|
84
83
|
stderr = result.stderr.decode()
|
|
@@ -4,13 +4,15 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Iterable
|
|
5
5
|
|
|
6
6
|
from pants.core.goals.fmt import FmtResult, FmtTargetsRequest
|
|
7
|
+
from pants.core.util_rules.external_tool import download_external_tool
|
|
7
8
|
from pants.core.util_rules.partitions import PartitionerType
|
|
8
|
-
from pants.core.util_rules.external_tool import DownloadedExternalTool, ExternalToolRequest
|
|
9
9
|
from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
|
|
10
|
-
from pants.engine.fs import
|
|
10
|
+
from pants.engine.fs import MergeDigests
|
|
11
|
+
from pants.engine.internals.selectors import concurrently
|
|
12
|
+
from pants.engine.intrinsics import merge_digests, execute_process, digest_to_snapshot
|
|
11
13
|
from pants.engine.platform import Platform
|
|
12
|
-
from pants.engine.process import
|
|
13
|
-
from pants.engine.rules import
|
|
14
|
+
from pants.engine.process import Process
|
|
15
|
+
from pants.engine.rules import collect_rules, implicitly, rule
|
|
14
16
|
from pants.engine.target import FieldSet, Target
|
|
15
17
|
from pants.util.logging import LogLevel
|
|
16
18
|
|
|
@@ -50,51 +52,47 @@ async def run_ruff_fmt(
|
|
|
50
52
|
platform: Platform,
|
|
51
53
|
) -> FmtResult:
|
|
52
54
|
"""Run Ruff formatter on Python files."""
|
|
53
|
-
field_sets = request.elements
|
|
54
|
-
snapshot = request.snapshot
|
|
55
|
-
|
|
56
55
|
if not baseline_subsystem.enabled:
|
|
57
56
|
return FmtResult(
|
|
58
|
-
input=snapshot,
|
|
59
|
-
output=snapshot,
|
|
57
|
+
input=request.snapshot,
|
|
58
|
+
output=request.snapshot,
|
|
60
59
|
stdout="",
|
|
61
60
|
stderr="",
|
|
62
61
|
formatter_name="ruff",
|
|
63
62
|
)
|
|
64
63
|
|
|
65
|
-
if not
|
|
64
|
+
if not request.elements:
|
|
66
65
|
return FmtResult(
|
|
67
|
-
input=snapshot,
|
|
68
|
-
output=snapshot,
|
|
66
|
+
input=request.snapshot,
|
|
67
|
+
output=request.snapshot,
|
|
69
68
|
stdout="No targets to format",
|
|
70
69
|
stderr="",
|
|
71
70
|
formatter_name="ruff",
|
|
72
71
|
)
|
|
73
72
|
|
|
74
|
-
# Download ruff and get source files in parallel
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
),
|
|
73
|
+
# Download ruff and get source files in parallel using new intrinsics
|
|
74
|
+
downloaded_ruff_get = download_external_tool(ruff_subsystem.get_request(platform))
|
|
75
|
+
sources_get = SourceFilesRequest(
|
|
76
|
+
sources_fields=[fs.sources for fs in request.elements],
|
|
77
|
+
for_sources_types=(BaselineSourcesField,),
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
downloaded_ruff, sources = await concurrently(
|
|
81
|
+
downloaded_ruff_get,
|
|
82
|
+
implicitly(sources_get, SourceFiles),
|
|
84
83
|
)
|
|
85
84
|
|
|
86
85
|
if not sources.files:
|
|
87
86
|
return FmtResult(
|
|
88
|
-
input=snapshot,
|
|
89
|
-
output=snapshot,
|
|
87
|
+
input=request.snapshot,
|
|
88
|
+
output=request.snapshot,
|
|
90
89
|
stdout="No files to format",
|
|
91
90
|
stderr="",
|
|
92
91
|
formatter_name="ruff",
|
|
93
92
|
)
|
|
94
93
|
|
|
95
94
|
# Merge the ruff binary with the source files
|
|
96
|
-
input_digest = await
|
|
97
|
-
Digest,
|
|
95
|
+
input_digest = await merge_digests(
|
|
98
96
|
MergeDigests([downloaded_ruff.digest, sources.snapshot.digest]),
|
|
99
97
|
)
|
|
100
98
|
|
|
@@ -117,10 +115,8 @@ async def run_ruff_fmt(
|
|
|
117
115
|
level=LogLevel.DEBUG,
|
|
118
116
|
)
|
|
119
117
|
|
|
120
|
-
result = await
|
|
121
|
-
|
|
122
|
-
output_digest: Digest = result.output_digest
|
|
123
|
-
output_snapshot = await Get(Snapshot, Digest, output_digest)
|
|
118
|
+
result = await execute_process(process, **implicitly())
|
|
119
|
+
output_snapshot = await digest_to_snapshot(result.output_digest)
|
|
124
120
|
|
|
125
121
|
return FmtResult(
|
|
126
122
|
input=sources.snapshot,
|
|
@@ -4,13 +4,15 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Iterable
|
|
5
5
|
|
|
6
6
|
from pants.core.goals.lint import LintResult, LintTargetsRequest
|
|
7
|
-
from pants.core.util_rules.external_tool import
|
|
8
|
-
from pants.core.util_rules.partitions import
|
|
7
|
+
from pants.core.util_rules.external_tool import download_external_tool
|
|
8
|
+
from pants.core.util_rules.partitions import PartitionerType
|
|
9
9
|
from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
|
|
10
|
-
from pants.engine.fs import
|
|
10
|
+
from pants.engine.fs import MergeDigests
|
|
11
|
+
from pants.engine.internals.selectors import concurrently
|
|
12
|
+
from pants.engine.intrinsics import merge_digests, execute_process
|
|
11
13
|
from pants.engine.platform import Platform
|
|
12
|
-
from pants.engine.process import
|
|
13
|
-
from pants.engine.rules import
|
|
14
|
+
from pants.engine.process import Process
|
|
15
|
+
from pants.engine.rules import collect_rules, implicitly, rule
|
|
14
16
|
from pants.engine.target import FieldSet, Target
|
|
15
17
|
from pants.util.logging import LogLevel
|
|
16
18
|
|
|
@@ -70,16 +72,16 @@ async def run_ruff_lint(
|
|
|
70
72
|
partition_description=None,
|
|
71
73
|
)
|
|
72
74
|
|
|
73
|
-
# Download ruff and get source files in parallel
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
),
|
|
75
|
+
# Download ruff and get source files in parallel using new intrinsics
|
|
76
|
+
downloaded_ruff_get = download_external_tool(ruff_subsystem.get_request(platform))
|
|
77
|
+
sources_get = SourceFilesRequest(
|
|
78
|
+
sources_fields=[fs.sources for fs in field_sets],
|
|
79
|
+
for_sources_types=(BaselineSourcesField,),
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
downloaded_ruff, sources = await concurrently(
|
|
83
|
+
downloaded_ruff_get,
|
|
84
|
+
implicitly(sources_get, SourceFiles),
|
|
83
85
|
)
|
|
84
86
|
|
|
85
87
|
if not sources.files:
|
|
@@ -92,8 +94,7 @@ async def run_ruff_lint(
|
|
|
92
94
|
)
|
|
93
95
|
|
|
94
96
|
# Merge the ruff binary with the source files
|
|
95
|
-
input_digest = await
|
|
96
|
-
Digest,
|
|
97
|
+
input_digest = await merge_digests(
|
|
97
98
|
MergeDigests([downloaded_ruff.digest, sources.snapshot.digest]),
|
|
98
99
|
)
|
|
99
100
|
|
|
@@ -119,7 +120,7 @@ async def run_ruff_lint(
|
|
|
119
120
|
level=LogLevel.DEBUG,
|
|
120
121
|
)
|
|
121
122
|
|
|
122
|
-
result = await
|
|
123
|
+
result = await execute_process(process, **implicitly())
|
|
123
124
|
|
|
124
125
|
return LintResult(
|
|
125
126
|
exit_code=result.exit_code,
|
|
@@ -5,8 +5,10 @@ from typing import Iterable
|
|
|
5
5
|
|
|
6
6
|
from pants.core.goals.test import TestRequest, TestResult
|
|
7
7
|
from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
|
|
8
|
-
from pants.engine.
|
|
9
|
-
from pants.engine.
|
|
8
|
+
from pants.engine.internals.selectors import concurrently
|
|
9
|
+
from pants.engine.intrinsics import execute_process
|
|
10
|
+
from pants.engine.process import Process
|
|
11
|
+
from pants.engine.rules import collect_rules, implicitly, rule
|
|
10
12
|
from pants.engine.target import FieldSet
|
|
11
13
|
from pants.engine.unions import UnionRule
|
|
12
14
|
from pants.util.logging import LogLevel
|
|
@@ -70,19 +72,20 @@ async def run_pytest(
|
|
|
70
72
|
output_setting=None,
|
|
71
73
|
)
|
|
72
74
|
|
|
73
|
-
# Get test source files
|
|
74
|
-
test_source_files_request
|
|
75
|
+
# Get test and source files in parallel using new intrinsics
|
|
76
|
+
test_source_files_request = SourceFilesRequest(
|
|
75
77
|
sources_fields=[fs.test_sources for fs in field_sets],
|
|
76
78
|
for_sources_types=(BaselineTestSourcesField,),
|
|
77
79
|
)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
# Get source files for coverage
|
|
81
|
-
source_files_request: SourceFilesRequest = SourceFilesRequest(
|
|
80
|
+
source_files_request = SourceFilesRequest(
|
|
82
81
|
sources_fields=[fs.sources for fs in field_sets],
|
|
83
82
|
for_sources_types=(BaselineSourcesField,),
|
|
84
83
|
)
|
|
85
|
-
|
|
84
|
+
|
|
85
|
+
test_sources, sources = await concurrently(
|
|
86
|
+
implicitly(test_source_files_request, SourceFiles),
|
|
87
|
+
implicitly(source_files_request, SourceFiles),
|
|
88
|
+
)
|
|
86
89
|
|
|
87
90
|
if not test_sources.files:
|
|
88
91
|
return TestResult(
|
|
@@ -119,14 +122,14 @@ async def run_pytest(
|
|
|
119
122
|
*test_sources.files,
|
|
120
123
|
]
|
|
121
124
|
|
|
122
|
-
process
|
|
125
|
+
process = Process(
|
|
123
126
|
argv=argv,
|
|
124
127
|
input_digest=test_sources.snapshot.digest,
|
|
125
128
|
description=f"Run pytest on {len(test_sources.files)} test files",
|
|
126
129
|
level=LogLevel.DEBUG,
|
|
127
130
|
)
|
|
128
131
|
|
|
129
|
-
result = await
|
|
132
|
+
result = await execute_process(process, **implicitly())
|
|
130
133
|
|
|
131
134
|
return TestResult(
|
|
132
135
|
exit_code=result.exit_code,
|
|
@@ -4,12 +4,14 @@ from dataclasses import dataclass
|
|
|
4
4
|
from typing import Iterable
|
|
5
5
|
|
|
6
6
|
from pants.core.goals.check import CheckRequest, CheckResult, CheckResults
|
|
7
|
-
from pants.core.util_rules.external_tool import
|
|
7
|
+
from pants.core.util_rules.external_tool import download_external_tool
|
|
8
8
|
from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
|
|
9
|
-
from pants.engine.fs import
|
|
9
|
+
from pants.engine.fs import MergeDigests
|
|
10
|
+
from pants.engine.internals.selectors import concurrently
|
|
11
|
+
from pants.engine.intrinsics import merge_digests, execute_process
|
|
10
12
|
from pants.engine.platform import Platform
|
|
11
|
-
from pants.engine.process import
|
|
12
|
-
from pants.engine.rules import
|
|
13
|
+
from pants.engine.process import Process
|
|
14
|
+
from pants.engine.rules import collect_rules, implicitly, rule
|
|
13
15
|
from pants.engine.target import FieldSet, Target
|
|
14
16
|
from pants.engine.unions import UnionRule
|
|
15
17
|
from pants.util.logging import LogLevel
|
|
@@ -78,16 +80,16 @@ async def run_ty_check(
|
|
|
78
80
|
checker_name="ty",
|
|
79
81
|
)
|
|
80
82
|
|
|
81
|
-
# Download ty and get source files in parallel
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
),
|
|
83
|
+
# Download ty and get source files in parallel using new intrinsics
|
|
84
|
+
downloaded_ty_get = download_external_tool(ty_subsystem.get_request(platform))
|
|
85
|
+
sources_get = SourceFilesRequest(
|
|
86
|
+
sources_fields=[fs.sources for fs in field_sets],
|
|
87
|
+
for_sources_types=(BaselineSourcesField,),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
downloaded_ty, sources = await concurrently(
|
|
91
|
+
downloaded_ty_get,
|
|
92
|
+
implicitly(sources_get, SourceFiles),
|
|
91
93
|
)
|
|
92
94
|
|
|
93
95
|
if not sources.files:
|
|
@@ -104,8 +106,7 @@ async def run_ty_check(
|
|
|
104
106
|
)
|
|
105
107
|
|
|
106
108
|
# Merge the ty binary with the source files
|
|
107
|
-
input_digest = await
|
|
108
|
-
Digest,
|
|
109
|
+
input_digest = await merge_digests(
|
|
109
110
|
MergeDigests([downloaded_ty.digest, sources.snapshot.digest]),
|
|
110
111
|
)
|
|
111
112
|
|
|
@@ -129,7 +130,7 @@ async def run_ty_check(
|
|
|
129
130
|
level=LogLevel.DEBUG,
|
|
130
131
|
)
|
|
131
132
|
|
|
132
|
-
result = await
|
|
133
|
+
result = await execute_process(process, **implicitly())
|
|
133
134
|
|
|
134
135
|
return CheckResults(
|
|
135
136
|
results=[
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from pants.engine.rules import collect_rules
|
|
5
6
|
from pants.option.option_types import BoolOption, IntOption, StrListOption, StrOption
|
|
6
7
|
from pants.option.subsystem import Subsystem
|
|
7
8
|
|
|
@@ -72,3 +73,8 @@ class BaselineSubsystem(Subsystem):
|
|
|
72
73
|
"""Return Python version in format suitable for tools (e.g., 'py311')."""
|
|
73
74
|
version = self.python_version.replace(".", "")
|
|
74
75
|
return f"py{version}"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def rules():
|
|
79
|
+
"""Return rules for the baseline subsystem."""
|
|
80
|
+
return collect_rules()
|
|
@@ -4,7 +4,10 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from pants.core.util_rules.external_tool import ExternalTool
|
|
6
6
|
from pants.engine.platform import Platform
|
|
7
|
+
from pants.engine.rules import collect_rules
|
|
8
|
+
from pants.engine.unions import UnionRule
|
|
7
9
|
from pants.option.option_types import BoolOption, SkipOption, StrListOption, StrOption
|
|
10
|
+
from pants.core.goals.generate_lockfiles import ExportableTool
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class RuffSubsystem(ExternalTool):
|
|
@@ -112,3 +115,11 @@ class RuffSubsystem(ExternalTool):
|
|
|
112
115
|
],
|
|
113
116
|
help="Rules to skip in __init__.py files.",
|
|
114
117
|
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def rules():
|
|
121
|
+
"""Return rules for the Ruff subsystem."""
|
|
122
|
+
return (
|
|
123
|
+
*collect_rules(),
|
|
124
|
+
UnionRule(ExportableTool, RuffSubsystem),
|
|
125
|
+
)
|
pants_baseline/subsystems/ty.py
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from pants.core.goals.generate_lockfiles import ExportableTool
|
|
5
6
|
from pants.core.util_rules.external_tool import ExternalTool
|
|
6
7
|
from pants.engine.platform import Platform
|
|
8
|
+
from pants.engine.rules import collect_rules
|
|
9
|
+
from pants.engine.unions import UnionRule
|
|
7
10
|
from pants.option.option_types import BoolOption, StrListOption, StrOption
|
|
8
11
|
|
|
9
12
|
|
|
@@ -99,3 +102,11 @@ class TySubsystem(ExternalTool):
|
|
|
99
102
|
default="text",
|
|
100
103
|
help="Output format for type errors ('text', 'json', 'github').",
|
|
101
104
|
)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def rules():
|
|
108
|
+
"""Return rules for the ty subsystem."""
|
|
109
|
+
return (
|
|
110
|
+
*collect_rules(),
|
|
111
|
+
UnionRule(ExportableTool, TySubsystem),
|
|
112
|
+
)
|
pants_baseline/subsystems/uv.py
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from pants.core.goals.generate_lockfiles import ExportableTool
|
|
5
6
|
from pants.core.util_rules.external_tool import ExternalTool
|
|
6
7
|
from pants.engine.platform import Platform
|
|
8
|
+
from pants.engine.rules import collect_rules
|
|
9
|
+
from pants.engine.unions import UnionRule
|
|
7
10
|
from pants.option.option_types import BoolOption, StrListOption, StrOption
|
|
8
11
|
|
|
9
12
|
|
|
@@ -85,3 +88,11 @@ class UvSubsystem(ExternalTool):
|
|
|
85
88
|
default=[],
|
|
86
89
|
help="Additional arguments to pass to uv commands.",
|
|
87
90
|
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def rules():
|
|
94
|
+
"""Return rules for the uv subsystem."""
|
|
95
|
+
return (
|
|
96
|
+
*collect_rules(),
|
|
97
|
+
UnionRule(ExportableTool, UvSubsystem),
|
|
98
|
+
)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
pants_baseline/__about__.py,sha256=K9w-lLXC4K_robRw7SF7qqSb6u4B6D4gWuTWKdrEanw,98
|
|
2
|
-
pants_baseline/__init__.py,sha256=uVRGi1D2gFjc7emmeewWdcvpO-NsUuKsMbX3rztOxWU,655
|
|
3
|
-
pants_baseline/bundled_claude_plugins.py,sha256=rHchQRQ_UabOOKyQOxVwoyE2xLjE8eiUFVN7oERDCe0,1608
|
|
4
|
-
pants_baseline/register.py,sha256=gdODsaI7VIzU2tGONANsg9KbKZkHidmLs2AyvUNIypg,1675
|
|
5
|
-
pants_baseline/targets.py,sha256=Z9O09Aqd5inMqwIUFt4HSE9HtWjn8pGSU4FZHg22Tpo,3379
|
|
6
|
-
pants_baseline/goals/__init__.py,sha256=pf6KU2CIQuDkx8ER3IS0H-kuNbBtX-AH5B5SnSP9_yw,192
|
|
7
|
-
pants_baseline/goals/audit.py,sha256=i7zyyKssWw6EE2zN5putWP9sikkcjUKn7g3Jrapv994,2380
|
|
8
|
-
pants_baseline/goals/fmt.py,sha256=CyUPhy42rscUzJp4DhSRp3FGhGYcIKN42b46l1hJ9tY,2432
|
|
9
|
-
pants_baseline/goals/lint.py,sha256=vGyG-wvjgjE4dgglmTOiFNnng2bQbOQXkZ3Fd2HdiOU,2435
|
|
10
|
-
pants_baseline/goals/test.py,sha256=THW4kJAFbAzPCjLbq1dxg81T19QdywXYiwTNKSB4z8M,1653
|
|
11
|
-
pants_baseline/goals/typecheck.py,sha256=nqfwy1BZqhEzlDX-_hme9mKuDI2KqH-XpN4ygzWMQ6Y,2626
|
|
12
|
-
pants_baseline/rules/__init__.py,sha256=UpvDpGVImhRfp2_VeUNsRPGiWjBbMI6AV1-Yx3kS0Gg,252
|
|
13
|
-
pants_baseline/rules/audit_rules.py,sha256=gr-2u0u07z62Q42c9vXVGJng8UPIP5JzZ-SKrl9z7yM,2762
|
|
14
|
-
pants_baseline/rules/fmt_rules.py,sha256=e4L6X1IZToRyleSI-Zif93-WYa-OVXQKT7rKHg-RESk,4218
|
|
15
|
-
pants_baseline/rules/lint_rules.py,sha256=jNMdkbt7Mv528KF83rMptPK3kg3OviAeetCvgtlOP7c,4219
|
|
16
|
-
pants_baseline/rules/test_rules.py,sha256=jj4lk3-mueOPujPFPK2TCdBFZZA_vovdDdHED9jGp7U,4225
|
|
17
|
-
pants_baseline/rules/typecheck_rules.py,sha256=XmL6uIXwjphB1YDVMrCM6A_Wa_1H-gHuLg8x59v_YQo,4499
|
|
18
|
-
pants_baseline/subsystems/__init__.py,sha256=LteH_qmUIgRAnXYmmi7f6o894QfpY3hMNH5dlvJbSoM,387
|
|
19
|
-
pants_baseline/subsystems/baseline.py,sha256=KWDRMdLOUN5cNHntY8f97bSsoITXwmX4ET6n2aW-cRk,2049
|
|
20
|
-
pants_baseline/subsystems/ruff.py,sha256=NW0AFv59-j6ANkZG8LjvuXPzWBD4yDsEr7Pb6eZbdck,3941
|
|
21
|
-
pants_baseline/subsystems/ty.py,sha256=OpaU8Z7Bk6kj5QAfhPom5L9v8sKNR8XF664_U5mUVJw,3419
|
|
22
|
-
pants_baseline/subsystems/uv.py,sha256=dXmVzg4ZxzHa4g_TowEZXMYuhKiTOHjqqadkNrZQ9jk,3066
|
|
23
|
-
jaymd96_pants_baseline-0.2.2.dist-info/METADATA,sha256=BbOQ7N5F85iTRBCSEFiPVK9xoxg2YAWlhItO0ruRZyk,8764
|
|
24
|
-
jaymd96_pants_baseline-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
25
|
-
jaymd96_pants_baseline-0.2.2.dist-info/licenses/LICENSE,sha256=oLGLZv7XKM_oKCbdMW1bZB37SXsdexmhNSuh3Xg4m4I,10754
|
|
26
|
-
jaymd96_pants_baseline-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
{jaymd96_pants_baseline-0.2.2.dist-info → jaymd96_pants_baseline-0.2.4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|