Explicitly add proj_root to FlowCfg#150
Open
rswarbrick wants to merge 1 commit intolowRISC:masterfrom
Open
Conversation
This gets loaded up from the hjson file (and nothing will work if it's missing). Eventually, we need to do that more carefully, but this change is helpful because it tells pyright about the existence and type of FlowCfg.proj_root. This will always have type str (because it gets loaded directly from an hjson file). Add an explicit cast to Path when calling the WorkspaceConfig constructor. Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
AlexJones0
previously approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
This looks reasonable to me, but it's kind of a change to please the type checker instead of a change to fix the issue the type checker is telling us about. The useful aspect of the previous behaviour that is now gone is that a missing proj_root would not give cryptic errors. Perhaps whilst everything is still not cleanly defined we should add an if not self.proj_root: raise ValueError(...) statement right after calling self._expand in FlowCfg.__init__ just to avoid this potential head-scratcher?
Note also that in #139 (merged earlier today), I made an explicit reference to self.proj_root on the base flow anyway, right at the point I am mentioning.
Hit the wrong button, meant to be a comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This gets loaded up from the hjson file (and nothing will work if it's missing). Eventually, we need to do that more carefully, but this change is helpful because it tells pyright about the existence and type of FlowCfg.proj_root.
This will always have type str (because it gets loaded directly from an hjson file). Add an explicit cast to Path when calling the WorkspaceConfig constructor.