Skip to content

Commit 6346c74

Browse files
Merge pull request #1536 from codeflash-ai/cf-release-benchmark-0.2.0
chore: bump codeflash-benchmark version to 0.3.0
2 parents 465316a + 67c12bc commit 6346c74

4 files changed

Lines changed: 23 additions & 19 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77
paths:
88
- 'codeflash/version.py'
9-
- 'codeflash-benchmark/codeflash_benchmark/__init__.py'
9+
- 'codeflash-benchmark/codeflash_benchmark/version.py'
1010

1111
jobs:
1212
detect-changes:
@@ -28,7 +28,7 @@ jobs:
2828
else
2929
echo "codeflash=false" >> $GITHUB_OUTPUT
3030
fi
31-
if git diff --name-only HEAD~1 HEAD | grep -q '^codeflash-benchmark/codeflash_benchmark/__init__.py$'; then
31+
if git diff --name-only HEAD~1 HEAD | grep -q '^codeflash-benchmark/codeflash_benchmark/version.py$'; then
3232
echo "benchmark=true" >> $GITHUB_OUTPUT
3333
else
3434
echo "benchmark=false" >> $GITHUB_OUTPUT
@@ -121,23 +121,14 @@ jobs:
121121
with:
122122
fetch-depth: 0
123123

124-
- name: Extract version from __init__.py
124+
- name: Extract version from version.py
125125
id: extract_version
126126
run: |
127-
VERSION=$(grep -oP '__version__ = "\K[^"]+' codeflash-benchmark/codeflash_benchmark/__init__.py)
127+
VERSION=$(grep -oP '__version__ = "\K[^"]+' codeflash-benchmark/codeflash_benchmark/version.py)
128128
echo "version=$VERSION" >> $GITHUB_OUTPUT
129129
echo "tag=benchmark-v$VERSION" >> $GITHUB_OUTPUT
130130
echo "Extracted version: $VERSION"
131131
132-
- name: Verify version matches pyproject.toml
133-
run: |
134-
INIT_VERSION=${{ steps.extract_version.outputs.version }}
135-
TOML_VERSION=$(grep -oP '^version = "\K[^"]+' codeflash-benchmark/pyproject.toml)
136-
if [ "$INIT_VERSION" != "$TOML_VERSION" ]; then
137-
echo "::error::Version mismatch: __init__.py=$INIT_VERSION, pyproject.toml=$TOML_VERSION"
138-
exit 1
139-
fi
140-
141132
- name: Check if tag already exists
142133
id: check_tag
143134
run: |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""CodeFlash Benchmark - Pytest benchmarking plugin for codeflash.ai."""
22

3-
__version__ = "0.2.0"
3+
from codeflash_benchmark.version import __version__ as __version__
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These version placeholders will be replaced by uv-dynamic-versioning during build.
2+
__version__ = "0.3.0"

codeflash-benchmark/pyproject.toml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "codeflash-benchmark"
3-
version = "0.3.0"
3+
dynamic = ["version"]
44
description = "Pytest benchmarking plugin for codeflash.ai - automatic code performance optimization"
55
authors = [{ name = "CodeFlash Inc.", email = "contact@codeflash.ai" }]
66
requires-python = ">=3.9"
@@ -25,8 +25,19 @@ Repository = "https://github.com/codeflash-ai/codeflash-benchmark"
2525
codeflash-benchmark = "codeflash_benchmark.plugin"
2626

2727
[build-system]
28-
requires = ["setuptools>=45", "wheel"]
29-
build-backend = "setuptools.build_meta"
28+
requires = ["hatchling", "uv-dynamic-versioning"]
29+
build-backend = "hatchling.build"
3030

31-
[tool.setuptools]
32-
packages = ["codeflash_benchmark"]
31+
[tool.hatch.version]
32+
source = "uv-dynamic-versioning"
33+
34+
[tool.uv-dynamic-versioning]
35+
enable = true
36+
style = "pep440"
37+
vcs = "git"
38+
39+
[tool.hatch.build.hooks.version]
40+
path = "codeflash_benchmark/version.py"
41+
template = """# These version placeholders will be replaced by uv-dynamic-versioning during build.
42+
__version__ = "{version}"
43+
"""

0 commit comments

Comments
 (0)