Skip to content

Commit 277ea6e

Browse files
Feature/54 modify usethis ci bitbucket to exhibit the merge behaviour (#152)
* Major refactoring to support roundtrip Bitbucket pipelines config editing * Add tests * Add tests * Add tests * Separate interface layer into new core layer Add tests * Various refactorings, mostly relating to printing * Refactor pre-commit hook adding so that it uses a placeholder instead of validate-pyproject * Address a few TODOs * Add test for fancy_pipelines_model_dump * WIP: Large-scale refactor to use data-model-codegen classes * Handle removing multiple pre-commit repos from the same tool. * Avoid hard-coding the placeholder pre-commit hook * Sync current thinking on local pre-commit config * Add test for fancy_model_dump removing an element * Add tests for round-tripping string format in ruamel.yaml Unfortunately this support isn't really there yet so tests are skipped. * Change ruff-check to ruff to align with Astral config Add require_serial for pyright and ruff pre-commit hooks * Add test for ruff rule selection message * Add more tests for pre-commit IO module * Remove commented-out code * Test bitbucket schema * Dissmissing minor TODOs Bumping pyright * Add schema test for pre-commit * Test pre-commit fancy dump * Add anchors to script items immediately * Avoid supressing print statement and duplication * Test message when writing bitbucket-pipelimes.yml * Add docstring * Add message for adding bitbucket placeholder * refactor to use schema class in extract_hoook_names * Consistent messages for after adding placeholder steps * Better handling of indentation guessing with YAML * Avoid crude prefix approach for step anchors - create class * Pytest raise on warning Avoid duplicated script item definitions. * Add test for get_defined_script_item_names * Assign variable for placeholder IDs/names * Cleanup TODOs * Ensure that we can add pipeline steps for tools added after `usethis ci bitbucket` * Support removing a bitbucket pipelines step * Handle expanded pipeline removal * Handle stage items in step removal * Add bitbucket integration test for pytest * Add failing test - check pipeline steps are added in the correct order. Lots of TODOs added, as well. * Add pipeweld brainstorm and first test. * Test singleton series start * Testing combining with an existing parallelism * Test starting with two elements * Add recursive partition logic to handle basic dependency case * Collapse singleton in union * Collapse singleton series in concat * Test example 7 * Add example 8 test * Add failing test for instructions with mixed dependency parallelism * Fix bad test * Record instructions for parallel merge * Test instructions for mixed dependency parallelism of series * Add instructions test for multi level heirarchy * Add failing test * Handle basic dependency group functionality * Vary tested behaviour to match design * Change wording * Handle pipeline order * Add failing test * Support removing the placeholder bitbucket pipeline element, tidy up messages * Add a couple ideas * Fix broken test * Add failing test * Support pre-existing anchors for scirpt item definitions * Tweak and test message logic for adding bitbucket pipelines files * Fix bug in cache adding message logic * Better error handling in `ci` subcommand Better error handling for YAML parsing errors Tests that placeholders are removed for pre-commit * Add failing test * Remove unused caches * Remove empty cache definitions section if removing a cache Test cache removal message * Add test for case where empty cache section doesn't need to be removed * Better tests for the remove_cache function * Add a test for invalid YAML indentation * Add test for message when removing pre-commit placeholder * Naming consistency * Add failing test and refactor major version support detection logic * More robust way to determine supported major Python versions using uv * Fix broken imports, don't refer to first pipeline in message, but pipeline in general for adding bitbucket pipelines * Consistent hook config Test messages for adding hooks * Move test into the right place * Add test and dismiss many TODOs * Add test and dismiss TODOs * Handle bitbucket cleanup when removing pytest Fix bug with not adding caches for placeholder * Add test for error message * Refinements to messaging for removing files * Test messaging for adding bitbucket pytest steps * Add tests for pipeweld containers * Add unit tests for _op_series_merge_partitions * Forbid None in bitbucket schema Add some tests for apply_pipeweld_instruction Bump pyright * Simplify bitbucket schema to align with validator website https://bitbucket.org/product/pipelines/validator * Fix bug in Stage handling for bitbucket-pipeweld integration * Fix bug in getting instructions for assertion in parallel * Bump schema * Add tests for get_pipeweld_pipeline_from_default * Add tests for get_pipeweld_step * Use single dispatch to reduce complexity of pipeweld functions * Refactor pipeweld add function to use class for shared problem config to reduce complexity * Simplify _parallel_merge_partitions * Simplify add_repo and _add_step_in_default_via_doc * Add more tests for use_pyproject_fmt * Add more tests for use_deptry * Add more tests for use_ruff * Remove references to deleted ruff rules * Add failing test for parsing 3.14.0a3 * Support alpha versions of Python in uv * Explicitly test err is empty in capfd tests * Don't use importlib.resources for loading schema.json files * Make available Python versions test more robust for MacOS
1 parent 52280db commit 277ea6e

Some content is hidden

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

94 files changed

+11981
-1705
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
git config --global user.email placeholder@example.com
2020
2121
- name: Set up uv
22-
uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0
22+
uses: astral-sh/setup-uv@e779db74266a80753577425b0f4ee823649f251d # v3.2.3
2323
with:
2424
version: "latest"
2525

.pre-commit-config.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
repos:
22
- repo: https://github.com/abravalheri/validate-pyproject
3-
rev: "v0.23"
3+
rev: v0.23
44
hooks:
55
- id: validate-pyproject
66
additional_dependencies: ["validate-pyproject-schema-store[all]"]
77
- repo: https://github.com/tox-dev/pyproject-fmt
8-
rev: "v2.5.0"
8+
rev: v2.5.0
99
hooks:
1010
- id: pyproject-fmt
1111
- repo: local
1212
hooks:
1313
- id: ruff-format
1414
name: ruff-format
15-
entry: uv run --frozen ruff format
15+
entry: uv run --frozen ruff format --force-exclude
16+
types_or: [python, pyi, jupyter]
1617
language: system
1718
always_run: true
18-
pass_filenames: false
19+
require_serial: true
1920
- repo: local
2021
hooks:
21-
- id: ruff-check
22-
name: ruff-check
23-
entry: uv run --frozen ruff check --fix
22+
- id: ruff
23+
name: ruff
24+
entry: uv run --frozen ruff check --fix --force-exclude
25+
types_or: [python, pyi, jupyter]
2426
language: system
2527
always_run: true
26-
pass_filenames: false
28+
require_serial: true
2729
- repo: local
2830
hooks:
2931
- id: deptry
@@ -46,5 +48,6 @@ repos:
4648
name: pyright
4749
entry: uv run --frozen pyright
4850
language: system
51+
types_or: [python, pyi]
4952
always_run: true
50-
pass_filenames: false
53+
require_serial: true

0 commit comments

Comments
 (0)