Skip to content

Commit b95b853

Browse files
Allow extra fields in YAML schema modules, add stricter validation (#1050)
* Bump `datamodel-code-generator` from 0.28.2 to 0.35.0 * Allow extra fields in YAML schema modules * Add test module * Forbid `StepBase.script` from being None in bitbucket pipelines (i.e. revert to previous behaviour) and add missing doc comment * Avoid using `default_factory` in schema modules to preserve round-tripping * Use explicit default kwarg for `pydantic.Field` declarations * Replace defaults with None in schemas for roundtripping Restore addition of "shared" to the Literal annotation in `StepBase.type` to match default * Use `by_alias=True` when using `.model_dump*` pydantic methods * Fix typo in comment * Restore `max-time` alias Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Run ruff formatter --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6fce804 commit b95b853

8 files changed

Lines changed: 209 additions & 41 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ scripts.usethis = "usethis.__main__:app"
5454

5555
[dependency-groups]
5656
dev = [
57-
"datamodel-code-generator[http]>=0.28.2",
57+
"datamodel-code-generator[http]>=0.35.0",
5858
"deptry>=0.23.0",
5959
"import-linter>=2.3",
6060
"jinja2>=3.1.6",

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ coverage==7.7.1 \
234234
--hash=sha256:eff187177d8016ff6addf789dcc421c3db0d014e4946c1cc3fbf697f7852459d \
235235
--hash=sha256:fbba59022e7c20124d2f520842b75904c7b9f16c854233fa46575c69949fb5b9
236236
# via pytest-cov
237-
datamodel-code-generator==0.28.2 \
238-
--hash=sha256:5f16fe4d6acee79c1366f9ee68016eeec544fc0a2fec25ce47d35f7b7767e0fe \
239-
--hash=sha256:a2c425386c3f836c618ae276be57e460df323ac78f911b1b12d927ddffd70e73
237+
datamodel-code-generator==0.35.0 \
238+
--hash=sha256:46805fa2515d3871f6bfafce9aa63128e735a7a6a4cfcbf9c27b3794ee4ea846 \
239+
--hash=sha256:c356d1e4a555f86667a4262db03d4598a30caeda8f51786555fd269c8abb806b
240240
deptry==0.23.0 \
241241
--hash=sha256:04afae204654542406318fd3dd6f4a6697579597f37195437daf84a53ee0ebbf \
242242
--hash=sha256:1cfa4b3a46ee8a026eaa38e4b9ba43fe6036a07fe16bf0a663cb611b939f6af8 \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
def get_pipeweld_step(step: Step) -> str:
4141
if step.name is not None:
4242
return step.name
43-
return step.model_dump_json(exclude_defaults=True)
43+
return step.model_dump_json(exclude_defaults=True, by_alias=True)
4444

4545

4646
def get_pipeweld_pipeline_from_default(

0 commit comments

Comments
 (0)