Skip to content

Commit

Permalink
remove deprecated setting [shell-setup].tailor (#21654)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson authored Nov 18, 2024
1 parent 1258080 commit 61b79fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 22 deletions.
4 changes: 4 additions & 0 deletions docs/notes/2.25.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Previously we did ad-hoc coercion of some field values, so that, e.g., you could
Strict adherence to the [schema of Helm OCI registry configuration](https://www.pantsbuild.org/2.25/reference/subsystems/helm#registries) is now required.
Previously we did ad-hoc coercion of some field values, so that, e.g., you could provide a "true"/"false" string as a boolean value. Now we require actual booleans.

#### Shell

The previously deprecated `[shell-setup].tailor` option has now been removed. See [`[shell-setup].tailor_sources`](https://www.pantsbuild.org/2.25/reference/subsystems/shell-setup#tailor_sources) and [`[shell-setup].tailor_shunit2_tests`](https://www.pantsbuild.org/2.25/reference/subsystems/shell#tailor_shunit2_tests) to update.

### Plugin API changes

The version of Python used by Pants itself is now [3.11](https://docs.python.org/3/whatsnew/3.11.html) (up from 3.9).
Expand Down
3 changes: 0 additions & 3 deletions src/python/pants/backend/shell/goals/tailor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ def classify_source_files(paths: Iterable[str]) -> dict[type[Target], set[str]]:
async def find_putative_targets(
req: PutativeShellTargetsRequest, all_owned_sources: AllOwnedSources, shell_setup: ShellSetup
) -> PutativeTargets:
if not shell_setup.tailor:
return PutativeTargets()

if not (shell_setup.tailor_sources or shell_setup.tailor_shunit2_tests):
return PutativeTargets()

Expand Down
10 changes: 3 additions & 7 deletions src/python/pants/backend/shell/goals/tailor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ def rule_runner() -> RuleRunner:


@pytest.mark.parametrize(
"opt_tailor,opt_tailor_sources,opt_tailor_tests,expects_sources,expects_tests",
"opt_tailor_sources,opt_tailor_tests,expects_sources,expects_tests",
[
pytest.param(True, True, True, True, True, id="legacy tailor enabled"),
pytest.param(False, True, True, False, False, id="legacy tailor disabled"),
pytest.param(True, False, True, False, True, id="sources disabled"),
pytest.param(True, True, False, True, False, id="tests disabled"),
pytest.param(False, True, False, True, id="sources disabled"),
pytest.param(True, False, True, False, id="tests disabled"),
],
)
def test_find_putative_targets(
opt_tailor,
opt_tailor_sources,
opt_tailor_tests,
expects_sources,
Expand All @@ -66,7 +63,6 @@ def test_find_putative_targets(
)
rule_runner.set_options(
[
f"--shell-setup-tailor={opt_tailor}",
f"--shell-setup-tailor-sources={opt_tailor_sources}",
f"--shell-setup-tailor-shunit2-tests={opt_tailor_tests}",
]
Expand Down
12 changes: 0 additions & 12 deletions src/python/pants/backend/shell/subsystems/shell_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ class ShellSetup(Subsystem):
help="Infer Shell dependencies on other Shell files by analyzing `source` statements.",
advanced=True,
)
tailor = BoolOption(
default=True,
help=softwrap("If true, add `shell_sources` targets with the `tailor` goal."),
removal_version="2.25.0.dev0",
removal_hint=softwrap(
"""
Use `tailor_sources` and/or `tailor_shunit2_tests` instead.
For backwards compatibility, if this option is `False`, it will override the other options.
"""
),
advanced=True,
)
tailor_sources = BoolOption(
default=True,
help=softwrap("If true, add `shell_sources` targets with the `tailor` goal."),
Expand Down

0 comments on commit 61b79fc

Please sign in to comment.