How to use the entrypoints.BadEntryPoint function in entrypoints

To help you get started, we’ve selected a few entrypoints 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 takluyver / entrypoints / tests / test_entrypoints.py View on Github external
def test_parse_bad():
    with pytest.raises(entrypoints.BadEntryPoint):
        entrypoints.EntryPoint.from_string("this won't work", 'foo')
github takluyver / entrypoints / entrypoints.py View on Github external
"""Parse an entry point from the syntax in entry_points.txt

        :param str epstr: The entry point string (not including 'name =')
        :param str name: The name of this entry point
        :param Distribution distro: The distribution in which the entry point was found
        :rtype: EntryPoint
        :raises BadEntryPoint: if *epstr* can't be parsed as an entry point.
        """
        m = entry_point_pattern.match(epstr)
        if m:
            mod, obj, extras = m.group('modulename', 'objectname', 'extras')
            if extras is not None:
                extras = re.split(r',\s*', extras)
            return cls(name, mod, obj, extras, distro)
        else:
            raise BadEntryPoint(epstr)
github takluyver / entrypoints / entrypoints.py View on Github external
def err_to_warnings():
        try:
            yield
        except BadEntryPoint as e:
            warnings.warn(str(e))