Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ jobs:
- name: Generate static JSON dump + openapi.json
env:
TECHAPI_DATA_DIR: ${{ github.workspace }}/TechAPI/data
# Games are not published here: ~962k per-record files exceed the fixed
# GitHub Pages deployment window (the deploy step times out at
# "syncing_files"). Skipping them at generation time also keeps this
# step from writing files that would only be deleted before upload.
# They remain available as versioned data in the TechAPI repo.
run: python -m app.dump --output dump --exclude games
run: python -m app.dump --output dump

- uses: actions/setup-node@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions app/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"cpus",
"laptops",
"monitors",
"games",
"software",
"websites",
]
Expand Down Expand Up @@ -151,7 +150,7 @@ def run(output_dir: Path = OUTPUT_DIR, exclude: list[str] | None = None) -> None
default=[],
metavar="COLLECTION",
help=(
"collection to skip, repeatable (e.g. --exclude games). Useful when a "
"collection to skip, repeatable (e.g. --exclude software). Useful when a "
"consumer does not publish a large collection: skipping it avoids "
"writing hundreds of thousands of files that are discarded anyway."
),
Expand Down
2 changes: 0 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from app.routers import (
brands,
cpus,
games,
gpus,
laptops,
meta,
Expand Down Expand Up @@ -89,7 +88,6 @@ async def add_request_id(
app.include_router(cpus.router, prefix=PREFIX)
app.include_router(laptops.router, prefix=PREFIX)
app.include_router(monitors.router, prefix=PREFIX)
app.include_router(games.router, prefix=PREFIX)
app.include_router(software.router, prefix=PREFIX)
app.include_router(websites.router, prefix=PREFIX)

Expand Down
2 changes: 0 additions & 2 deletions app/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from app.models.brand import Brand
from app.models.cpu import CPU
from app.models.game import Game
from app.models.gpu import DiscreteGPU
from app.models.laptop import Laptop
from app.models.mobile_device import PDA, Tablet, Watch
Expand All @@ -25,6 +24,5 @@
"CPU",
"Laptop",
"Monitor",
"Game",
"Software",
]
53 changes: 0 additions & 53 deletions app/models/game.py

This file was deleted.

63 changes: 0 additions & 63 deletions app/routers/games.py

This file was deleted.

2 changes: 0 additions & 2 deletions app/schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from app.schemas.brand import BrandRead, BrandSummary
from app.schemas.common import ErrorBody, ErrorResponse, Page, ResourceRef
from app.schemas.game import GameRead
from app.schemas.laptop import LaptopRead
from app.schemas.monitor import MonitorRead
from app.schemas.smartphone import ScoreRead, SmartphoneRead
Expand All @@ -23,6 +22,5 @@
"ScoreRead",
"LaptopRead",
"MonitorRead",
"GameRead",
"SoftwareRead",
]
33 changes: 0 additions & 33 deletions app/schemas/game.py

This file was deleted.

29 changes: 0 additions & 29 deletions app/schemas/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from app.config import settings
from app.models.brand import Brand
from app.models.cpu import CPU
from app.models.game import Game
from app.models.gpu import DiscreteGPU
from app.models.laptop import Laptop
from app.models.mobile_device import MobileDeviceFields
Expand All @@ -17,7 +16,6 @@
from app.schemas.brand import BrandRead, BrandSummary
from app.schemas.common import HybridRead, ManufacturerRef, ResourceRef
from app.schemas.cpu import CPURead, CPUScoreRead
from app.schemas.game import GameRead
from app.schemas.gpu import GPURead, GPUScoreRead
from app.schemas.laptop import LaptopRead
from app.schemas.mobile_device import MobileDeviceRead
Expand Down Expand Up @@ -384,33 +382,6 @@ def monitor_read(monitor: Monitor, brand: Brand) -> MonitorRead:
)


def game_read(game: Game) -> GameRead:
assert game.id is not None
return GameRead(
id=game.id,
slug=game.slug,
name=game.name,
release_date=game.release_date,
rating=game.rating,
rating_count=game.rating_count,
metacritic=game.metacritic,
playtime_hours=game.playtime_hours,
platforms=game.platforms,
genres=game.genres,
stores=game.stores,
developers=game.developers,
publishers=game.publishers,
tags=game.tags,
esrb_rating=game.esrb_rating,
background_image=game.background_image,
verified=game.verified,
source_urls=game.source_urls,
created_at=game.created_at,
updated_at=game.updated_at,
url=url_for("games", game.slug),
)


def software_read(software: Software) -> SoftwareRead:
assert software.id is not None
return SoftwareRead(
Expand Down
11 changes: 0 additions & 11 deletions app/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from app.database import create_db_and_tables, engine
from app.models.brand import Brand
from app.models.cpu import CPU
from app.models.game import Game
from app.models.gpu import DiscreteGPU
from app.models.laptop import Laptop
from app.models.mobile_device import PDA, Tablet, Watch
Expand Down Expand Up @@ -103,7 +102,6 @@ def seed(session: Session, data_dir: Path = DATA_DIR) -> dict[str, int]:
"cpus": 0,
"laptops": 0,
"monitors": 0,
"games": 0,
"software": 0,
"websites": 0,
}
Expand Down Expand Up @@ -264,15 +262,6 @@ def seed_mobile_devices(subdir: str, model: type[SQLModel], count_key: str) -> N
counts["monitors"] += 1
session.commit()

# --- Games (standalone; no brand FK) ---
game_slugs = _existing_slugs(session, Game)
for record in _load_dir(data_dir / "game"):
if record["slug"] in game_slugs:
continue
session.add(_with_id(Game(**record), taken))
counts["games"] += 1
session.commit()

# --- Software (standalone; no brand FK) ---
software_slugs = _existing_slugs(session, Software)
for record in _load_dir(data_dir / "software"):
Expand Down
20 changes: 0 additions & 20 deletions app/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@
"verified",
}

GAME_REQUIRED = {
"slug",
"name",
"source_urls",
"verified",
}

SOFTWARE_REQUIRED = {
"slug",
"name",
Expand Down Expand Up @@ -243,7 +236,6 @@ def validate() -> list[str]:
cpus = _load("cpu")
laptops = _load("laptop")
monitors = _load("monitor")
games = _load("game")
software = _load("software")
websites = _load("website")

Expand All @@ -263,7 +255,6 @@ def validate() -> list[str]:
("cpu", cpus),
("laptop", laptops),
("monitor", monitors),
("game", games),
("software", software),
("website", websites),
):
Expand Down Expand Up @@ -416,17 +407,6 @@ def validate() -> list[str]:
errors.append(f"{fname}: brand '{rec.get('brand')}' not a known brand")
_check_variant_path(fname, rec, "monitor", errors, allow_flat=True)

for fname, rec in games:
_check_required(fname, rec, GAME_REQUIRED, errors)
_check_source_urls(fname, rec, errors)
_check_slug(fname, rec.get("slug"), errors)
if rec.get("release_date") is not None:
_check_date(fname, rec["release_date"], errors)
if rec.get("rating") is not None:
_check_range(fname, "rating", rec.get("rating"), 0, 5, errors)
if rec.get("metacritic") is not None:
_check_range(fname, "metacritic", rec.get("metacritic"), 0, 100, errors)

for fname, rec in software:
_check_required(fname, rec, SOFTWARE_REQUIRED, errors)
_check_source_urls(fname, rec, errors)
Expand Down
40 changes: 0 additions & 40 deletions tests/integration/game_fixtures.py

This file was deleted.

Loading
Loading