jaymd96-pants-baseline 0.2.2__py3-none-any.whl → 0.2.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jaymd96-pants-baseline
3
- Version: 0.2.2
3
+ Version: 0.2.5
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=aRtmXIH9GkUkoHOTtIdKb9mgSqNQenoXYmbXPqXvv2Y,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=_ahV7CRNWxv4lUXb03ZBM9vJnP4ekLw8DgnpInVK35o,1078
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=uVpm4GXTXEml_dMxZ4hzkWNVjBPEjfK83KhL6QBmDrw,3840
15
+ pants_baseline/rules/lint_rules.py,sha256=U44iqnniHXb-Ayl9_Jmz0apZOrer4vzMd98sLUXDh0k,4413
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.5.dist-info/METADATA,sha256=qUXXXkNLlWGZeRmN4fzqBgfHhnsofaeUvVnsJKnrDOo,8764
24
+ jaymd96_pants_baseline-0.2.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
25
+ jaymd96_pants_baseline-0.2.5.dist-info/licenses/LICENSE,sha256=oLGLZv7XKM_oKCbdMW1bZB37SXsdexmhNSuh3Xg4m4I,10754
26
+ jaymd96_pants_baseline-0.2.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  """Version information for jaymd96-pants-baseline."""
2
2
 
3
- __version__ = "0.2.2"
3
+ __version__ = "0.2.5"
4
4
  __author__ = "James"
@@ -2,22 +2,16 @@
2
2
 
3
3
  This module is the entry point for the Pants plugin system.
4
4
  It registers all rules, targets, and subsystems provided by this plugin.
5
+
6
+ This plugin integrates with Pants' built-in lint, fmt, and check goals
7
+ rather than providing custom goals.
5
8
  """
6
9
 
7
10
  from typing import Iterable
8
11
 
9
12
  from pants.engine.rules import Rule
10
13
 
11
- from pants_baseline.goals import audit as audit_goal
12
- from pants_baseline.goals import fmt as fmt_goal
13
- from pants_baseline.goals import lint as lint_goal
14
- from pants_baseline.goals import test as test_goal
15
- from pants_baseline.goals import typecheck as typecheck_goal
16
- from pants_baseline.rules import audit_rules, fmt_rules, lint_rules, test_rules, typecheck_rules
17
- from pants_baseline.subsystems.baseline import BaselineSubsystem
18
- from pants_baseline.subsystems.ruff import RuffSubsystem
19
- from pants_baseline.subsystems.ty import TySubsystem
20
- from pants_baseline.subsystems.uv import UvSubsystem
14
+ from pants_baseline.rules import fmt_rules, lint_rules
21
15
  from pants_baseline.targets import BaselinePythonProject
22
16
 
23
17
 
@@ -29,16 +23,9 @@ def rules() -> Iterable[Rule]:
29
23
  rather than using collect_rules() which only collects @rule functions.
30
24
  """
31
25
  return [
26
+ # Tool rules (integrate with Pants built-in lint/fmt goals)
32
27
  *lint_rules.rules(),
33
28
  *fmt_rules.rules(),
34
- *typecheck_rules.rules(),
35
- *test_rules.rules(),
36
- *audit_rules.rules(),
37
- *lint_goal.rules(),
38
- *fmt_goal.rules(),
39
- *typecheck_goal.rules(),
40
- *test_goal.rules(),
41
- *audit_goal.rules(),
42
29
  ]
43
30
 
44
31
 
@@ -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 DownloadedExternalTool, ExternalToolRequest
7
- from pants.engine.fs import Digest, MergeDigests, PathGlobs, Snapshot
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 FallibleProcessResult, Process
10
- from pants.engine.rules import Get, collect_rules, rule
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
- downloaded_uv = await Get(
44
- DownloadedExternalTool,
45
- ExternalToolRequest,
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
- # Get the lock file if it exists
50
- lock_file_snapshot = await Get(
51
- Snapshot,
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 Get(
57
- Digest,
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 Get(FallibleProcessResult, Process, process)
80
+ result = await execute_process(process, **implicitly())
82
81
 
83
82
  stdout = result.stdout.decode()
84
83
  stderr = result.stderr.decode()
@@ -1,18 +1,19 @@
1
1
  """Rules for Ruff formatting."""
2
2
 
3
3
  from dataclasses import dataclass
4
- from typing import Iterable
4
+ from typing import Any, Iterable
5
5
 
6
6
  from pants.core.goals.fmt import FmtResult, FmtTargetsRequest
7
+ from pants.core.util_rules.external_tool import DownloadedExternalTool, 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
- from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
10
9
  from pants.engine.fs import Digest, MergeDigests, Snapshot
10
+ from pants.engine.intrinsics import digest_to_snapshot, merge_digests
11
11
  from pants.engine.platform import Platform
12
- from pants.engine.process import FallibleProcessResult, Process
13
- from pants.engine.rules import Get, MultiGet, collect_rules, rule
12
+ from pants.engine.process import FallibleProcessResult, Process, execute_process_or_raise
13
+ from pants.engine.rules import collect_rules, implicitly, rule
14
14
  from pants.engine.target import FieldSet, Target
15
15
  from pants.util.logging import LogLevel
16
+ from pants.util.meta import classproperty
16
17
 
17
18
  from pants_baseline.subsystems.baseline import BaselineSubsystem
18
19
  from pants_baseline.subsystems.ruff import RuffSubsystem
@@ -41,61 +42,41 @@ class RuffFmtRequest(FmtTargetsRequest):
41
42
  tool_subsystem = RuffSubsystem
42
43
  partitioner_type = PartitionerType.DEFAULT_SINGLE_PARTITION
43
44
 
45
+ @classproperty
46
+ def tool_name(cls) -> str:
47
+ return "baseline-ruff-fmt"
48
+
49
+ @classproperty
50
+ def tool_id(cls) -> str:
51
+ return "baseline-ruff-fmt"
52
+
44
53
 
45
54
  @rule(desc="Format with Ruff", level=LogLevel.DEBUG)
46
55
  async def run_ruff_fmt(
47
- request: RuffFmtRequest.Batch,
56
+ request: RuffFmtRequest.Batch[RuffFmtFieldSet, Any],
48
57
  ruff_subsystem: RuffSubsystem,
49
58
  baseline_subsystem: BaselineSubsystem,
50
59
  platform: Platform,
51
60
  ) -> FmtResult:
52
61
  """Run Ruff formatter on Python files."""
53
- field_sets = request.elements
54
- snapshot = request.snapshot
62
+ if ruff_subsystem.skip:
63
+ return FmtResult.skip(request, formatter_name="baseline-ruff-fmt")
55
64
 
56
65
  if not baseline_subsystem.enabled:
57
- return FmtResult(
58
- input=snapshot,
59
- output=snapshot,
60
- stdout="",
61
- stderr="",
62
- formatter_name="ruff",
63
- )
64
-
65
- if not field_sets:
66
- return FmtResult(
67
- input=snapshot,
68
- output=snapshot,
69
- stdout="No targets to format",
70
- stderr="",
71
- formatter_name="ruff",
72
- )
73
-
74
- # Download ruff and get source files in parallel
75
- downloaded_ruff, sources = await MultiGet(
76
- Get(DownloadedExternalTool, ExternalToolRequest, ruff_subsystem.get_request(platform)),
77
- Get(
78
- SourceFiles,
79
- SourceFilesRequest(
80
- sources_fields=[fs.sources for fs in field_sets],
81
- for_sources_types=(BaselineSourcesField,),
82
- ),
83
- ),
84
- )
66
+ return FmtResult.skip(request, formatter_name="baseline-ruff-fmt")
85
67
 
86
- if not sources.files:
87
- return FmtResult(
88
- input=snapshot,
89
- output=snapshot,
90
- stdout="No files to format",
91
- stderr="",
92
- formatter_name="ruff",
93
- )
68
+ snapshot = request.snapshot
69
+ if not snapshot.files:
70
+ return FmtResult.skip(request, formatter_name="baseline-ruff-fmt")
71
+
72
+ # Download ruff
73
+ downloaded_ruff: DownloadedExternalTool = await download_external_tool(
74
+ ruff_subsystem.get_request(platform)
75
+ )
94
76
 
95
77
  # Merge the ruff binary with the source files
96
- input_digest = await Get(
97
- Digest,
98
- MergeDigests([downloaded_ruff.digest, sources.snapshot.digest]),
78
+ input_digest: Digest = await merge_digests(
79
+ MergeDigests([downloaded_ruff.digest, snapshot.digest]),
99
80
  )
100
81
 
101
82
  # Build Ruff format command
@@ -106,28 +87,28 @@ async def run_ruff_fmt(
106
87
  f"--line-length={baseline_subsystem.line_length}",
107
88
  f"--quote-style={ruff_subsystem.quote_style}",
108
89
  f"--indent-style={ruff_subsystem.indent_style}",
109
- *sources.files,
90
+ *snapshot.files,
110
91
  ]
111
92
 
112
93
  process = Process(
113
94
  argv=argv,
114
95
  input_digest=input_digest,
115
- output_files=sources.files,
116
- description=f"Run Ruff format on {len(sources.files)} files",
96
+ output_files=snapshot.files,
97
+ description=f"Run Ruff format on {len(snapshot.files)} files",
117
98
  level=LogLevel.DEBUG,
118
99
  )
119
100
 
120
- result = await Get(FallibleProcessResult, Process, process)
121
-
122
- output_digest: Digest = result.output_digest
123
- output_snapshot = await Get(Snapshot, Digest, output_digest)
101
+ result: FallibleProcessResult = await execute_process_or_raise(
102
+ **implicitly(process)
103
+ )
104
+ output_snapshot: Snapshot = await digest_to_snapshot(result.output_digest)
124
105
 
125
106
  return FmtResult(
126
- input=sources.snapshot,
107
+ input=snapshot,
127
108
  output=output_snapshot,
128
109
  stdout=result.stdout.decode(),
129
110
  stderr=result.stderr.decode(),
130
- formatter_name="ruff",
111
+ formatter_name="baseline-ruff-fmt",
131
112
  )
132
113
 
133
114
 
@@ -1,18 +1,20 @@
1
1
  """Rules for Ruff linting."""
2
2
 
3
3
  from dataclasses import dataclass
4
- from typing import Iterable
4
+ from typing import Any, Iterable
5
5
 
6
6
  from pants.core.goals.lint import LintResult, LintTargetsRequest
7
- from pants.core.util_rules.external_tool import DownloadedExternalTool, ExternalToolRequest
8
- from pants.core.util_rules.partitions import Partitions, PartitionerType
9
- from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
7
+ from pants.core.util_rules.external_tool import DownloadedExternalTool, download_external_tool
8
+ from pants.core.util_rules.partitions import PartitionerType
9
+ from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest, determine_source_files
10
10
  from pants.engine.fs import Digest, MergeDigests
11
+ from pants.engine.intrinsics import merge_digests
11
12
  from pants.engine.platform import Platform
12
- from pants.engine.process import FallibleProcessResult, Process
13
- from pants.engine.rules import Get, MultiGet, collect_rules, rule
13
+ from pants.engine.process import FallibleProcessResult, Process, execute_process_or_raise
14
+ from pants.engine.rules import collect_rules, implicitly, rule
14
15
  from pants.engine.target import FieldSet, Target
15
16
  from pants.util.logging import LogLevel
17
+ from pants.util.meta import classproperty
16
18
 
17
19
  from pants_baseline.subsystems.baseline import BaselineSubsystem
18
20
  from pants_baseline.subsystems.ruff import RuffSubsystem
@@ -41,59 +43,50 @@ class RuffLintRequest(LintTargetsRequest):
41
43
  tool_subsystem = RuffSubsystem
42
44
  partitioner_type = PartitionerType.DEFAULT_SINGLE_PARTITION
43
45
 
46
+ @classproperty
47
+ def tool_name(cls) -> str:
48
+ return "baseline-ruff"
49
+
50
+ @classproperty
51
+ def tool_id(cls) -> str:
52
+ return "baseline-ruff"
53
+
44
54
 
45
55
  @rule(desc="Lint with Ruff", level=LogLevel.DEBUG)
46
56
  async def run_ruff_lint(
47
- request: RuffLintRequest.Batch,
57
+ request: RuffLintRequest.Batch[RuffLintFieldSet, Any],
48
58
  ruff_subsystem: RuffSubsystem,
49
59
  baseline_subsystem: BaselineSubsystem,
50
60
  platform: Platform,
51
61
  ) -> LintResult:
52
62
  """Run Ruff linter on Python files."""
63
+ if ruff_subsystem.skip:
64
+ return LintResult.create(request, exit_code=0, stdout="", stderr="", strip_chroot_path=True)
65
+
53
66
  if not baseline_subsystem.enabled:
54
- return LintResult(
55
- exit_code=0,
56
- stdout="",
57
- stderr="",
58
- linter_name="ruff",
59
- partition_description=None,
60
- )
67
+ return LintResult.create(request, exit_code=0, stdout="", stderr="", strip_chroot_path=True)
61
68
 
62
- field_sets = request.elements
69
+ field_sets = list(request.elements)
63
70
 
64
71
  if not field_sets:
65
- return LintResult(
66
- exit_code=0,
67
- stdout="No targets to lint",
68
- stderr="",
69
- linter_name="ruff",
70
- partition_description=None,
71
- )
72
+ return LintResult.create(request, exit_code=0, stdout="No targets to lint", stderr="", strip_chroot_path=True)
72
73
 
73
- # Download ruff and get source files in parallel
74
- downloaded_ruff, sources = await MultiGet(
75
- Get(DownloadedExternalTool, ExternalToolRequest, ruff_subsystem.get_request(platform)),
76
- Get(
77
- SourceFiles,
78
- SourceFilesRequest(
79
- sources_fields=[fs.sources for fs in field_sets],
80
- for_sources_types=(BaselineSourcesField,),
81
- ),
82
- ),
74
+ # Download ruff and get source files
75
+ downloaded_ruff: DownloadedExternalTool = await download_external_tool(
76
+ ruff_subsystem.get_request(platform)
77
+ )
78
+ sources: SourceFiles = await determine_source_files(
79
+ SourceFilesRequest(
80
+ sources_fields=[fs.sources for fs in field_sets],
81
+ for_sources_types=(BaselineSourcesField,),
82
+ )
83
83
  )
84
84
 
85
85
  if not sources.files:
86
- return LintResult(
87
- exit_code=0,
88
- stdout="No files to lint",
89
- stderr="",
90
- linter_name="ruff",
91
- partition_description=None,
92
- )
86
+ return LintResult.create(request, exit_code=0, stdout="No files to lint", stderr="", strip_chroot_path=True)
93
87
 
94
88
  # Merge the ruff binary with the source files
95
- input_digest = await Get(
96
- Digest,
89
+ input_digest: Digest = await merge_digests(
97
90
  MergeDigests([downloaded_ruff.digest, sources.snapshot.digest]),
98
91
  )
99
92
 
@@ -119,14 +112,16 @@ async def run_ruff_lint(
119
112
  level=LogLevel.DEBUG,
120
113
  )
121
114
 
122
- result = await Get(FallibleProcessResult, Process, process)
115
+ result: FallibleProcessResult = await execute_process_or_raise(
116
+ **implicitly(process)
117
+ )
123
118
 
124
- return LintResult(
119
+ return LintResult.create(
120
+ request,
125
121
  exit_code=result.exit_code,
126
122
  stdout=result.stdout.decode(),
127
123
  stderr=result.stderr.decode(),
128
- linter_name="ruff",
129
- partition_description=request.partition_metadata,
124
+ strip_chroot_path=True,
130
125
  )
131
126
 
132
127
 
@@ -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.process import FallibleProcessResult, Process
9
- from pants.engine.rules import Get, collect_rules, rule
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: SourceFilesRequest = SourceFilesRequest(
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
- test_sources = await Get(SourceFiles, SourceFilesRequest, test_source_files_request)
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
- sources = await Get(SourceFiles, SourceFilesRequest, source_files_request)
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: Process = 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 Get(FallibleProcessResult, Process, process)
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 DownloadedExternalTool, ExternalToolRequest
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 Digest, MergeDigests
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 FallibleProcessResult, Process
12
- from pants.engine.rules import Get, MultiGet, collect_rules, rule
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
- downloaded_ty, sources = await MultiGet(
83
- Get(DownloadedExternalTool, ExternalToolRequest, ty_subsystem.get_request(platform)),
84
- Get(
85
- SourceFiles,
86
- SourceFilesRequest(
87
- sources_fields=[fs.sources for fs in field_sets],
88
- for_sources_types=(BaselineSourcesField,),
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 Get(
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 Get(FallibleProcessResult, Process, process)
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
+ )
@@ -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
+ )
@@ -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,,