Remove env.get logic from defaults#1289
Conversation
454ecd6 to
4b7aa42
Compare
|
A few additions:
Both serve to fix #1297. |
|
Thanks! Hm. The So that the author of a GDExtension can change what the defaults are in their case. With this PR, how would you accomplish the same thing? Also, this will need a rebase after PR #1299 in order for tests to pass. |
• Didn't work in practice, always returning the fallback value instead
4b7aa42 to
e103dbb
Compare
|
That's interesting… I was testing with launch arguments before, but that seems to handle differently than assigning in Python then porting to an exported command. Not sure if the same behavior applies to the main repo, I'll have to test that sometime today Wait so, this all also means that any options in the misc subfiles will need this as well? That feels off Either way, I suppose this was a bit of a misguided PR. There's still things about it that fix bugs that I want to get committed, but I'll just put those in a separate PR so I can untangle this in its own right |
|
Closing this now-draft PR. The core issues have been addressed & some initial assumptions were misinformed. I still want to explore alternatives to the current |
After some local tests, it turns out these never worked in practice. They seemed to work, as the vast majority had simple fallbacks that were able to function identically. However,
use_hot_reloadtried to use logic from another container entirely; because that value always defaulted totemplate_debug, the conditional always passed &use_hot_reloadwas always enabled if no commandline value was specifiedThe majority of changes in this PR are removing the
env.getlogic outright, as every other case can substitute the previous fallback value as the default & the end result is functionally identical.use_hot_reloadnow has a default value ofNone, meaning it doesn't add any environment option; as such, an explicit assignment is handled before the very first use-case. This was achieved by porting over the expected logic of the previous default valueThe only other change was adjusting the
compiledbenvironment check from theenv.getfunction to the dictionary equivalent. This is because I believe we should be usingenv.getonly in scenarios where a value might be null. Otherwise, the fallback value used is redundant, as an explicit bool is guaranteedEDIT: Fixes #1297