mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-10 20:47:04 +01:00
CI on main was already red before this branch. Address the repo-wide failures that `pre-commit run --all-files` and the test job surface: - requirements.txt: add `mcp>=1.9` so the CI/dev env can import steam_backlog_enforcer._mcp and collect test_mcp.py (mcp stays an optional dep in pyproject for the light systemd/CLI path). - _stats.py: hoist the SteamAPIError import to module scope (PLC0415) and wrap an over-length f-string (E501). - _web_dataset.py, docs/pick_game_manually_design.md: codespell typo fixes (unparsable, achievements, aggressively, until) + trailing newline. - scripts/setup_mcp.sh: split declare/assign for SCRIPT_DIR/REPO_DIR (shellcheck SC2155). Tests remain 100% covered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RRCdR4D8SaVrN2xraMQxM
44 lines
1.5 KiB
Bash
Executable File
44 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# Set up the dedicated virtualenv that hosts the Steam Backlog Enforcer MCP
|
|
# server. Claude Code spawns this interpreter (see the repo-root .mcp.json) to
|
|
# run `python -m steam_backlog_enforcer._mcp` over stdio.
|
|
#
|
|
# The MCP SDK (`mcp`) lives ONLY in this venv — it is an optional dependency,
|
|
# deliberately kept out of the system/CLI/systemd python path. Both `mcp` and
|
|
# `steam_backlog_enforcer` must be importable by this one interpreter or the
|
|
# MCP server fails to start silently.
|
|
#
|
|
# Idempotent: safe to re-run to pick up dependency changes.
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
readonly SCRIPT_DIR
|
|
REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
readonly REPO_DIR
|
|
readonly VENV_DIR="${HOME}/.venvs/steam-backlog-mcp"
|
|
|
|
main() {
|
|
echo "== Setting up MCP venv at ${VENV_DIR} =="
|
|
|
|
if [[ ! -d "${VENV_DIR}" ]]; then
|
|
python3 -m venv "${VENV_DIR}"
|
|
fi
|
|
|
|
"${VENV_DIR}/bin/pip" install --quiet --upgrade pip
|
|
"${VENV_DIR}/bin/pip" install --quiet -e "${REPO_DIR}[mcp]"
|
|
|
|
echo "== Verifying imports =="
|
|
"${VENV_DIR}/bin/python" -c \
|
|
"import mcp, steam_backlog_enforcer; print('mcp + steam_backlog_enforcer import OK')"
|
|
|
|
echo
|
|
echo "Done. The server is registered via ${REPO_DIR}/.mcp.json"
|
|
echo "Restart Claude Code in this repo and approve the project MCP server prompt."
|
|
}
|
|
|
|
main "$@"
|