Skip to content

Commit 788cb2f

Browse files
authored
Introduce validating version field against git tag (#779)
1 parent 61c92d5 commit 788cb2f

3 files changed

Lines changed: 293 additions & 243 deletions

File tree

.github/workflows/cd.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ jobs:
2525
python-version: 3.13
2626
deps-group: release
2727
- name: Set pre-release version
28-
id: set-version
2928
if: startsWith(github.ref, 'refs/tags/') != true
3029
run: |
3130
VERSION_BASE="$(uv version --short)"
3231
RUN_NUMBER="${{ github.run_number }}"
33-
uv version --frozen "${VERSION_BASE}.dev${RUN_NUMBER}"
32+
uv version "${VERSION_BASE}.dev${RUN_NUMBER}"
33+
- name: Set release version
34+
if: startsWith(github.ref, 'refs/tags/') == true
35+
run: |
36+
VERSION_TAG="${{ github.event.release.tag_name }}"
37+
[[ $VERSION_TAG != $(uv version --short) ]] && {
38+
printf "Git tag should be identical to version field in pyproject.toml"
39+
exit 1
40+
}
41+
uv version "$(VERSION_TAG)"
3442
- name: Get current version
3543
id: get-version
3644
run: echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT"

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ dependencies = []
3333
# Treat the same as NPM's `dependencies`
3434
[project.optional-dependencies]
3535
compat = ["six>=1.17.0"]
36-
ai = ["httpx==0.28.1", "langchain>=1.2.16", "mcp>=1.27.0", "pydantic>=2.13.4"]
36+
ai = ["httpx==0.28.1", "langchain>=1.2.18", "mcp>=1.27.1", "pydantic>=2.13.4"]
3737
anthropic = ["splunk-sdk[ai]>=2.1.1", "langchain-anthropic>=1.4.3"]
3838
openai = ["splunk-sdk[ai]>=2.1.1", "langchain-openai>=1.2.1"]
3939
google = [
4040
"splunk-sdk[ai]>=2.1.1",
4141
"langchain-google-genai==4.2.2",
42-
"google-auth>=2.51.0",
42+
"google-auth>=2.52.0",
4343
]
4444

4545
# Treat the same as NPM's `devDependencies`
@@ -53,7 +53,7 @@ test = [
5353
"vcrpy>=8.1.1",
5454
]
5555
release = ["build>=1.5.0", "jinja2>=3.1.6", "sphinx>=9.1.0", "twine>=6.2.0"]
56-
lint = ["basedpyright>=1.39.3", "ruff>=0.15.12", "mbake>=1.4.6"]
56+
lint = ["basedpyright>=1.39.4", "ruff>=0.15.12", "mbake>=1.4.6"]
5757
dev = [
5858
"rich>=15.0.0",
5959
{ include-group = "test" },

0 commit comments

Comments
 (0)