Skip to content

Idea: use entry points for custom commands #29

@diazona

Description

@diazona

While browsing the documentation it occurred to me that the entry points mechanism would be a good fit for pypipe's custom commands. Like, if I'm writing a custom command, I would really like to be able to package up my custom command and put it on PyPI, then I could install it into the same virtual environment as pypipe itself and it would automatically be available. The setuptools documentation has a good explanation of entry points, I think, although it is not a setuptools-specific feature and you do not have to be using setuptools to take advantage of entry points.

The main advantage of this approach over the current method of using custom commands is that the custom commands can be written with all the normal niceties of Python package development (syntax checking, linting, automated tests, releases, easy installation with pip or pipx). However, the tradeoff is that this will only work if pypipe itself is actually installed with pip or pipx, not if someone just drops pypipe.py in a directory and tries to run it. (Or, it might not require pypipe itself to be installed, but it will definitely require the custom command packages to be installed.) However this would be in addition to the current method of installing custom commands - that is, it would not be necessary to remove the current config file method in order to support the new entry point method, so people who don't want to install pypipe can continue to use the config file. (I think so, anyway.)

If this is something you'd be interested in, sometime in the future when I get time I would be happy to help sketch out how this could be done, or even provide a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions