← Back to issue list

fix(parts): set field defaults using default_factory (#629)

View original Github issue

Metadata

Project
craft-parts
Number
#640
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged as 6b05a101, cherry-picking #629 onto feature/namespaced-partitions to use default_factory for mutable PartSpec defaults, with Black 2024 formatting and a pytest 8 integration-test fix.

Resolution: closed resolved

Reason: PR #640 was merged as commit 6b05a101, applying the resolved changes from #629 to the feature/namespaced-partitions branch.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- Cherry-pick #629 into the `feature/namespaced-partitions` branch. Despite the commit header, it has the new `black` 2024 changes and a fix for a failing integration test exposed after pytest 8 was released.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged as 6b05a101, cherry-picking #629 onto feature/namespaced-partitions to use default_factory for mutable PartSpec defaults, with Black 2024 formatting and a pytest 8 integration-test fix.
stealth/space-bunny-alpha — closed resolved Backport PR #640 merged as commit 6b05a101, cherry-picking #629 into feature/namespaced-partitions: PartSpec mutable defaults moved to Pydantic default_factory, plus Black 2024 formatting and a pytest 8 integration-test fix.
stealth/space-bunny-alpha — closed resolved Merged in #640 as 6b05a101, cherry-picking #629: PartSpec defaults now use default_factory, with Black 2024 formatting and a pytest 8 integration-test fix.
qwen/qwen3.6-35b-a3b — — Merged into feature/namespaced-partitions branch. Fixes a pytest 8-induced integration test failure by replacing field defaults with default_factory. Includes black 2024 formatting updates. Approved and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged PR #629 into the feature/namespaced-partitions branch. The update sets field defaults using default_factory, applies black 2024 formatting, and resolves a pytest 8-induced integration test failure.

Update history

No update history recorded yet.

Related work

Related issues

Issue Project State Summary Similarity
#629 fix(parts): set field defaults using default_factory craft-parts merged Merged #629 as 5529031d, replacing mutable PartSpec defaults with Pydantic default_factory to fix PyRight errors for PartSpec(plugin="foo"); backported via #640 and #641.
82%
#641 fix(parts): set field defaults using default_factory (#629) craft-parts merged Merged backport #641 as commit ef9bbef6, applying #629 to give mutable PartSpec fields safe Pydantic default_factory defaults and fix PyRight errors.
82%