Prepare CmdForge 0.2.0 for PyPI
This commit is contained in:
+46
-4
@@ -1,5 +1,6 @@
|
||||
"""Tests for packaging metadata."""
|
||||
"""Release metadata checks for the public Python distribution."""
|
||||
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
@@ -9,12 +10,53 @@ if sys.version_info >= (3, 11):
|
||||
else:
|
||||
tomllib = pytest.importorskip("tomli")
|
||||
|
||||
from cmdforge import __version__
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def _project_metadata() -> dict:
|
||||
with (ROOT / "pyproject.toml").open("rb") as handle:
|
||||
return tomllib.load(handle)["project"]
|
||||
|
||||
|
||||
def test_runtime_and_distribution_versions_match():
|
||||
assert _project_metadata()["version"] == __version__
|
||||
|
||||
|
||||
def test_public_distribution_metadata_is_complete():
|
||||
project = _project_metadata()
|
||||
|
||||
assert project["name"] == "cmdforge"
|
||||
assert project["readme"] == "PYPI_README.md"
|
||||
assert project["license"] == "MIT"
|
||||
assert project["license-files"] == ["LICENSE"]
|
||||
assert project["requires-python"] == ">=3.10"
|
||||
assert {"Homepage", "Documentation", "Repository", "Issues", "Changelog"} <= set(
|
||||
project["urls"]
|
||||
)
|
||||
|
||||
|
||||
def test_public_readme_describes_installation_and_current_capabilities():
|
||||
readme = (ROOT / "PYPI_README.md").read_text(encoding="utf-8")
|
||||
|
||||
for term in (
|
||||
'pipx install "cmdforge[mcp,pty]"',
|
||||
"cmdforge providers discover",
|
||||
"cmdforge mcp configure codex",
|
||||
"--no-fallback",
|
||||
"--result-envelope json",
|
||||
):
|
||||
assert term in readme
|
||||
|
||||
assert (ROOT / "LICENSE").is_file()
|
||||
|
||||
|
||||
def test_web_templates_and_static_are_declared_as_package_data():
|
||||
with open("pyproject.toml", "rb") as f:
|
||||
data = tomllib.load(f)
|
||||
with (ROOT / "pyproject.toml").open("rb") as handle:
|
||||
data = tomllib.load(handle)
|
||||
|
||||
package_data = data["tool"]["setuptools"]["package-data"]["cmdforge.web"]
|
||||
|
||||
assert "templates/**/*.html" in package_data
|
||||
assert "static/**/*" in package_data
|
||||
|
||||
Reference in New Issue
Block a user