Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: astral-sh/setup-uv@v7
with:
Expand All @@ -46,6 +48,8 @@ jobs:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- uses: astral-sh/setup-uv@v7
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-evaluator-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v6
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.tag || github.ref_name }}
fetch-depth: 0

- uses: astral-sh/setup-uv@v7
with:
Expand All @@ -31,9 +32,6 @@ jobs:
cache: npm
cache-dependency-path: ui/package-lock.json

- name: Set version from tag
run: uv version "${{ github.event.inputs.tag || github.ref_name }}" --package agentevals-cli

- name: Build core and bundled wheels
run: make release

Expand All @@ -51,6 +49,7 @@ jobs:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.tag || github.ref_name }}
fetch-depth: 0

- uses: astral-sh/setup-uv@v7
with:
Expand All @@ -65,11 +64,8 @@ jobs:
# Same bundle as `make release` / `build-bundle`: wheel must include ui/dist in src/agentevals/_static
# (see [tool.hatch.build] artifacts in pyproject.toml).
- name: Release Python package (wheel + sdist with bundled UI)
env:
VERSION: ${{ github.event.inputs.tag || github.ref_name }}
run: |
uv sync --package agentevals-cli --all-extras
uv version "$VERSION" --package agentevals-cli

make build-ui
rm -rf src/agentevals/_static
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION := $(shell grep '^version' pyproject.toml | cut -d'"' -f2)
VERSION := $(shell uv run --with hatch hatch version 2>/dev/null)
WHEEL := dist/agentevals_cli-$(VERSION)-py3-none-any.whl

DOCKER_REGISTRY ?= soloio
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "agentevals-cli"
version = "0.7.1"
dynamic = ["version"]
description = "Standalone framework to evaluate agent correctness based on portable OpenTelemetry traces"
Comment thread
krisztianfekete marked this conversation as resolved.
readme = "README.md"
requires-python = ">=3.11"
Expand Down Expand Up @@ -40,6 +40,9 @@ postgres = [
[project.scripts]
agentevals = "agentevals.cli:main"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build]
artifacts = ["src/agentevals/_static/**"]

Expand Down
2 changes: 1 addition & 1 deletion src/agentevals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("agentevals")
__version__ = version("agentevals-cli")
except PackageNotFoundError:
__version__ = "0.0.0-dev"

Expand Down
18 changes: 18 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pytest
from click.testing import CliRunner

import agentevals
from agentevals import cli
from agentevals.runner import RunResult

Expand Down Expand Up @@ -163,3 +164,20 @@ async def fake_run_evaluation(config):
"custom_eval",
"response_match_score",
]


def test_version_resolves_from_installed_distribution():
assert agentevals.__version__ != "0.0.0-dev", (
"agentevals.__version__ fell back to the dev sentinel. Likely causes: "
"(1) the dist name in pyproject.toml diverged from the lookup string "
"in src/agentevals/__init__.py, or (2) hatch-vcs cannot resolve a "
"version (missing git tags in the build environment?)."
)


def test_cli_version_flag_prints_real_version():
result = CliRunner().invoke(cli.main, ["--version"])

assert result.exit_code == 0, result.output
assert "0.0.0-dev" not in result.output, f"`agentevals --version` printed the dev sentinel: {result.output!r}"
assert agentevals.__version__ in result.output
2 changes: 1 addition & 1 deletion ui/src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const Sidebar: React.FC = () => {
}}
/>
{state.version && (
<span>v{state.version}</span>
<span style={{ fontSize: '0.5rem' }}>v{state.version}</span>
Comment thread
krisztianfekete marked this conversation as resolved.
)}
</div>
</nav>
Expand Down
3 changes: 1 addition & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.