diff --git a/.gitignore b/.gitignore index 021524e..85ba537 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,9 @@ settings.json logs/ .claude/ -data/ \ No newline at end of file +data/ +.ruff_cache/ +.vscode/ +.idea/ +*.iml +*.log diff --git a/CLAUDE.md b/CLAUDE.md index a60ce0f..d6c8f9f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,7 +45,7 @@ source env/bin/activate && python main.py --dump The application requires: - Python 3.10+ - Virtual environment at `env/` (must be activated before running commands) -- Dependencies from `requirements.txt` (includes FastAPI, uvicorn, Socket.IO) +- Dependencies from `pyproject.toml` (includes FastAPI, uvicorn, Socket.IO) Docker deployment: ```bash @@ -278,7 +278,7 @@ The application uses a web-based interface accessible via browser: **Dockerfile:** - Based on `python:3.11-slim` -- Installs dependencies from `requirements.txt` +- Installs dependencies from `pyproject.toml` - Exposes port 8080 - Health check on `/api/status` diff --git a/Dockerfile b/Dockerfile index 493d2ef..e5d735e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,11 +30,11 @@ RUN apt-get update && apt-get install -y \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* -# Copy requirements file -COPY requirements.txt . +# Copy project metadata and install dependencies +COPY pyproject.toml . # Install Python dependencies -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir . # Copy application code COPY main.py ./ diff --git a/README.md b/README.md index bce4262..59c5962 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ docker-compose up -d ```bash # Install Python 3.10+ and dependencies -pip install -r requirements.txt +pip install -e . # Run the application python main.py @@ -131,7 +131,7 @@ python -m venv env source env/bin/activate # On Windows: env\Scripts\activate # Install dependencies -pip install -r requirements.txt +pip install -e . # Run the application python main.py diff --git a/pyproject.toml b/pyproject.toml index 68ef7f7..83e0d79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,30 @@ +[project] +name = "twitch-drops-miner" +version = "1.0.0" # Update from src/version.py as needed +description = "Automatically mine Twitch drops without downloading stream data" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "aiohttp>=3.9", + "Pillow", + "truststore", + "python-dateutil", + "fastapi>=0.104.0", + "uvicorn[standard]>=0.24.0", + "python-socketio>=5.10.0", + "jinja2>=3.1.2", +] + +[project.optional-dependencies] +dev = [ + "ruff", + "mypy", +] + +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + [tool.ruff] # Set the maximum line length to 100 (more reasonable than 88) line-length = 100 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fc66290..0000000 --- a/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Core dependencies -aiohttp>=3.9,<4.0 -Pillow -truststore -python-dateutil - -# Web GUI dependencies (required) -fastapi>=0.104.0 -uvicorn[standard]>=0.24.0 -python-socketio>=5.10.0 -jinja2>=3.1.2 diff --git a/setup_env.sh b/setup_env.sh index 44f8a68..37030f8 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -25,15 +25,15 @@ if [ ! -d "$dirpath/env" ]; then fi fi -# Activate the virtual environment and install requirements +# Activate the virtual environment and install dependencies echo -echo "Installing requirements.txt..." +echo "Installing dependencies from pyproject.toml..." "$dirpath/env/bin/python" -m pip install -U pip "$dirpath/env/bin/pip" install wheel -"$dirpath/env/bin/pip" install -r "$dirpath/requirements.txt" +"$dirpath/env/bin/pip" install -e "$dirpath" if [ $? -ne 0 ]; then echo - echo "Failed to install requirements." + echo "Failed to install dependencies." echo read -p "Press any key to continue..." exit 1