mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-26 14:47:18 +01:00
Fix pre-existing CI failures from the MCP-server commit
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
This commit is contained in:
parent
de76c6541e
commit
0c48ed022c
@ -5,6 +5,7 @@ bandit>=1.7.0
|
|||||||
codespell>=2.2.0
|
codespell>=2.2.0
|
||||||
coverage>=7.4.0
|
coverage>=7.4.0
|
||||||
howlongtobeatpy>=1.0
|
howlongtobeatpy>=1.0
|
||||||
|
mcp>=1.9
|
||||||
mypy>=1.8.0
|
mypy>=1.8.0
|
||||||
pre-commit>=3.6.0
|
pre-commit>=3.6.0
|
||||||
pylint>=3.0.0
|
pylint>=3.0.0
|
||||||
|
|||||||
@ -15,8 +15,10 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
readonly REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
readonly SCRIPT_DIR
|
||||||
|
REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||||
|
readonly REPO_DIR
|
||||||
readonly VENV_DIR="${HOME}/.venvs/steam-backlog-mcp"
|
readonly VENV_DIR="${HOME}/.venvs/steam-backlog-mcp"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|||||||
@ -35,7 +35,11 @@ from steam_backlog_enforcer.protondb import (
|
|||||||
ProtonDBRating,
|
ProtonDBRating,
|
||||||
fetch_protondb_ratings,
|
fetch_protondb_ratings,
|
||||||
)
|
)
|
||||||
from steam_backlog_enforcer.steam_api import GameInfo, SteamAPIClient
|
from steam_backlog_enforcer.steam_api import (
|
||||||
|
GameInfo,
|
||||||
|
SteamAPIClient,
|
||||||
|
SteamAPIError,
|
||||||
|
)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from steam_backlog_enforcer.config import Config, State
|
from steam_backlog_enforcer.config import Config, State
|
||||||
@ -276,7 +280,8 @@ def _print_pace_scenario(state: State, remaining: int, games_done: int) -> None:
|
|||||||
rate = games_done / days_elapsed
|
rate = games_done / days_elapsed
|
||||||
_echo(f" Started: {started.strftime('%Y-%m-%d')}")
|
_echo(f" Started: {started.strftime('%Y-%m-%d')}")
|
||||||
_echo(
|
_echo(
|
||||||
f" Finished: {games_done} games in {days_elapsed} days (since enforcement start)"
|
f" Finished: {games_done} games in {days_elapsed} days "
|
||||||
|
"(since enforcement start)"
|
||||||
)
|
)
|
||||||
_echo(
|
_echo(
|
||||||
f" Pace: {rate:.4f} games/day (1 game every {1 / rate:.1f} days)"
|
f" Pace: {rate:.4f} games/day (1 game every {1 / rate:.1f} days)"
|
||||||
@ -357,8 +362,6 @@ def _refresh_recently_played_completions(
|
|||||||
except OSError:
|
except OSError:
|
||||||
return games
|
return games
|
||||||
|
|
||||||
from steam_backlog_enforcer.steam_api import SteamAPIError
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client = SteamAPIClient(config.steam_api_key, config.steam_id)
|
client = SteamAPIClient(config.steam_api_key, config.steam_id)
|
||||||
owned_raw = client.get_owned_games()
|
owned_raw = client.get_owned_games()
|
||||||
|
|||||||
@ -246,7 +246,7 @@ def count_complete_since_start(games: list[GameInfo], started_at: str) -> int:
|
|||||||
Games with no achievement timestamp data are excluded — their completion
|
Games with no achievement timestamp data are excluded — their completion
|
||||||
date is unknown, and they were most likely finished before Steam began
|
date is unknown, and they were most likely finished before Steam began
|
||||||
recording unlock timestamps (i.e. before the enforcement period).
|
recording unlock timestamps (i.e. before the enforcement period).
|
||||||
Returns 0 when started_at is empty or unparseable.
|
Returns 0 when started_at is empty or unparsable.
|
||||||
"""
|
"""
|
||||||
if not started_at:
|
if not started_at:
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@ -3,11 +3,11 @@ Picking a game should work like this:
|
|||||||
1. user invokes script with specific flag for picking a game manually
|
1. user invokes script with specific flag for picking a game manually
|
||||||
2. user provides game steam id (in testing use 489830)
|
2. user provides game steam id (in testing use 489830)
|
||||||
3. Script shows what game it believes this id means (in this case it should show The Elder Scrolls V: Skyrim Special Edition)
|
3. Script shows what game it believes this id means (in this case it should show The Elder Scrolls V: Skyrim Special Edition)
|
||||||
4. user confirms that this is the game they want to pick and confirm that they will not be able to use the script for up to 2 weeks or until the game is completed (100% achievments)
|
4. user confirms that this is the game they want to pick and confirm that they will not be able to use the script for up to 2 weeks or until the game is completed (100% achievements)
|
||||||
|
|
||||||
When user picks a game manually this should override the current pick if it exists
|
When user picks a game manually this should override the current pick if it exists
|
||||||
After picking manually backlog enforcer should make a note of that and very aggresively disallow user to do anything else
|
After picking manually backlog enforcer should make a note of that and very aggressively disallow user to do anything else
|
||||||
for a period of 2 weeks or untill user completes a given game
|
for a period of 2 weeks or until user completes a given game
|
||||||
Logic should be as follows:
|
Logic should be as follows:
|
||||||
1. backlog checks if a user picked game manually
|
1. backlog checks if a user picked game manually
|
||||||
a. if not -> continue as before
|
a. if not -> continue as before
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user