Skip to content

Commit fd9d3da

Browse files
committed
feat: get version from tag
1 parent 8a2b7b8 commit fd9d3da

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.github/workflows/pypi-publish-on-release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ jobs:
2525
python -m pip install --upgrade pip
2626
pip install hatch twine
2727
28+
- name: Validate version
29+
run: |
30+
version=$(hatch version)
31+
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
32+
echo "Valid version format"
33+
exit 0
34+
else
35+
echo "Invalid version format"
36+
exit 1
37+
fi
38+
2839
- name: Build
2940
run: |
3041
hatch build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ __pycache__*
77
.pytest_cache
88
.ruff_cache
99
*.bak
10-
.vscode
10+
.vscode
11+
dist

pyproject.toml

Lines changed: 6 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 = "strands-agents"
7-
version = "0.1.5"
7+
dynamic = ["version"]
88
description = "A model-driven approach to building AI agents in just a few lines of code"
99
readme = "README.md"
1010
requires-python = ">=3.10"
@@ -79,6 +79,10 @@ openai = [
7979
"openai>=1.68.0,<2.0.0",
8080
]
8181

82+
[tool.hatch.version]
83+
# Tells Hatch to use your version control system (git) to determine the version.
84+
source = "vcs"
85+
8286
[tool.hatch.envs.hatch-static-analysis]
8387
features = ["anthropic", "litellm", "llamaapi", "ollama", "openai"]
8488
dependencies = [

0 commit comments

Comments
 (0)