Skip to content

Commit c00d2f0

Browse files
Deprecate usethis ci in v0.19.0 ahead of removal in v0.20.0 (#1416)
* Initial plan * Deprecate `usethis ci` command ahead of removal in v0.20.0 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> * Move deprecated=True to Typer() constructor instead of @app.command() Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
1 parent a2fa80d commit c00d2f0

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/usethis/_ui/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
)(
7070
usethis._ui.interface.test.test,
7171
)
72-
app.add_typer(usethis._ui.interface.ci.app, name="ci", rich_help_panel=rich_help_panel)
72+
app.add_typer(
73+
usethis._ui.interface.ci.app,
74+
name="ci",
75+
rich_help_panel=rich_help_panel,
76+
deprecated=True,
77+
)
7378
app.add_typer(
7479
usethis._ui.interface.tool.app, name="tool", rich_help_panel=rich_help_panel
7580
)

src/usethis/_ui/interface/ci.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
from usethis._ui.options import backend_opt, frozen_opt, offline_opt, quiet_opt
66

77
app = typer.Typer(
8-
help="Add config for Continuous Integration (CI) pipelines.", add_completion=False
8+
help="Add config for Continuous Integration (CI) pipelines.",
9+
add_completion=False,
10+
deprecated=True,
911
)
1012

1113

@@ -25,12 +27,14 @@ def bitbucket(
2527
backend: BackendEnum = backend_opt,
2628
) -> None:
2729
from usethis._config_file import files_manager
28-
from usethis._console import err_print
30+
from usethis._console import err_print, warn_print
2931
from usethis._core.ci import use_ci_bitbucket
3032
from usethis.errors import UsethisError
3133

3234
assert isinstance(backend, BackendEnum)
3335

36+
warn_print("'usethis ci' is deprecated and will be removed in v0.20.0.")
37+
3438
with (
3539
usethis_config.set(
3640
offline=offline,

tests/usethis/_ui/interface/test_ci.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_readme_example(self, tmp_path: Path):
3737
assert (
3838
result.output
3939
== """\
40+
⚠ 'usethis ci' is deprecated and will be removed in v0.20.0.
4041
✔ Writing 'bitbucket-pipelines.yml'.
4142
✔ Adding cache 'uv' definition to 'bitbucket-pipelines.yml'.
4243
✔ Adding 'Run Ruff' to default pipeline in 'bitbucket-pipelines.yml'.
@@ -57,6 +58,7 @@ def test_none_backend(self, tmp_path: Path):
5758
assert result.exit_code == 0, result.output
5859
assert (tmp_path / "bitbucket-pipelines.yml").exists()
5960
assert result.output == (
61+
"⚠ 'usethis ci' is deprecated and will be removed in v0.20.0.\n"
6062
"✔ Writing 'bitbucket-pipelines.yml'.\n"
6163
"✔ Adding placeholder step to default pipeline in 'bitbucket-pipelines.yml'.\n"
6264
"☐ Remove the placeholder pipeline step in 'bitbucket-pipelines.yml'.\n"

0 commit comments

Comments
 (0)