Skip to content

Commit 40cd6ef

Browse files
CopilotnathanjmcdougallCopilot
authored
Remove all Bitbucket Pipelines logic from the codebase (#1515)
* Initial plan * Remove all Bitbucket Pipelines logic from source code - Delete src/usethis/_integrations/ci/bitbucket/ directory (12 files) - Delete src/usethis/_pipeweld/ directory (5 files) - Delete src/usethis/_core/ci.py - Delete src/usethis/_types/ci.py (CIServiceEnum) - Delete src/usethis/_detect/ci/ directory - Delete docs/pipeweld.md - Delete all bitbucket-related test directories and files - Remove bitbucket methods from Tool base class - Remove bitbucket overrides from pre_commit, ruff, pytest tools - Remove bitbucket step calls from all use_* tool functions - Remove bitbucket status from usage list - Remove BitbucketPipelinesYAMLManager from config_file.py - Remove --ci parameter from init command - Remove init_ci_opt from options.py Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/2b46fad4-b933-4c23-a33c-8f7cd4dbbb21 * Remove Bitbucket-related tests after Bitbucket Pipelines integration removal Removed all Bitbucket-related test code from: - tests/usethis/_core/test_core_tool.py: Removed import, TestAllBitbucketCompatibleSteps class, all test_bitbucket_integration methods, and all TestBitbucketIntegration inner classes - tests/usethis/_tool/impl/base/test_pytest.py: Removed bitbucket import and TestUpdateBitbucketSteps/TestRemoveBitbucketSteps inner classes - tests/usethis/_ui/interface/test_init.py: Removed test_bitbucket_docstyle_and_status method - tests/usethis/_core/test_list.py: Removed Bitbucket Pipelines UsageRow entries - tests/usethis/_integrations/pre_commit/test_hooks.py: Removed bitbucket sync comment - tests/conftest.py: Updated comment to remove Bitbucket reference Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove bitbucket references from tests, docs, and config - Remove bitbucket test methods/classes from test_core_tool.py - Remove bitbucket test classes from test_pytest.py - Remove bitbucket test from test_init.py - Remove Bitbucket Pipelines rows from test_list.py - Remove bitbucket comment from test_hooks.py - Update conftest.py comment - Remove bitbucket from docs/cli/reference.md - Remove bitbucket basedpyright config from pyproject.toml - Remove pipeweld from mkdocs.yml navigation - Update .importlinter to remove pipeweld, ci, and bitbucket references Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/2b46fad4-b933-4c23-a33c-8f7cd4dbbb21 * Restore _pipeweld module, tests, and docs The pipeweld utility is kept for future use with pre-commit/prek and as a potential standalone package. Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/f8fe25b7-3495-4399-91be-a5274472ea4b --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b51510a commit 40cd6ef

45 files changed

Lines changed: 10 additions & 7642 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.importlinter

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ containers =
5151
usethis._core
5252
layers =
5353
badge | docstyle | list | rule
54-
author | browse | ci | readme | show | status | tool
54+
author | browse | readme | show | status | tool
5555
exhaustive = true
5656

5757
[importlinter:contract:tool]
@@ -155,5 +155,5 @@ type = layers
155155
containers =
156156
usethis._integrations.ci
157157
layers =
158-
bitbucket | github
158+
github
159159
exhaustive = true

docs/cli/reference.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ Supported options:
2222
- `--test` to add a recommended testing framework (default; or `--no-test` to opt-out)
2323
- `--typecheck` to add a recommended type checker (default; or `--no-typecheck` to opt-out)
2424
- `--hook` to add a recommended git hook framework (but the default is `--no-hook`)
25-
- `--ci` to add a CI service configuration
26-
27-
Possible values:
28-
- `bitbucket` for [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines)
29-
3025
- `--docstyle` to set a docstring style convention for the project.
3126

3227
Possible values:

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ reportUnreachable = false
229229
reportUnusedFunction = false
230230
reportUnusedParameter = false
231231

232-
[[tool.basedpyright.executionEnvironments]]
233-
# Particularly interested in avoiding the auto-generated schema script
234-
root = "src/usethis/_integrations/ci/bitbucket"
235-
reportUnannotatedClassAttribute = false
236-
237232
[[tool.basedpyright.executionEnvironments]]
238233
# Particularly interested in avoiding the auto-generated schema script
239234
root = "src/usethis/_integrations/pre_commit"

src/usethis/_config_file.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from usethis._file.setup_cfg.io_ import SetupCFGManager
1313
from usethis._file.toml.io_ import TOMLFileManager
1414
from usethis._file.yaml.io_ import YAMLFileManager
15-
from usethis._integrations.ci.bitbucket.yaml import BitbucketPipelinesYAMLManager
1615
from usethis._integrations.pre_commit.yaml import PreCommitConfigYAMLManager
1716

1817
if TYPE_CHECKING:
@@ -24,7 +23,6 @@ def files_manager() -> Iterator[None]:
2423
with (
2524
PyprojectTOMLManager(),
2625
SetupCFGManager(),
27-
BitbucketPipelinesYAMLManager(),
2826
DotCodespellRCManager(),
2927
DotCoverageRCManager(),
3028
DotCoverageRCTOMLManager(),

src/usethis/_core/ci.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/usethis/_core/list.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
from typing_extensions import assert_never
66

77
from usethis._console import table_print
8-
from usethis._detect.ci.bitbucket import is_bitbucket_used
98
from usethis._detect.readme import is_readme_used
109
from usethis._tool.all_ import ALL_TOOLS
1110
from usethis._tool.impl.base.ruff import RuffTool
1211

1312

1413
class UsageRow(BaseModel):
15-
category: Literal["tool", "ci", "config", ""]
14+
category: Literal["tool", "config", ""]
1615
name: str
1716
status: Literal["used", "unused"] | Literal["numpy", "google", "pep257"]
1817

@@ -67,13 +66,11 @@ def _rich_status(
6766

6867

6968
def _rich_category(
70-
category: Literal["tool", "ci", "config", ""],
69+
category: Literal["tool", "config", ""],
7170
) -> str:
7271
"""Get richly formatted category."""
7372
if category == "tool":
7473
return "[bold]Tool[/bold]"
75-
elif category == "ci":
76-
return "[bold]CI[/bold]"
7774
elif category == "config":
7875
return "[bold]Config[/bold]"
7976
elif category == "":
@@ -100,15 +97,6 @@ def get_usage_table() -> UsageTable:
10097
UsageRow(category="tool", name=tool.name, status="unused")
10198
)
10299

103-
# CI
104-
if is_bitbucket_used():
105-
bitbucket_status = "used"
106-
else:
107-
bitbucket_status = "unused"
108-
table.rows.append(
109-
UsageRow(category="ci", name="Bitbucket Pipelines", status=bitbucket_status)
110-
)
111-
112100
# Config
113101
docstyle_status = RuffTool().get_docstyle()
114102
if docstyle_status is None:

src/usethis/_core/tool.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from usethis._backend.uv.lockfile import ensure_uv_lock
1212
from usethis._config import usethis_config
1313
from usethis._console import info_print, instruct_print, tick_print
14-
from usethis._detect.ci.bitbucket import is_bitbucket_used
1514
from usethis._file.pyproject_toml.valid import ensure_pyproject_validity
1615
from usethis._init import ensure_dep_declaration_file, write_simple_requirements_txt
1716
from usethis._integrations.mkdocs.core import add_docs_dir
@@ -41,7 +40,6 @@
4140

4241
if TYPE_CHECKING:
4342
from usethis._tool.all_ import SupportedToolType
44-
from usethis._tool.base import Tool
4543

4644
# Note - all these functions invoke ensure_dep_declaratiom_file() at the start, since
4745
# declaring dependencies in pyproject.toml requires that file to exist.
@@ -68,13 +66,11 @@ def use_codespell(*, remove: bool = False, how: bool = False) -> None:
6866
ensure_dep_declaration_file()
6967

7068
tool.add_dev_deps()
71-
tool.update_bitbucket_steps()
7269
tool.add_pre_commit_config()
7370

7471
tool.add_configs()
7572
tool.print_how_to_use()
7673
else:
77-
tool.remove_bitbucket_steps()
7874
tool.remove_configs()
7975
tool.remove_pre_commit_repo_configs()
8076
tool.remove_dev_deps()
@@ -111,15 +107,13 @@ def use_deptry(*, remove: bool = False, how: bool = False) -> None:
111107
ensure_dep_declaration_file()
112108

113109
tool.add_dev_deps()
114-
tool.update_bitbucket_steps()
115110
tool.add_pre_commit_config()
116111

117112
tool.add_configs()
118113
tool.print_how_to_use()
119114
else:
120115
tool.remove_pre_commit_repo_configs()
121116
tool.remove_configs()
122-
tool.remove_bitbucket_steps()
123117
tool.remove_dev_deps()
124118
tool.remove_managed_files()
125119

@@ -138,13 +132,11 @@ def use_import_linter(*, remove: bool = False, how: bool = False) -> None:
138132
tool.add_configs()
139133
if RuffTool().is_used():
140134
RuffTool().apply_rule_config(tool.rule_config)
141-
tool.update_bitbucket_steps()
142135
tool.add_pre_commit_config()
143136

144137
tool.print_how_to_use()
145138
else:
146139
tool.remove_pre_commit_repo_configs()
147-
tool.remove_bitbucket_steps()
148140
if RuffTool().is_used():
149141
RuffTool().remove_rule_config(tool.rule_config)
150142
tool.remove_configs()
@@ -202,16 +194,8 @@ def use_pre_commit(*, remove: bool = False, how: bool = False) -> None:
202194
"Run 'uv run pre-commit install' to install pre-commit to Git."
203195
)
204196

205-
tool.update_bitbucket_steps()
206-
if is_bitbucket_used():
207-
_remove_bitbucket_linter_steps_from_default()
208-
209197
tool.print_how_to_use()
210198
else:
211-
tool.remove_bitbucket_steps()
212-
if is_bitbucket_used():
213-
_add_bitbucket_linter_steps_to_default()
214-
215199
try:
216200
uninstall_pre_commit_hooks()
217201
except PreCommitInstallationError:
@@ -237,24 +221,6 @@ def _add_all_tools_pre_commit_configs():
237221
_tool.add_pre_commit_config()
238222

239223

240-
def _add_bitbucket_linter_steps_to_default() -> None:
241-
# This order of adding tools should be synced with the order hard-coded
242-
# in the function which adds steps.
243-
if is_bitbucket_used():
244-
tools: list[Tool] = [PyprojectFmtTool(), DeptryTool(), RuffTool()]
245-
for tool in tools:
246-
if tool.is_used():
247-
tool.unconditional_update_bitbucket_steps()
248-
249-
250-
def _remove_bitbucket_linter_steps_from_default() -> None:
251-
# This order of removing tools should be synced with the order hard-coded
252-
# in the function which adds steps.
253-
PyprojectFmtTool().remove_bitbucket_steps()
254-
DeptryTool().remove_bitbucket_steps()
255-
RuffTool().remove_bitbucket_steps()
256-
257-
258224
def use_pyproject_fmt(*, remove: bool = False, how: bool = False) -> None:
259225
tool = PyprojectFmtTool()
260226

@@ -266,13 +232,11 @@ def use_pyproject_fmt(*, remove: bool = False, how: bool = False) -> None:
266232
ensure_dep_declaration_file()
267233

268234
tool.add_dev_deps()
269-
tool.update_bitbucket_steps()
270235
tool.add_pre_commit_config()
271236

272237
tool.add_configs()
273238
tool.print_how_to_use()
274239
else:
275-
tool.remove_bitbucket_steps()
276240
tool.remove_configs()
277241
tool.remove_pre_commit_repo_configs()
278242
tool.remove_dev_deps()
@@ -324,15 +288,11 @@ def use_pytest(*, remove: bool = False, how: bool = False) -> None:
324288
if RuffTool().is_used():
325289
RuffTool().apply_rule_config(rule_config)
326290

327-
PytestTool().update_bitbucket_steps()
328-
329291
tool.print_how_to_use()
330292

331293
if CoveragePyTool().is_used():
332294
CoveragePyTool().print_how_to_use()
333295
else:
334-
PytestTool().remove_bitbucket_steps()
335-
336296
if RuffTool().is_used():
337297
RuffTool().remove_rule_config(tool.rule_config)
338298
tool.remove_configs()
@@ -466,7 +426,6 @@ def use_ruff(
466426

467427
if linter:
468428
tool.apply_rule_config(rule_config)
469-
tool.update_bitbucket_steps()
470429
tool.add_pre_commit_config()
471430

472431
tool.print_how_to_use()
@@ -477,7 +436,6 @@ def use_ruff(
477436
)
478437

479438
tool.remove_pre_commit_repo_configs()
480-
tool.remove_bitbucket_steps()
481439
tool.remove_configs()
482440
tool.remove_dev_deps()
483441
tool.remove_managed_files()
@@ -528,13 +486,11 @@ def use_ty(*, remove: bool = False, how: bool = False) -> None:
528486
ensure_dep_declaration_file()
529487

530488
tool.add_dev_deps()
531-
tool.update_bitbucket_steps()
532489
tool.add_pre_commit_config()
533490

534491
tool.add_configs()
535492
tool.print_how_to_use()
536493
else:
537-
tool.remove_bitbucket_steps()
538494
tool.remove_configs()
539495
tool.remove_pre_commit_repo_configs()
540496
tool.remove_dev_deps()

src/usethis/_detect/ci/__init__.py

Whitespace-only changes.

src/usethis/_detect/ci/bitbucket.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/usethis/_integrations/ci/bitbucket/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)