Skip to content

Should exclude argparse from dependencies #76

@srstrickland

Description

@srstrickland

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions