-
Notifications
You must be signed in to change notification settings - Fork 3
909 make bitbucket ci config backend agnostic #953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nathanjmcdougall
merged 25 commits into
main
from
909-make-bitbucket-ci-config-backend-agnostic
Oct 13, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fc02f86
Rename test class for consistency
nathanjmcdougall cf2f5e3
Add comment regarding use of default docker image in Bitbucket pipelines
nathanjmcdougall f5fb08b
Add a backend-agnostic `get_supported_major_python_versions` in a new…
nathanjmcdougall 03ffe6b
Continue implementing the `backend=none` behaviour for bitbucket pipe…
nathanjmcdougall 371d77a
Fix typo
nathanjmcdougall c4bdf52
Don't include patch version of Python in Bitbucket pipelines image wh…
nathanjmcdougall b676a1d
Fix capitalization of `uv` in the test suite
nathanjmcdougall 06e2f92
Add clarifying comment to test docstring
nathanjmcdougall 2987d85
Fix tests regarding auto-backend-only messages
nathanjmcdougall 6645710
Fix no backend test for bitbucket pipelines integration
nathanjmcdougall eb06c0e
Fix interface test messages for bitbucket pipelines integration
nathanjmcdougall 1c164ea
Merge branch 'main' into 909-make-bitbucket-ci-config-backend-agnostic
nathanjmcdougall d8dea9b
Merge branch 'main' into 909-make-bitbucket-ci-config-backend-agnostic
nathanjmcdougall e84a2f4
Monkey-patch the maxmimal bitbucket pieplines config to use Python 3.10
nathanjmcdougall fbbdecf
Monkey-patch the maxmimal bitbucket pieplines config to use Python 3.10
nathanjmcdougall 20a964e
Explicitly check whether pytest.ini exists in failing test
nathanjmcdougall 9fa5b13
Refactor tests to reflect new `pytest.ini` precedence
nathanjmcdougall 93e1a82
Merge branch 'main' into 909-make-bitbucket-ci-config-backend-agnostic
nathanjmcdougall ab7f334
Introduce wrapper to ensure `CliRunner.invoke` is called with `catch_…
nathanjmcdougall 4aeae16
Add test for no-backend via auto messages for bitbucket pipeline step…
nathanjmcdougall 71290c8
Ensure Import Linter is added via `use_ci_bitbucket`
nathanjmcdougall c67d879
Fix none-backend maximual bitbucket pipelines test expectations
nathanjmcdougall ccc827f
Merge branch 'main' into 909-make-bitbucket-ci-config-backend-agnostic
nathanjmcdougall b9bed93
Fix deptry config in tests\usethis\_ui\interface\maximal_bitbucket_pi…
nathanjmcdougall 9d0dfad
Merge branch '909-make-bitbucket-ci-config-backend-agnostic' of https…
nathanjmcdougall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,21 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Literal, TypeAlias | ||
| from typing import Any, Literal, TypeAlias | ||
|
|
||
| from pydantic import BaseModel | ||
| from ruamel.yaml.scalarstring import LiteralScalarString | ||
|
|
||
| # N.B. at the point where we support more than one script item, we should create a | ||
| # canonical sort order for them and enforce it when we add them to the pipeline. | ||
| ScriptItemName: TypeAlias = Literal["install-uv"] | ||
| ScriptItemName: TypeAlias = Literal["install-uv", "ensure-venv"] | ||
|
|
||
|
|
||
| class ScriptItemAnchor(BaseModel): | ||
| name: ScriptItemName | ||
|
|
||
|
|
||
| def anchor_name_from_script_item(item: Any) -> str | None: | ||
| """Extract the anchor name from a script item, if it has one.""" | ||
| if isinstance(item, LiteralScalarString): | ||
| anchor = item.yaml_anchor() | ||
| if anchor is not None: | ||
| return anchor.value | ||
| return None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing_extensions import assert_never | ||
|
|
||
| from usethis._integrations.backend.dispatch import get_backend | ||
| from usethis._integrations.backend.uv.python import ( | ||
| get_supported_uv_major_python_versions, | ||
| ) | ||
| from usethis._integrations.python.version import get_python_major_version | ||
| from usethis._types.backend import BackendEnum | ||
|
|
||
|
|
||
| def get_supported_major_python_versions() -> list[int]: | ||
| backend = get_backend() | ||
|
|
||
| if backend is BackendEnum.uv: | ||
| versions = get_supported_uv_major_python_versions() | ||
| elif backend is BackendEnum.none: | ||
| versions = [get_python_major_version()] | ||
| else: | ||
| assert_never(backend) | ||
|
|
||
| return versions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.