Skip to content

Commit cc14242

Browse files
fix version bugs
1 parent 9c39e64 commit cc14242

8 files changed

Lines changed: 34 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v6
25+
with:
26+
fetch-depth: 0
2527

2628
- uses: astral-sh/setup-uv@v7
2729
with:
@@ -46,6 +48,8 @@ jobs:
4648
python-version: ["3.11", "3.12", "3.13"]
4749
steps:
4850
- uses: actions/checkout@v6
51+
with:
52+
fetch-depth: 0
4953

5054
- uses: astral-sh/setup-uv@v7
5155
with:

.github/workflows/publish-evaluator-sdk.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- name: 'Checkout GitHub Action'
2121
uses: actions/checkout@main
22+
with:
23+
fetch-depth: 0
2224

2325
- name: Install uv
2426
uses: astral-sh/setup-uv@v6

.github/workflows/release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- uses: actions/checkout@v6
2121
with:
2222
ref: ${{ github.event.inputs.tag || github.ref_name }}
23+
fetch-depth: 0
2324

2425
- uses: astral-sh/setup-uv@v7
2526
with:
@@ -31,9 +32,6 @@ jobs:
3132
cache: npm
3233
cache-dependency-path: ui/package-lock.json
3334

34-
- name: Set version from tag
35-
run: uv version "${{ github.event.inputs.tag || github.ref_name }}" --package agentevals-cli
36-
3735
- name: Build core and bundled wheels
3836
run: make release
3937

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

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

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["hatchling"]
2+
requires = ["hatchling", "hatch-vcs"]
33
build-backend = "hatchling.build"
44

55
[project]
66
name = "agentevals-cli"
7-
version = "0.7.1"
7+
dynamic = ["version"]
88
description = "Standalone framework to evaluate agent correctness based on portable OpenTelemetry traces"
99
readme = "README.md"
1010
requires-python = ">=3.11"
@@ -40,6 +40,9 @@ postgres = [
4040
[project.scripts]
4141
agentevals = "agentevals.cli:main"
4242

43+
[tool.hatch.version]
44+
source = "vcs"
45+
4346
[tool.hatch.build]
4447
artifacts = ["src/agentevals/_static/**"]
4548

src/agentevals/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from importlib.metadata import PackageNotFoundError, version
44

55
try:
6-
__version__ = version("agentevals")
6+
__version__ = version("agentevals-cli")
77
except PackageNotFoundError:
88
__version__ = "0.0.0-dev"
99

tests/test_cli.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pytest
1111
from click.testing import CliRunner
1212

13+
import agentevals
1314
from agentevals import cli
1415
from agentevals.runner import RunResult
1516

@@ -163,3 +164,20 @@ async def fake_run_evaluation(config):
163164
"custom_eval",
164165
"response_match_score",
165166
]
167+
168+
169+
def test_version_resolves_from_installed_distribution():
170+
assert agentevals.__version__ != "0.0.0-dev", (
171+
"agentevals.__version__ fell back to the dev sentinel. Likely causes: "
172+
"(1) the dist name in pyproject.toml diverged from the lookup string "
173+
"in src/agentevals/__init__.py, or (2) hatch-vcs cannot resolve a "
174+
"version (missing git tags in the build environment?)."
175+
)
176+
177+
178+
def test_cli_version_flag_prints_real_version():
179+
result = CliRunner().invoke(cli.main, ["--version"])
180+
181+
assert result.exit_code == 0, result.output
182+
assert "0.0.0-dev" not in result.output, f"`agentevals --version` printed the dev sentinel: {result.output!r}"
183+
assert agentevals.__version__ in result.output

ui/src/components/sidebar/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const Sidebar: React.FC = () => {
110110
}}
111111
/>
112112
{state.version && (
113-
<span>v{state.version}</span>
113+
<span style={{ fontSize: '0.5rem' }}>v{state.version}</span>
114114
)}
115115
</div>
116116
</nav>

uv.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)