Skip to content
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

add typehints for directory_layout / Spec.prefix #48652

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

haampie
Copy link
Member

@haampie haampie commented Jan 20, 2025

Spec.prefix returns spack.util.prefix.Prefix or raises, but static analysis says it can be None which is rather annoying.

mypy struggles with getters/setters, so replace the setter with an ordinary function Spec.set_prefix(...), which is also easier to find as a symbol.


In the near (?) future we can consider dropping automatic Spec.prefix since it couples Spec to a specific store. But it's unlikely to be removed, just it would throw if Spec.set_prefix(...) wasn't called.

@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Jan 20, 2025
alalazo
alalazo previously approved these changes Feb 24, 2025
Copy link
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, but needs a rebase

@alalazo alalazo enabled auto-merge (squash) February 24, 2025 09:08
@alalazo alalazo merged commit 974abc8 into develop Feb 24, 2025
35 checks passed
@alalazo alalazo deleted the hs/fix/spec-prefix-type branch February 24, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core PR affects Spack core functionality tests General test capability(ies)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants