view tests/hghaveaddon.py @ 6082:221a2563b02f

ci: allow defining $hg_branch to update to using an environment variable GitLab CI/CD variables page says that "Variables set in the GitLab UI are not passed down to service containers", but I think it only applies to variables set in project settings, because HG_BRANCH works correctly when set at the point of creating a new pipeline manually.
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 16 Nov 2021 16:07:41 +0300
parents f2139537c2be
children e41b99cec0c2
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

@hghave.check("check-manifest", "check-manifest MANIFEST.in checking tool")
def has_check_manifest():
    return hghave.matchoutput('check-manifest --version 2>&1',
                              br'check-manifest version')