Skip to content

feat: runtime-requirements map (Python/Node floors, services, GPU, OS, Docker) - #5

Merged
he-yufeng merged 1 commit into
mainfrom
feat/run-requirements
Oct 22, 2026
Merged

he-yufeng merged 1 commit into
mainfrom
feat/run-requirements

Conversation

@he-yufeng

Copy link
Copy Markdown
Owner

What

Adds a new deterministic map to the project overview: what kind of machine and services this project needs to run. It answers the question a non-programmer asks before installing anything — how new your Python/Node must be, whether a database or other background service has to be running, whether an NVIDIA GPU is expected, whether the OS matters, and whether a Dockerfile offers the easy way out.

How it works

  • backend/services/runreqs.py: a pure scanner over the already-loaded file contents.
    • Version floors: requires-python (pyproject [project]), python_requires (setup.cfg/setup.py), Pipfile [requires], runtime.txt, .python-version; engines.node in package.json, .nvmrc / .node-version.
    • Services: PostgreSQL / MySQL / Redis / MongoDB / Elasticsearch / Kafka / RabbitMQ, detected from manifest package names and from actual imports in scanned Python/JS source. Manifest-only hits are marked optional ("only some features"); an import in source makes it required.
    • GPU: GPU-shaped dependencies (torch/tensorflow/jax/vllm/…), .cu sources, or explicit "cuda" device strings.
    • OS: a small honest signal set (winreg/pywin32 → Windows-only, pyobjc → macOS-only, fcntl/termios/pwd/grp → POSIX-only).
    • Container: Dockerfile / compose file presence, presented as the escape hatch.
  • Wired into _content_analyses as ProjectMeta.run_requirements, a new card on the overview page ("跑起来需要什么环境 / What it needs to run"), types in api.ts.
  • README EN+CN feature sections (CN also backfills the missing folder-comparison section).

Tests

  • tests/test_runreqs.py: 18 unit tests (floors from each manifest shape, manifest-only vs imported services, GPU via dep/.cu/device-string, OS signals, container, ordering, empty project).
  • Full suite: 807 passed. ruff check . clean, ruff format applied to the new files. Frontend npm run build clean.

@he-yufeng
he-yufeng merged commit 3513212 into main Oct 22, 2026
7 checks passed
@he-yufeng
he-yufeng deleted the feat/run-requirements branch October 22, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant