switched to uv
This commit is contained in:
2
scripts/email_processor/.gitignore
vendored
2
scripts/email_processor/.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
venv
|
.venv/
|
||||||
|
|||||||
@@ -4,11 +4,14 @@ Learning-based mailbox cleanup using Himalaya (IMAP) + Ollama (local LLM). Class
|
|||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
- **uv** — Python package manager, handles venv and dependencies automatically.
|
||||||
- **Himalaya** — CLI email client, handles IMAP connection and auth.
|
- **Himalaya** — CLI email client, handles IMAP connection and auth.
|
||||||
- **Ollama** — local LLM server.
|
- **Ollama** — local LLM server.
|
||||||
- **Python 3.8+**
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Install uv (macOS)
|
||||||
|
brew install uv
|
||||||
|
|
||||||
# Install himalaya (macOS)
|
# Install himalaya (macOS)
|
||||||
brew install himalaya
|
brew install himalaya
|
||||||
|
|
||||||
@@ -18,12 +21,6 @@ himalaya account list # should show your account after setup
|
|||||||
# Install and start Ollama, pull the model
|
# Install and start Ollama, pull the model
|
||||||
brew install ollama
|
brew install ollama
|
||||||
ollama pull kamekichi128/qwen3-4b-instruct-2507:latest
|
ollama pull kamekichi128/qwen3-4b-instruct-2507:latest
|
||||||
|
|
||||||
# Set up Python venv and install dependencies
|
|
||||||
cd scripts/email_processor
|
|
||||||
python3 -m venv venv
|
|
||||||
source venv/bin/activate
|
|
||||||
pip install ollama
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## How It Works
|
## How It Works
|
||||||
|
|||||||
@@ -12,15 +12,10 @@
|
|||||||
# ./email-processor.sh review accept # accept all suggestions
|
# ./email-processor.sh review accept # accept all suggestions
|
||||||
# ./email-processor.sh stats # show history stats
|
# ./email-processor.sh stats # show history stats
|
||||||
#
|
#
|
||||||
# Requires: Python 3.8+, himalaya, Ollama running with model.
|
# Requires: uv, himalaya, Ollama running with model.
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
# Activate the virtualenv if it exists
|
exec uv run --project "$SCRIPT_DIR" python "$SCRIPT_DIR/main.py" "$@"
|
||||||
if [ -d "$SCRIPT_DIR/venv" ]; then
|
|
||||||
source "$SCRIPT_DIR/venv/bin/activate"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec python3 "$SCRIPT_DIR/main.py" "$@"
|
|
||||||
|
|||||||
5
scripts/email_processor/pyproject.toml
Normal file
5
scripts/email_processor/pyproject.toml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[project]
|
||||||
|
name = "email-processor"
|
||||||
|
version = "0.1.0"
|
||||||
|
requires-python = ">=3.10"
|
||||||
|
dependencies = ["ollama"]
|
||||||
@@ -1 +0,0 @@
|
|||||||
python3.13
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
python3.13
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
home = /opt/homebrew/opt/python@3.13/bin
|
|
||||||
include-system-site-packages = false
|
|
||||||
version = 3.13.0
|
|
||||||
executable = /opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/bin/python3.13
|
|
||||||
command = /opt/homebrew/opt/python@3.13/bin/python3.13 -m venv /Users/ylu/Documents/me/youlu-openclaw-workspace/scripts/email_processor/venv
|
|
||||||
Reference in New Issue
Block a user