def METHOD_NAME(tag):
    """Handle tags like pyqt>=5.3.1 for BDD tests.
    This transforms e.g. pyqt>=5.3.1 into an appropriate @pytest.mark.skip
    marker, and falls back to pytest-bdd's implementation for all other
    casesinto an appropriate @pytest.mark.skip marker, and falls back to
    """
    version_re = re.compile(r"""
        (?P<package>qt|pyqt|pyqtwebengine|python)
        (?P<operator>==|>=|!=|<)
        (?P<version>\d+\.\d+(\.\d+)?)
    """, re.VERBOSE)
    match = version_re.fullmatch(tag)
    if not match:
        return None
    package = match.group('package')
    version = match.group('version')
    if package == 'qt':
        op = match.group('operator')
        do_skip = {
            '==': not qtutils.version_check(version, exact=True,
                                            compiled=False),
            '>=': not qtutils.version_check(version, compiled=False),
            '<': qtutils.version_check(version, compiled=False),
            '!=': qtutils.version_check(version, exact=True, compiled=False),
        }
        return pytest.mark.skipif(do_skip[op], reason='Needs ' + tag)
    elif package == 'pyqt':
        return pytest.mark.skipif(
            not _check_version(
                op_str=match.group('operator'),
                running_version=PYQT_VERSION,
                version_str=version,
                as_hex=True,
            ),
            reason='Needs ' + tag,
        )
    elif package == 'pyqtwebengine':
        try:
            from qutebrowser.qt.webenginecore import PYQT_WEBENGINE_VERSION
        except ImportError:
            # QtWebKit
            running_version = PYQT_VERSION
        else:
            running_version = PYQT_WEBENGINE_VERSION
        return pytest.mark.skipif(
            not _check_version(
                op_str=match.group('operator'),
                running_version=running_version,
                version_str=version,
                as_hex=True,
            ),
            reason='Needs ' + tag,
        )
    elif package == 'python':
        running_version = sys.version_info
        return pytest.mark.skipif(
            not _check_version(
                op_str=match.group('operator'),
                running_version=running_version,
                version_str=version,
            ),
            reason='Needs ' + tag,
        )
    else:
        raise utils.Unreachable(package)