Hacker News new | ask | show | jobs
by antoncohen 3246 days ago
"Snek Pro Solutions" distributes a package (pip installed) called cute-snek. In the cute-snek setup.py it has:

    entry_points={
        'snek_types': [
            'cute = cute_snek:cute_snek',
        ],
    }
The main snek codebase has:

    for entry_point in pkg_resources.iter_entry_points('snek_types'):
        sneks[entry_point.name] = entry_point.load()
pkg_resources.iter_entry_points() iterates through all the snek_types an end user has installed on their system. When the end user does `pip install snek` they will only have the built-in sneks, when they also do `pip install cute-snek` the will have the "cute" snek installed, allowing them to run `snek --type cute` to see it.