Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scientifichackers/plugingen
A plugin generator for pip.
https://github.com/scientifichackers/plugingen
Last synced: 3 days ago
JSON representation
A plugin generator for pip.
- Host: GitHub
- URL: https://github.com/scientifichackers/plugingen
- Owner: scientifichackers
- Created: 2018-12-15T13:20:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-17T07:09:58.000Z (almost 6 years ago)
- Last Synced: 2024-10-13T15:42:23.698Z (about 1 month ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# plugingen
Create `pip` plugins in seconds. 🗲
---
For instance, This is how you would go about creating a plugin for the popular package `pipdeptree`:
```python
# pip_plugin_tree.py
import plugingencli = plugingen.create(
code="import pipdeptree\npipdeptree.main()", requirements=["pipdeptree"]
)
``````python
# setup.py
setup(
...
py_modules=['pip_plugin_tree'],
entry_points={"console_scripts": ["pip-plugin-tree = pip_plugin_tree:cli"]},
)
```And that's literally it.
For just this, You get a plugin that automatically gets discovered, works across virtualenvs, without any modification to the original package whatsoever.
You even get your own little spot at `$ pip --help`:
```
$ pip --help
...
completion A helper command used for command completion.
help Show help for commands.3rd Party Commands:
tree
compile
syncGeneral Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
...
``````
$ pip tree -l
Django==2.1.4
- pytz [required: Any, installed: 2018.7]
pip==19.0.dev0
setuptools==40.6.3
wheel==0.32.3
```---
(This is a prof of concept for a [fork](https://github.com/devxpy/pip) of `pip` that supports plugins. Follow discussion [here](https://github.com/pypa/pip/issues/3999#issuecomment-447743331).)