feat(l4d2): scaffold package and v1 CLI entrypoint

This commit is contained in:
mwiegand 2026-04-23 00:53:19 +02:00
parent bf4d5b4f6d
commit f2ef7e2f24
No known key found for this signature in database
5 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1 @@
# l4d2-host-lib

View file

@ -0,0 +1,23 @@
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "l4d2host"
version = "0.1.0"
description = "L4D2 host library and CLI"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"typer>=0.12",
"PyYAML>=6.0",
]
[project.scripts]
l4d2ctl = "l4d2host.cli:app"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]

View file

@ -0,0 +1,3 @@
__all__ = ["__version__"]
__version__ = "0.1.0"

View file

@ -0,0 +1,38 @@
import typer
app = typer.Typer(no_args_is_help=True)
def _todo() -> None:
raise typer.Exit(code=1)
@app.command()
def install() -> None:
_todo()
@app.command()
def initialize(name: str, spec: str = typer.Option(..., "--spec", "-f")) -> None:
del name
del spec
_todo()
@app.command()
def start(name: str) -> None:
del name
_todo()
@app.command()
def stop(name: str) -> None:
del name
_todo()
@app.command()
def delete(name: str) -> None:
del name
_todo()

View file

@ -0,0 +1,10 @@
from typer.testing import CliRunner
from l4d2host.cli import app
def test_help_lists_v1_commands() -> None:
result = CliRunner().invoke(app, ["--help"])
assert result.exit_code == 0
for command in ["install", "initialize", "start", "stop", "delete"]:
assert command in result.output