-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
See also: Usage-Guide | Configuration-Reference | Deployment-Guide
You can install the Wisp Framework directly from GitHub using pip.
pip install git+https://github.com/redkeysh/wisp.git# Install from a specific branch
pip install git+https://github.com/redkeysh/wisp.git@branch-name
# Example: Install from develop branch
pip install git+https://github.com/redkeysh/wisp.git@develop# Install from a specific tag
pip install git+https://github.com/redkeysh/wisp.git@v1.0.0
# Install from a specific commit
pip install git+https://github.com/redkeysh/wisp.git@abc123def# Install with database support
pip install git+https://github.com/redkeysh/wisp.git[db]
# Install with Redis support
pip install git+https://github.com/redkeysh/wisp.git[redis]
# Install with all extras
pip install git+https://github.com/redkeysh/wisp.git[all]If you want to make changes to the framework:
# Clone the repository
git clone https://github.com/redkeysh/wisp.git
cd wisp
# Install in editable mode
pip install -e .
# Or with extras
pip install -e ".[db,redis,all]"Once installed, you can import and use the framework:
# Recommended: Use create_app() convenience function
from wisp_framework import create_app
bot, lifecycle, ctx = create_app()
# Or use WispBot directly
from wisp_framework import WispBot, Module
from wisp_framework.config import AppConfig
from wisp_framework.lifecycle import LifecycleManagerNote: There is no Wisp class. Use WispBot (the main bot class) or create_app() (convenience function) instead. See the Usage-Guide for complete examples.
Add to your requirements.txt:
# Install from GitHub
git+https://github.com/redkeysh/wisp.git
# Or with extras
git+https://github.com/redkeysh/wisp.git[db,redis]
# Or pin to a specific version
git+https://github.com/redkeysh/wisp.git@v1.0.0Add to your pyproject.toml:
[project]
dependencies = [
"git+https://github.com/redkeysh/wisp.git",
]
[project.optional-dependencies]
all = [
"git+https://github.com/redkeysh/wisp.git[db,redis,all]",
]If using Poetry:
poetry add git+https://github.com/redkeysh/wisp.git
# With extras
poetry add "git+https://github.com/redkeysh/wisp.git[db,redis]"Or add to pyproject.toml:
[tool.poetry.dependencies]
wisp-framework = {git = "https://github.com/redkeysh/wisp.git", extras = ["db", "redis"]}pip install git+ssh://git@github.com/redkeysh/wisp.git# Set token as environment variable
export GIT_TOKEN=your_github_token
# Use in URL
pip install git+https://${GIT_TOKEN}@github.com/redkeysh/wisp.gitgit+https://${GIT_TOKEN}@github.com/redkeysh/wisp.gitThen set the token before installing:
export GIT_TOKEN=your_token
pip install -r requirements.txt- Create a release on GitHub (e.g.,
v1.0.0) - Pin to that version:
pip install git+https://github.com/redkeysh/wisp.git@v1.0.0# Pin to specific tag
git+https://github.com/redkeysh/wisp.git@v1.0.0
# Pin to specific commit (most stable)
git+https://github.com/redkeysh/wisp.git@abc123def456789pip install --upgrade git+https://github.com/redkeysh/wisp.gitpip install --upgrade git+https://github.com/redkeysh/wisp.git@v1.1.0mkdir my-discord-bot
cd my-discord-bot
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activategit+https://github.com/redkeysh/wisp.git[db,redis]
discord.py>=2.3.0
python-dotenv>=1.0.0pip install -r requirements.txt# bot.py
from wisp_framework.config import AppConfig
from wisp_framework.lifecycle import (
LifecycleManager,
create_bot_context,
create_feature_flags,
create_services,
)
from wisp_framework.logging import setup_logging
from wisp_framework.registry import ModuleRegistry
def main():
config = AppConfig()
setup_logging(config)
services = create_services(config)
feature_flags = create_feature_flags(services)
module_registry = ModuleRegistry(feature_flags)
ctx = create_bot_context(config, services)
lifecycle = LifecycleManager()
import asyncio
async def run():
bot = await lifecycle.startup(config, services, module_registry, ctx)
await bot.start(config.discord_token)
asyncio.run(run())
if __name__ == "__main__":
main()python bot.pySolution: Make sure you're using the correct URL format:
- ✅
git+https://github.com/user/repo.git - ❌
https://github.com/user/repo.git(missinggit+)
Solution: Use SSH or provide a token:
pip install git+ssh://git@github.com/redkeysh/wisp.gitSolution: Make sure you installed with the correct package name:
# The package name is 'wisp-framework' but imports as 'wisp_framework'
from wisp_framework import ...Solution: Make sure extras are in brackets:
# Correct
pip install git+https://github.com/user/repo.git[db]
# Incorrect
pip install git+https://github.com/user/repo.git db- Pin Versions: Always pin to a specific tag or commit in production
- Use Tags: Create GitHub releases/tags for stable versions
- Document Versions: Keep track of which version your bot uses
- Test Updates: Test framework updates in a development environment first
-
Use Requirements Files: Always use
requirements.txtorpyproject.toml
If you want to publish to PyPI instead of GitHub:
- Build the package:
pip install build
python -m build- Upload to PyPI:
pip install twine
twine upload dist/*Then users can install with:
pip install wisp-framework