How to use the vermin.backports.Backports function in vermin

To help you get started, we’ve selected a few vermin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netromdk / vermin / vermin / processor.py View on Github external
if res.node is None:
    return res

  visitor = SourceVisitor(config)
  visitor.set_no_lines(res.novermin)

  try:
    visitor.visit(res.node)
  except KeyboardInterrupt:
    return res

  try:
    res.mins = visitor.minimum_versions()
    res.text = visitor.output_text()
    for m in visitor.modules():
      if Backports.is_backport(m):
        res.bps.add(m)
  except InvalidVersionException as ex:
    res.mins = None
    res.text = str(ex)

  return res
github netromdk / vermin / vermin / backports.py View on Github external
def is_backport(module):
    return module in Backports.modules()
github netromdk / vermin / vermin / arguments.py View on Github external
"        ignore conditional logic that can trigger incompatible results. It's more\n"
            "        fine grained than lax mode.\n\n"
            "        Examples:\n"
            "          Exclude 'foo.bar.baz' module/member: --exclude 'foo.bar.baz'\n"
            "          Exclude 'foo' kwarg:                 --exclude 'somemodule.func(foo)'\n"
            "          Exclude 'bar' codecs error handler:  --exclude 'ceh=bar'\n"
            "          Exclude 'baz' codecs encoding:       --exclude 'ce=baz'")
      print("\n  [--exclude-file ] ...\n"
            "        Exclude full names like --exclude but from a specified file instead. Each\n"
            "        line constitutes an exclusion with the same format as with --exclude.")
      print("\n  [--backport ] ...\n"
            "        Some features are sometimes backported into packages, in repositories such\n"
            "        as PyPi, that are widely used but aren't in the standard language. If such a\n"
            "        backport is specified as being used, the results will reflect that instead."
            "\n\n"
            "        Supported backports:\n{}".format(Backports.str(10)))