-
Notifications
You must be signed in to change notification settings - Fork 0
COE-231: Bootstrap repository, tooling, and package skeleton #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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 | ||
|
|
||
| lint: ## Run linting with ruff | ||
| uv run ruff check src tests | ||
|
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I checked 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 | ||
| 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" | ||
kumanday marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [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:", | ||
| ] | ||
| 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" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """StackPerf module.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """StackPerf module.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """StackPerf module.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """StackPerf module.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """StackPerf module.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """StackPerf test suite.""" |
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked
uv sync --helpanduv run --help:--locked/--frozenare the switches that stopuv.lockfrom being updated. Because these bootstrap commands use plainuv syncand the quality targets use plainuv run, runningmake 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 committinguv.lockand can leave read-only commands with a dirty worktree.Useful? React with 👍 / 👎.