Skip to content
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

Should exclude argparse from dependencies #76

Open
srstrickland opened this issue Feb 12, 2022 · 1 comment
Open

Should exclude argparse from dependencies #76

srstrickland opened this issue Feb 12, 2022 · 1 comment

Comments

@srstrickland
Copy link

argparse is included with python... unless you're using an ancient python (pre-2.7 or pre-3.2 if on 3.x). the effect of this inclusion as a dependency in sensu-plugin is that anything depending on sensu-plugin will also pull in the 3rd party argparse module, which then takes precedence over the builtin module. this is bad primarily because users of sensu-plugin are being unwittingly pinned to an ancient, unsupported version of argparse, without recent features & bugfixes. I only discovered this because some newer code (from a different 3rdparty lib) was choking with an error:

__init__() got an unexpected keyword argument 'allow_abbrev'

allow_abbrev is a valid parameter for the python's argparse.ArgumentParser, but not the 3rd party legacy version.

it seems reasonable to simply remove the dependency, and force users who are on very old versions of python to manually include the 3rd party argparse in their dependencies.

i've made the relevant 2-line fix in this fork's branch. wasn't sure what to do about changelog etc since technically this is a "breaking" change... but only for (hopefully) a tiny subset of users. for the rest of the universe, it fixes (IMHO) a serious issue.

@barryorourke
Copy link
Member

Thanks for the patch, I'll take a look at this over the next couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants