Add setup.py, to be installable via pip

This is a simpler way to install Limnoria plugin:
https://docs.limnoria.net/develop/plugin_distribution.html#via-pip-pypi

This will allow installing ChanTracker with this command:

    pip3 install git+https://github.com/ncoevoet/ChanTracker.git
This commit is contained in:
Valentin Lorentz 2022-10-12 19:11:17 +02:00
parent 2646838ad7
commit fe6ce22908
2 changed files with 19 additions and 0 deletions

View File

@ -5,8 +5,14 @@ This supybot plugin keeps records of channel mode changes in a sqlite database a
The plugin is used in various and large channels on Libera.Chat and others networks
This version works with python 3
## Install
Note that you may need a newer version of Limnoria than your distribution provides, and you may need to install from the Limnoria source code or from PyPI / `pip` to make it function. (Currently requires Limnoria version `2018.04.14` or newer)
You can install this plugin with: `pip3 install git+https://github.com/ncoevoet/ChanTracker.git`.
(Or, with Limnoria versions older than 2020.05.08: `git clone https://github.com/ncoevoet/ChanTracker.git` in your bot's `plugins/` directory.)
Then, `@load ChanTracker`.
## Commands ##
!b,e,i,q [<channel>] <nick|hostmask>[,<nick|hostmask>] [<years>y] [<weeks>w] [<days>d] [<hours>h] [<minutes>m] [<seconds>s] [<-1> or empty means forever] <reason>) -- +mode targets for duration <reason> is mandatory

13
setup.py Normal file
View File

@ -0,0 +1,13 @@
import os
import sys
from supybot.setup import plugin_setup
# Workaround pip changing the name of the root directory
(parent, dir_) = os.path.split(os.path.dirname(__file__))
sys.path.insert(0, parent)
sys.modules["ChanTracker"] = __import__(dir_)
plugin_setup(
'ChanTracker',
)