-
Notifications
You must be signed in to change notification settings - Fork 145
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
DEBUG cannot be enabled by env var, even though it is said to be possible #378
Comments
Digging a bit more, I guess this might be actually misunderstanding, as seems like I was using If the env var is just applied as a normal env var, things work: $ DEBUG=true bonobo run debugtest.py
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('convert = bonobo.commands.convert:ConvertCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('download = bonobo.commands.download:DownloadCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('examples = bonobo.commands.examples:ExamplesCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('init = bonobo.commands.init:InitCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('inspect = bonobo.commands.inspect:InspectCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('run = bonobo.commands.run:RunCommand')
DEBG:0000:stevedore.extension: found extension EntryPoint.parse('version = bonobo.commands.version:VersionCommand')
DEBG:0000:root: Command: run Arguments: {'command': 'run', 'file': 'debugtest.py', 'mod': None, 'default_env_file': None, 'default_env': None, 'env_file': None, 'env': None, 'quiet': False, 'verbose': False, 'install': False}
<Setting DEBUG=True>
<Setting PROFILE=False>
DEBG:0000:root: Creating execution strategy 'threadpool'...
DEBG:0000:bonobo.execution.contexts.node: Node loop starts for <NodeExecutionContext(+extract)>.
DEBG:0000:bonobo.execution.contexts.node: Node loop ends for <NodeExecutionContext(-extract) in=1 out=1>.
- extract(0) in=1 out=1 [done] (not exactly the same The confusion was:
This might warrant some documentation clarifications, but does not feel like a bug anymore, sorry for the noise! |
The issue you faced is because arguments are parsed by You should be able to see the values you wanted to see if you do |
Retried again, moving the test inside the # debugtest.py
import bonobo
def extract():
yield "test"
if __name__ == "__main__":
parser = bonobo.get_argument_parser()
with bonobo.parse_args(parser) as options:
print(bonobo.settings.DEBUG)
bonobo.run(bonobo.Graph(extract), services={}) resulting in these outcomes of the 4 different cases of applying env vars, that I understood:
|
The docs say about settings, that
I was trying to set
DEBUG
for a while, and was wondering why it was turning outfalse
all the time, while other settings (such asPROFILE
) were correctly picked up.Tested it with
and running:
On the other hand:
Looking at the code, I think this argument parsing:
bonobo/bonobo/commands/__init__.py
Line 23 in 274058d
basically overrides that env var for
DEBUG
, and basically blocksbonobo/bonobo/settings.py
Line 81 in 274058d
But this is my hunch of what's going on, either way, the env var way of setting debug does not seem to be effective.
Versions
Bonobo version:
bonobo v.0.7.0rc2
Python version:
CPython 3.8.2 (default, Mar 25 2020, 18:15:24)
[Clang 11.0.0 (clang-1100.0.33.16)]
Platform:
Darwin 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64 (MacOS 10.15.4)
The text was updated successfully, but these errors were encountered: