-
Notifications
You must be signed in to change notification settings - Fork 430
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
Fixing source/path and GIT_* issues #801
Conversation
By adding default values to the metadata during parsing, a very subtle bug in m.get_value() that rendered the method near useless. The default would never be returned if the field was validated during parsing (basically any field that required a certain type). For example, if m was a Metadata object, m.get_value('source/git_rev', 'master') would never return master, even if 'source/git_rev' was never defined in meta.yaml. Now, m.get_value will return the default type of a field, if defined, whenever default=None. Also, when accessing the metadata, never assume any field exists beyond package/name and package/version.
BTW, #803 addresses some related (but different) issues to the ones you're addressing here. |
@stuarteberg Could you explain to me what you expect |
I'm thinking about this line: d.update(**get_git_build_info(d['SRC_DIR'],
git_url,
m.get_value('source/git_rev'))) If third argument evaluates to |
|
Ah, okay. Still, for the purposes of this discussion, |
Oh, that third option is supposed to be |
Sure, that works, too. |
BTW, there are likely to be a couple tiny conflicts between this PR and #803. Not sure if you want to merge that first and rebase this or vice-versa. |
Probably best to merge #803 first. |
Also, #790 touches the same function. Might want to look there, too. |
This probably needs its build restarted, but I don't know if it is worth worrying about at this point. |
If autotype is False and the field doesn't exist, always return the default object. Added docstring
This is the cleanest way I see to allow source/git_url and source/path to behave as expected.
@kalefranz, could you review this one? I'm sure the lack of GIT_* variables is breaking a lot of people's workflows (including ours in Navigator). |
LGTM. Merging. Thanks @groutr @stuarteberg @jakirkham |
The overarching goal of this PR is to fix issues with source/path (#783).
I uncovered a subtle issue with the Metadata.get_value() method not behaving as expected (see 3bd490d)