Skip to content
Open
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
61 changes: 60 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,60 @@
old
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
.venv/
venv/
ENV/
env/

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.nox/

# Type checking
.mypy_cache/
.dmypy.json
dmypy.json

# Linting
.ruff_cache/

# IDEs
.idea/
.vscode/
*.swp
*.swo
*~

# Environment variables
.env
.env.local
.env.*.local

# uv

# OS
.DS_Store
Thumbs.db
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# StackPerf Developer Commands
# Run with: make <target>

.PHONY: help install sync lint format type-check test test-cov clean quality

help: ## Show this help message
@echo "StackPerf - Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'

install: ## Install dependencies with uv
uv sync --all-extras

sync: ## Sync dependencies with uv (includes dev extras)
uv sync --all-extras
Comment on lines +10 to +14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Freeze the lockfile in the bootstrap targets

I checked uv sync --help and uv run --help: --locked/--frozen are the switches that stop uv.lock from being updated. Because these bootstrap commands use plain uv sync and the quality targets use plain uv run, running make install, make sync, or a quality gate after a dependency edit can silently re-resolve and rewrite the checked-in lockfile instead of failing fast. That undermines the reproducibility goal of committing uv.lock and can leave read-only commands with a dirty worktree.

Useful? React with 👍 / 👎.


lint: ## Run linting with ruff
uv run ruff check src tests
Comment on lines +16 to +17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass dev extras to the uv run quality targets

I checked uv run --help: optional dependencies are only included when --extra or --all-extras is passed. Here ruff, mypy, pytest, and pytest-cov are declared only under [project.optional-dependencies].dev in pyproject.toml, so make lint, make type-check, make test, and make test-cov are not self-contained on a fresh checkout unless the operator happened to run make sync first. In that state these targets will either fail or pick up unrelated global binaries instead of the locked toolchain.

Useful? React with 👍 / 👎.


format: ## Format code with ruff
uv run ruff format src tests
uv run ruff check --fix src tests

type-check: ## Run static type checking with mypy
uv run mypy src

test: ## Run tests with pytest
uv run pytest

test-cov: ## Run tests with coverage report
uv run pytest --cov=src --cov-report=term-missing

clean: ## Clean build artifacts and cache
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
rm -rf .coverage htmlcov dist build 2>/dev/null || true
@echo "Cleaned build artifacts and caches"

quality: ## Run all quality checks (lint, type-check, test)
$(MAKE) lint
$(MAKE) type-check
$(MAKE) test
94 changes: 94 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
[project]
name = "stackperf"
version = "0.1.0"
description = "LiteLLM benchmarking system for provider, model, and harness comparison"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "Proprietary" }
authors = [{ name = "Trilogy AI COE" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

dependencies = []

[project.optional-dependencies]
dev = [
"ruff>=0.4.0",
"mypy>=1.10.0",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"hatchling>=1.0.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/stackperf"]

[tool.ruff]
target-version = "py311"
line-length = 88
src = ["src", "tests"]

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
]

[tool.ruff.lint.isort]
known-first-party = ["stackperf"]

[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
follow_imports = "silent"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"

[tool.coverage.run]
source = ["src"]
omit = ["tests/*"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
3 changes: 3 additions & 0 deletions src/stackperf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""StackPerf - LiteLLM benchmarking system for provider, model, and harness comparison."""

__version__ = "0.1.0"
1 change: 1 addition & 0 deletions src/stackperf/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""StackPerf module."""
1 change: 1 addition & 0 deletions src/stackperf/benchmark_core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""StackPerf module."""
1 change: 1 addition & 0 deletions src/stackperf/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""StackPerf module."""
1 change: 1 addition & 0 deletions src/stackperf/collectors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""StackPerf module."""
1 change: 1 addition & 0 deletions src/stackperf/reporting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""StackPerf module."""
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""StackPerf test suite."""
44 changes: 44 additions & 0 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""Import smoke tests for each top-level package."""



def test_import_stackperf() -> None:
"""Test that the main package can be imported."""
import stackperf

assert stackperf.__version__ == "0.1.0"


def test_import_benchmark_core() -> None:
"""Test that benchmark_core module can be imported."""
from stackperf import benchmark_core

assert benchmark_core is not None


def test_import_cli() -> None:
"""Test that cli module can be imported."""
from stackperf import cli

assert cli is not None


def test_import_collectors() -> None:
"""Test that collectors module can be imported."""
from stackperf import collectors

assert collectors is not None


def test_import_reporting() -> None:
"""Test that reporting module can be imported."""
from stackperf import reporting

assert reporting is not None


def test_import_api() -> None:
"""Test that api module can be imported."""
from stackperf import api

assert api is not None
Loading