Skip to content

fix: require-runtime-dependencies not installed in build environment#2206

Open
psyclaudeZ wants to merge 1 commit intopypa:masterfrom
psyclaudeZ:psyclaudeZ/runtime-deps-caching
Open

fix: require-runtime-dependencies not installed in build environment#2206
psyclaudeZ wants to merge 1 commit intopypa:masterfrom
psyclaudeZ:psyclaudeZ/runtime-deps-caching

Conversation

@psyclaudeZ
Copy link
Copy Markdown

Summary

Addressing #2110.

Mentioned in the issue, #2073 changed prepare_build_environment such that:

  1. prepare_environment syncs the build env, caching dependencies_complex, all_dependencies_complex, and missing_dependencies via @cached_property.
  2. Queries hatchling for additional runtime deps and appends them to additional_dependencies
  3. Calls sync_dependencies again but the cached properties from step 1 still have empty additional_dependencies so runtime deps are never installed.

This PR replaces @cached_property with @property for those fields. Alternatively, we could manually evict the fields after mutating additional_dependencies. However, I personally feel the latter is too ad-hoc and bypasses a more serious issue (caching properties that depend on mutable state).

Test Plan

Disclaimer: I used Claude Code for these. TDD:

  • Added a new integration test.
  • Repro steps in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant