Is there a way to disable pylint through env var o...
# ask-metaflow
g
Is there a way to disable pylint through env var or config instead of CLI? we enforce pylint for the whole repo, so feels unnecessary to run pylint for individual flow file. It's annoying to specify
--no-pylint
everytime user needs to run a flow.
1
a
yep -
METAFLOW_PYLINT=0
g
a
this is an env var outside of configs. all CLI args are mapped to env vars by default in metaflow. anything you specify in cli can be equivalently specified using env vars
python --some-key-a=value-1 foo --some-key-b=value-2 bar --some-key-c=value-3
is equivalent to
Copy code
METAFLOW_SOME_KEY_A=value-1 METAFLOW_FOO_SOME_KEY_B=value-2 METAFLOW_FOO_BAR_SOME_KEY_C=value=3 python foo bar
💡 1
thankyou 1
g
could you point me in code where it's done? also, we use extension following https://github.com/Netflix/metaflow-extensions-template/blob/master/README.md, is there a way to set this in the extension so individual users of our extension doesn't need to disable pylint themselves?
a
g
ah, gotcha. Thank you!
btw, that means it has to be configured through env var, not via a config file from e.g. https://github.com/Netflix/metaflow/blob/e72508a65abdad5d576b4b3d1715b2d1356772ab/metaflow/metaflow_config_funcs.py#L22 , right?
d
I’m not 100% sure you can override it in the config like that though. click explicitly uses config variables and that is not what the metaflow_config.py files have. I suspect though that you can add something like
os.environ["METAFLOW_PYLINT"] = "0"
in the toplevel file to be loaded prior to click doing its thing but not 100% sure.
some of the other ones take configs from there. Letme check for pylint.
ya, no we don’t have it taking a default from a configuration value.
we could change that if the os.environ approach does not work.
g
I suspect though that you can add something like
os.environ["METAFLOW_PYLINT"] = "0"
in the toplevel file to be loaded prior to click doing its thing but not 100% sure.
that's what I'm thinking too. We already modify METAFLOW_HOME in
module_overrides.py
to set
METAFLOW_HOME
so all users use the same config.json
d
cool — yes. try it out and let us know. I think it should work if it happens early enough.
g
it works. Thank you!