jaymd96-pants-baseline 0.1.9__tar.gz → 0.2.0__tar.gz

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.
Files changed (34) hide show
  1. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/PKG-INFO +36 -3
  2. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/README.md +33 -2
  3. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/pyproject.toml +3 -0
  4. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/__about__.py +1 -1
  5. jaymd96_pants_baseline-0.2.0/src/pants_baseline/bundled_claude_plugins.py +29 -0
  6. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/rules/fmt_rules.py +20 -15
  7. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/rules/lint_rules.py +14 -9
  8. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/rules/typecheck_rules.py +6 -1
  9. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/subsystems/ruff.py +4 -1
  10. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/.gitignore +0 -0
  11. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/LICENSE +0 -0
  12. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/__init__.py +0 -0
  13. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/goals/__init__.py +0 -0
  14. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/goals/audit.py +0 -0
  15. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/goals/fmt.py +0 -0
  16. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/goals/lint.py +0 -0
  17. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/goals/test.py +0 -0
  18. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/goals/typecheck.py +0 -0
  19. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/register.py +0 -0
  20. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/rules/__init__.py +0 -0
  21. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/rules/audit_rules.py +0 -0
  22. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/rules/test_rules.py +0 -0
  23. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/subsystems/__init__.py +0 -0
  24. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/subsystems/baseline.py +0 -0
  25. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/subsystems/ty.py +0 -0
  26. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/subsystems/uv.py +0 -0
  27. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/src/pants_baseline/targets.py +0 -0
  28. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/__init__.py +0 -0
  29. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/conftest.py +0 -0
  30. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/integration/__init__.py +0 -0
  31. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/integration/test_goals.py +0 -0
  32. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/unit/__init__.py +0 -0
  33. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/unit/test_subsystems.py +0 -0
  34. {jaymd96_pants_baseline-0.1.9 → jaymd96_pants_baseline-0.2.0}/tests/unit/test_targets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jaymd96-pants-baseline
3
- Version: 0.1.9
3
+ Version: 0.2.0
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
@@ -21,6 +21,8 @@ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Topic :: Software Development :: Build Tools
22
22
  Classifier: Topic :: Software Development :: Quality Assurance
23
23
  Requires-Python: <4,>=3.11
24
+ Provides-Extra: claude
25
+ Requires-Dist: jaymd96-pants-claude-plugins>=0.2.0; extra == 'claude'
24
26
  Provides-Extra: dev
25
27
  Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
26
28
  Requires-Dist: pytest>=7.4.0; extra == 'dev'
@@ -54,7 +56,7 @@ backend_packages = [
54
56
  ]
55
57
 
56
58
  plugins = [
57
- "jaymd96-pants-baseline==0.1.0",
59
+ "jaymd96-pants-baseline==0.2.0",
58
60
  ]
59
61
  ```
60
62
 
@@ -308,7 +310,7 @@ backend_packages = [
308
310
  "pants.backend.python",
309
311
  "pants_baseline",
310
312
  ]
311
- plugins = ["jaymd96-pants-baseline==0.1.0"]
313
+ plugins = ["jaymd96-pants-baseline==0.2.0"]
312
314
 
313
315
  [python]
314
316
  interpreter_constraints = ["CPython>=3.13,<4"]
@@ -346,6 +348,37 @@ strict = true
346
348
  | MyPy/Pyright | ty |
347
349
  | pip-audit | uv audit |
348
350
 
351
+ ## Claude Code Integration
352
+
353
+ This plugin bundles recommended [Claude Code](https://claude.ai/code) plugins for enhanced AI-assisted development workflows.
354
+
355
+ ### Install Bundled Claude Plugins
356
+
357
+ When combined with [jaymd96-pants-claude-plugins](https://github.com/jaymd96/pants-claude-plugins):
358
+
359
+ ```toml
360
+ # pants.toml
361
+ [GLOBAL]
362
+ plugins = [
363
+ "jaymd96-pants-baseline==0.2.0",
364
+ "jaymd96-pants-claude-plugins>=0.2.0",
365
+ ]
366
+ backend_packages = [
367
+ "pants_baseline",
368
+ "pants_claude_plugins",
369
+ ]
370
+ ```
371
+
372
+ Then run:
373
+
374
+ ```bash
375
+ pants claude-install --include-bundled ::
376
+ ```
377
+
378
+ This automatically installs:
379
+ - **github** - GitHub integration for PR workflows and issue management
380
+ - **commit-commands** - Git workflow commands for commits, pushes, and PRs
381
+
349
382
  ## Development
350
383
 
351
384
  ### Setup
@@ -25,7 +25,7 @@ backend_packages = [
25
25
  ]
26
26
 
27
27
  plugins = [
28
- "jaymd96-pants-baseline==0.1.0",
28
+ "jaymd96-pants-baseline==0.2.0",
29
29
  ]
30
30
  ```
31
31
 
@@ -279,7 +279,7 @@ backend_packages = [
279
279
  "pants.backend.python",
280
280
  "pants_baseline",
281
281
  ]
282
- plugins = ["jaymd96-pants-baseline==0.1.0"]
282
+ plugins = ["jaymd96-pants-baseline==0.2.0"]
283
283
 
284
284
  [python]
285
285
  interpreter_constraints = ["CPython>=3.13,<4"]
@@ -317,6 +317,37 @@ strict = true
317
317
  | MyPy/Pyright | ty |
318
318
  | pip-audit | uv audit |
319
319
 
320
+ ## Claude Code Integration
321
+
322
+ This plugin bundles recommended [Claude Code](https://claude.ai/code) plugins for enhanced AI-assisted development workflows.
323
+
324
+ ### Install Bundled Claude Plugins
325
+
326
+ When combined with [jaymd96-pants-claude-plugins](https://github.com/jaymd96/pants-claude-plugins):
327
+
328
+ ```toml
329
+ # pants.toml
330
+ [GLOBAL]
331
+ plugins = [
332
+ "jaymd96-pants-baseline==0.2.0",
333
+ "jaymd96-pants-claude-plugins>=0.2.0",
334
+ ]
335
+ backend_packages = [
336
+ "pants_baseline",
337
+ "pants_claude_plugins",
338
+ ]
339
+ ```
340
+
341
+ Then run:
342
+
343
+ ```bash
344
+ pants claude-install --include-bundled ::
345
+ ```
346
+
347
+ This automatically installs:
348
+ - **github** - GitHub integration for PR workflows and issue management
349
+ - **commit-commands** - Git workflow commands for commits, pushes, and PRs
350
+
320
351
  ## Development
321
352
 
322
353
  ### Setup
@@ -45,6 +45,9 @@ dev = [
45
45
  "pytest-cov>=4.1.0",
46
46
  "ruff>=0.2.0",
47
47
  ]
48
+ claude = [
49
+ "jaymd96-pants-claude-plugins>=0.2.0",
50
+ ]
48
51
 
49
52
  [project.urls]
50
53
  Homepage = "https://github.com/jaymd96/pants-baseline"
@@ -1,4 +1,4 @@
1
1
  """Version information for jaymd96-pants-baseline."""
2
2
 
3
- __version__ = "0.1.9"
3
+ __version__ = "0.2.0"
4
4
  __author__ = "James"
@@ -0,0 +1,29 @@
1
+ """Bundled Claude Code plugins for pants-baseline.
2
+
3
+ These plugins are automatically discovered and installed when users run:
4
+ pants claude-install --include-bundled ::
5
+
6
+ This requires the jaymd96-pants-claude-plugins package to be installed.
7
+ """
8
+
9
+ # Marketplaces to add before installing plugins
10
+ # The demo marketplace contains commit-commands and other workflow plugins
11
+ BUNDLED_MARKETPLACES = [
12
+ "anthropics/claude-code", # Demo plugins marketplace
13
+ ]
14
+
15
+ # Claude Code plugins to install
16
+ BUNDLED_CLAUDE_PLUGINS = [
17
+ {
18
+ "plugin": "github",
19
+ "marketplace": "claude-plugins-official",
20
+ "scope": "project",
21
+ "description": "GitHub integration for PR workflows and issue management",
22
+ },
23
+ {
24
+ "plugin": "commit-commands",
25
+ "marketplace": "anthropics-claude-code",
26
+ "scope": "project",
27
+ "description": "Git workflow commands for commits, pushes, and PRs",
28
+ },
29
+ ]
@@ -3,15 +3,14 @@
3
3
  from dataclasses import dataclass
4
4
  from typing import Iterable
5
5
 
6
- from pants.core.goals.fmt import FmtResult, FmtTargetsRequest
6
+ from pants.core.goals.fmt import FmtResult, FmtTargetsRequest, PartitionerType
7
7
  from pants.core.util_rules.external_tool import DownloadedExternalTool, ExternalToolRequest
8
8
  from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
9
9
  from pants.engine.fs import Digest, MergeDigests, Snapshot
10
10
  from pants.engine.platform import Platform
11
11
  from pants.engine.process import FallibleProcessResult, Process
12
12
  from pants.engine.rules import Get, MultiGet, collect_rules, rule
13
- from pants.engine.target import FieldSet
14
- from pants.engine.unions import UnionRule
13
+ from pants.engine.target import FieldSet, Target
15
14
  from pants.util.logging import LogLevel
16
15
 
17
16
  from pants_baseline.subsystems.baseline import BaselineSubsystem
@@ -28,38 +27,44 @@ class RuffFmtFieldSet(FieldSet):
28
27
  sources: BaselineSourcesField
29
28
  skip_fmt: SkipFormatField
30
29
 
30
+ @classmethod
31
+ def opt_out(cls, tgt: Target) -> bool:
32
+ """Allow targets to opt out of formatting."""
33
+ return tgt.get(SkipFormatField).value
34
+
31
35
 
32
36
  class RuffFmtRequest(FmtTargetsRequest):
33
37
  """Request to run Ruff formatting."""
34
38
 
35
39
  field_set_type = RuffFmtFieldSet
36
- tool_name = "ruff"
40
+ tool_subsystem = RuffSubsystem
41
+ partitioner_type = PartitionerType.DEFAULT_SINGLE_PARTITION
37
42
 
38
43
 
39
44
  @rule(desc="Format with Ruff", level=LogLevel.DEBUG)
40
45
  async def run_ruff_fmt(
41
- request: RuffFmtRequest,
46
+ request: RuffFmtRequest.Batch,
42
47
  ruff_subsystem: RuffSubsystem,
43
48
  baseline_subsystem: BaselineSubsystem,
44
49
  platform: Platform,
45
50
  ) -> FmtResult:
46
51
  """Run Ruff formatter on Python files."""
52
+ field_sets = request.elements
53
+ snapshot = request.snapshot
54
+
47
55
  if not baseline_subsystem.enabled:
48
56
  return FmtResult(
49
- input=request.snapshot,
50
- output=request.snapshot,
57
+ input=snapshot,
58
+ output=snapshot,
51
59
  stdout="",
52
60
  stderr="",
53
61
  formatter_name="ruff",
54
62
  )
55
63
 
56
- # Filter out skipped targets
57
- field_sets = [fs for fs in request.field_sets if not fs.skip_fmt.value]
58
-
59
64
  if not field_sets:
60
65
  return FmtResult(
61
- input=request.snapshot,
62
- output=request.snapshot,
66
+ input=snapshot,
67
+ output=snapshot,
63
68
  stdout="No targets to format",
64
69
  stderr="",
65
70
  formatter_name="ruff",
@@ -79,8 +84,8 @@ async def run_ruff_fmt(
79
84
 
80
85
  if not sources.files:
81
86
  return FmtResult(
82
- input=request.snapshot,
83
- output=request.snapshot,
87
+ input=snapshot,
88
+ output=snapshot,
84
89
  stdout="No files to format",
85
90
  stderr="",
86
91
  formatter_name="ruff",
@@ -129,5 +134,5 @@ def rules() -> Iterable:
129
134
  """Return all format rules."""
130
135
  return [
131
136
  *collect_rules(),
132
- UnionRule(FmtTargetsRequest, RuffFmtRequest),
137
+ *RuffFmtRequest.rules(),
133
138
  ]
@@ -3,15 +3,15 @@
3
3
  from dataclasses import dataclass
4
4
  from typing import Iterable
5
5
 
6
- from pants.core.goals.lint import LintResult, LintTargetsRequest
6
+ from pants.core.goals.lint import LintResult, LintTargetsRequest, PartitionerType
7
7
  from pants.core.util_rules.external_tool import DownloadedExternalTool, ExternalToolRequest
8
+ from pants.core.util_rules.partitions import Partitions
8
9
  from pants.core.util_rules.source_files import SourceFiles, SourceFilesRequest
9
10
  from pants.engine.fs import Digest, MergeDigests
10
11
  from pants.engine.platform import Platform
11
12
  from pants.engine.process import FallibleProcessResult, Process
12
13
  from pants.engine.rules import Get, MultiGet, collect_rules, rule
13
- from pants.engine.target import FieldSet
14
- from pants.engine.unions import UnionRule
14
+ from pants.engine.target import FieldSet, Target
15
15
  from pants.util.logging import LogLevel
16
16
 
17
17
  from pants_baseline.subsystems.baseline import BaselineSubsystem
@@ -28,17 +28,23 @@ class RuffLintFieldSet(FieldSet):
28
28
  sources: BaselineSourcesField
29
29
  skip_lint: SkipLintField
30
30
 
31
+ @classmethod
32
+ def opt_out(cls, tgt: Target) -> bool:
33
+ """Allow targets to opt out of linting."""
34
+ return tgt.get(SkipLintField).value
35
+
31
36
 
32
37
  class RuffLintRequest(LintTargetsRequest):
33
38
  """Request to run Ruff linting."""
34
39
 
35
40
  field_set_type = RuffLintFieldSet
36
- tool_name = "ruff"
41
+ tool_subsystem = RuffSubsystem
42
+ partitioner_type = PartitionerType.DEFAULT_SINGLE_PARTITION
37
43
 
38
44
 
39
45
  @rule(desc="Lint with Ruff", level=LogLevel.DEBUG)
40
46
  async def run_ruff_lint(
41
- request: RuffLintRequest,
47
+ request: RuffLintRequest.Batch,
42
48
  ruff_subsystem: RuffSubsystem,
43
49
  baseline_subsystem: BaselineSubsystem,
44
50
  platform: Platform,
@@ -53,8 +59,7 @@ async def run_ruff_lint(
53
59
  partition_description=None,
54
60
  )
55
61
 
56
- # Filter out skipped targets
57
- field_sets = [fs for fs in request.field_sets if not fs.skip_lint.value]
62
+ field_sets = request.elements
58
63
 
59
64
  if not field_sets:
60
65
  return LintResult(
@@ -121,7 +126,7 @@ async def run_ruff_lint(
121
126
  stdout=result.stdout.decode(),
122
127
  stderr=result.stderr.decode(),
123
128
  linter_name="ruff",
124
- partition_description=None,
129
+ partition_description=request.partition_metadata,
125
130
  )
126
131
 
127
132
 
@@ -129,5 +134,5 @@ def rules() -> Iterable:
129
134
  """Return all lint rules."""
130
135
  return [
131
136
  *collect_rules(),
132
- UnionRule(LintTargetsRequest, RuffLintRequest),
137
+ *RuffLintRequest.rules(),
133
138
  ]
@@ -10,7 +10,7 @@ from pants.engine.fs import Digest, MergeDigests
10
10
  from pants.engine.platform import Platform
11
11
  from pants.engine.process import FallibleProcessResult, Process
12
12
  from pants.engine.rules import Get, MultiGet, collect_rules, rule
13
- from pants.engine.target import FieldSet
13
+ from pants.engine.target import FieldSet, Target
14
14
  from pants.engine.unions import UnionRule
15
15
  from pants.util.logging import LogLevel
16
16
 
@@ -28,6 +28,11 @@ class TyFieldSet(FieldSet):
28
28
  sources: BaselineSourcesField
29
29
  skip_typecheck: SkipTypecheckField
30
30
 
31
+ @classmethod
32
+ def opt_out(cls, tgt: Target) -> bool:
33
+ """Allow targets to opt out of type checking."""
34
+ return tgt.get(SkipTypecheckField).value
35
+
31
36
 
32
37
  class TyCheckRequest(CheckRequest):
33
38
  """Request to run ty type checking."""
@@ -4,7 +4,7 @@ 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.option.option_types import BoolOption, StrListOption, StrOption
7
+ from pants.option.option_types import BoolOption, SkipOption, StrListOption, StrOption
8
8
 
9
9
 
10
10
  class RuffSubsystem(ExternalTool):
@@ -42,6 +42,9 @@ class RuffSubsystem(ExternalTool):
42
42
  """Return the path to the ruff executable within the downloaded archive."""
43
43
  return "ruff"
44
44
 
45
+ # Skip option required by Pants for tool subsystems
46
+ skip = SkipOption("lint", "fmt")
47
+
45
48
  # Linting configuration
46
49
  select = StrListOption(
47
50
  default=[