view tests/hghaveaddon.py @ 5480:9242d0b5f74d stable

split: compatibility with cmdutil.revert() without parents argument `assert` is here because I'm not sure if this is enough, and we might not have tests that fail this specific assert.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 21 Aug 2020 23:04:03 +0800
parents 398c7031177a
children f2139537c2be
line wrap: on
line source

import hghave

@hghave.check("docgraph-ext", "Extension to generate graph from repository")
def docgraph():
    try:
        import hgext.docgraph
        hgext.docgraph.cmdtable # trigger import
    except ImportError:
        try:
            import hgext3rd.docgraph
            hgext3rd.docgraph.cmdtable # trigger import
        except ImportError:
            return False
    return True

@hghave.check("flake8", "Flake8 python linter")
def has_flake8():
    try:
        import flake8

        flake8.__version__
    except ImportError:
        return False
    else:
        return True