Skip to content

Commit 255f950

Browse files
authored
chore: release v0.1.2 and fix bump script (#50)
* chore: release v0.1.2 and fix bump script - Bump version from 0.1.1 to 0.1.2 - Fix regex group reference error in bump_version.py - Remove concurrency checks and simplify thread pool handling (#46) * fix formatting error * fix formatting error
1 parent 574e456 commit 255f950

File tree

4 files changed

+45
-68
lines changed

4 files changed

+45
-68
lines changed

CHANGELOG.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.1.0] - 2025-07-16
10+
## [0.1.2] - 2025-08-11
1111

12-
### Added
13-
- Initial release of Bedrock AgentCore Python SDK
14-
- Runtime framework for building AI agents
15-
- Memory client for conversation management
16-
- Authentication decorators for OAuth2 and API keys
17-
- Browser and Code Interpreter tool integrations
18-
- Comprehensive documentation and examples
19-
20-
### Security
21-
- TLS 1.2+ enforcement for all communications
22-
- AWS SigV4 signing for API authentication
23-
- Secure credential handling via AWS credential chain
12+
### Fixed
13+
- Remove concurrency checks and simplify thread pool handling (#46)
2414

2515
## [0.1.1] - 2025-07-23
2616

@@ -45,3 +35,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4535
- Handles datetime, Decimal, sets, and Unicode characters consistently
4636
- Ensures both streaming (SSE) and regular responses use identical serialization logic
4737
- Improved error handling for non-serializable objects
38+
39+
## [0.1.0] - 2025-07-16
40+
41+
### Added
42+
- Initial release of Bedrock AgentCore Python SDK
43+
- Runtime framework for building AI agents
44+
- Memory client for conversation management
45+
- Authentication decorators for OAuth2 and API keys
46+
- Browser and Code Interpreter tool integrations
47+
- Comprehensive documentation and examples
48+
49+
### Security
50+
- TLS 1.2+ enforcement for all communications
51+
- AWS SigV4 signing for API authentication
52+
- Secure credential handling via AWS credential chain

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "bedrock-agentcore"
7-
version = "0.1.1"
7+
version = "0.1.2"
88
description = "An SDK for using Bedrock AgentCore"
99
readme = "README.md"
1010
requires-python = ">=3.10"

scripts/bump_version.py

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
def get_current_version() -> str:
1010
"""Get current version from pyproject.toml."""
1111
content = Path("pyproject.toml").read_text()
12-
# More robust regex that matches the project version specifically
13-
# Look for version under [project] or [tool.poetry] sections
1412
pattern = r'(?:^\[project\]|\[tool\.poetry\])[\s\S]*?^version\s*=\s*"([^"]+)"'
1513
match = re.search(pattern, content, re.MULTILINE)
1614
if not match:
@@ -20,7 +18,6 @@ def get_current_version() -> str:
2018

2119
def parse_version(version: str) -> Tuple[int, int, int, Optional[str]]:
2220
"""Parse semantic version string."""
23-
# Handle versions with pre-release tags
2421
match = re.match(r"(\d+)\.(\d+)\.(\d+)(?:-(.+))?", version)
2522
if not match:
2623
raise ValueError(f"Invalid version format: {version}")
@@ -42,7 +39,6 @@ def bump_version(current: str, bump_type: str) -> str:
4239
return f"{major}.{minor}.{patch + 1}"
4340
elif bump_type == "pre":
4441
if pre_release:
45-
# Increment pre-release number
4642
match = re.match(r"(.+?)(\d+)$", pre_release)
4743
if match:
4844
prefix, num = match.groups()
@@ -53,19 +49,19 @@ def bump_version(current: str, bump_type: str) -> str:
5349

5450

5551
def update_version_in_file(file_path: Path, old_version: str, new_version: str) -> bool:
56-
"""Update version in a file.
57-
58-
Note: Currently only bedrock_agentcore/__init__.py contains version.
59-
This function is kept for potential future use.
60-
"""
52+
"""Update version in a file."""
6153
if not file_path.exists():
6254
return False
6355

6456
content = file_path.read_text()
6557

66-
# Only update __version__ assignments, not imports or other references
58+
# Fix: Use re.sub with a function to avoid group reference issues
6759
pattern = rf'^(__version__\s*=\s*["\'])({re.escape(old_version)})(["\'])'
68-
new_content = re.sub(pattern, rf"\1{new_version}\3", content, flags=re.MULTILINE)
60+
61+
def replacer(match):
62+
return f"{match.group(1)}{new_version}{match.group(3)}"
63+
64+
new_content = re.sub(pattern, replacer, content, flags=re.MULTILINE)
6965

7066
if new_content != content:
7167
file_path.write_text(new_content)
@@ -75,51 +71,32 @@ def update_version_in_file(file_path: Path, old_version: str, new_version: str)
7571

7672
def update_all_versions(old_version: str, new_version: str):
7773
"""Update version in all relevant files."""
78-
# Update pyproject.toml - be specific about which version field
74+
# Update pyproject.toml - use simple string replacement to avoid regex issues
7975
pyproject = Path("pyproject.toml")
8076
content = pyproject.read_text()
8177

82-
# Only update the version in [project] or [tool.poetry] section
83-
# This prevents accidentally updating version constraints in dependencies
84-
lines = content.split("\n")
85-
in_project_section = False
86-
updated_lines = []
87-
version_updated = False
88-
89-
for line in lines:
90-
if line.strip() == "[project]" or line.strip() == "[tool.poetry]":
91-
in_project_section = True
92-
elif line.strip().startswith("[") and line.strip() != "[project]":
93-
in_project_section = False
94-
95-
if in_project_section and line.strip().startswith("version = "):
96-
updated_lines.append(f'version = "{new_version}"')
97-
version_updated = True
98-
else:
99-
updated_lines.append(line)
78+
# Simple string replacement instead of regex
79+
old_version_line = f'version = "{old_version}"'
80+
new_version_line = f'version = "{new_version}"'
10081

101-
if not version_updated:
102-
raise ValueError("Failed to update version in pyproject.toml")
103-
104-
pyproject.write_text("\n".join(updated_lines))
105-
print("✓ Updated pyproject.toml")
82+
if old_version_line in content:
83+
content = content.replace(old_version_line, new_version_line, 1)
84+
pyproject.write_text(content)
85+
print("✓ Updated pyproject.toml")
86+
else:
87+
raise ValueError(f'Could not find version = "{old_version}" in pyproject.toml')
10688

10789
# Update __init__.py files that contain version
108-
# Currently only bedrock_agentcore/__init__.py has __version__
10990
init_file = Path("src/bedrock_agentcore/__init__.py")
11091
if init_file.exists() and update_version_in_file(init_file, old_version, new_version):
11192
print(f"✓ Updated {init_file}")
11293

11394

11495
def format_git_log(git_log: str) -> str:
115-
"""Format git log entries for changelog.
116-
117-
Groups commits by type and formats them nicely.
118-
"""
96+
"""Format git log entries for changelog."""
11997
if not git_log.strip():
12098
return ""
12199

122-
# Parse commit messages
123100
fixes = []
124101
features = []
125102
docs = []
@@ -130,10 +107,8 @@ def format_git_log(git_log: str) -> str:
130107
if not line or not line.startswith("-"):
131108
continue
132109

133-
# Remove the leading "- " and extract commit message
134110
commit_msg = line[2:].strip()
135111

136-
# Categorize by conventional commit type
137112
if commit_msg.startswith("fix:") or commit_msg.startswith("bugfix:"):
138113
fixes.append(commit_msg)
139114
elif commit_msg.startswith("feat:") or commit_msg.startswith("feature:"):
@@ -143,7 +118,6 @@ def format_git_log(git_log: str) -> str:
143118
else:
144119
other.append(commit_msg)
145120

146-
# Build formatted output
147121
sections = []
148122

149123
if features:
@@ -167,14 +141,12 @@ def get_git_log(since_tag: Optional[str] = None) -> str:
167141
if since_tag:
168142
cmd.append(f"{since_tag}..HEAD")
169143
else:
170-
# Get commits since last tag
171144
try:
172145
last_tag = subprocess.run(
173146
["git", "describe", "--tags", "--abbrev=0"], capture_output=True, text=True, check=True
174147
).stdout.strip()
175148
cmd.append(f"{last_tag}..HEAD")
176149
except subprocess.CalledProcessError:
177-
# No tags, get last 20 commits
178150
cmd.extend(["-n", "20"])
179151

180152
result = subprocess.run(cmd, capture_output=True, text=True)
@@ -194,20 +166,20 @@ def update_changelog(new_version: str, changes: str = None):
194166
entry = f"\n## [{new_version}] - {date}\n\n"
195167

196168
if changes:
197-
# Use provided changelog
198169
entry += "### Changes\n\n"
199170
entry += changes + "\n"
200171
else:
201-
# Warn about auto-generation
202172
print("\n⚠️ No changelog provided. Auto-generating from commits.")
203173
print("💡 Tip: Use --changelog to provide meaningful release notes")
204-
print(' Example: --changelog "Added new CLI commands for gateway management"')
205174

206175
git_log = get_git_log()
207176
if git_log:
208-
entry += "### Changes (auto-generated from commits)\n\n"
209-
entry += git_log + "\n"
210-
entry += "\n*Note: Consider providing a custom changelog for better release notes*\n"
177+
formatted_log = format_git_log(git_log)
178+
if formatted_log:
179+
entry += formatted_log + "\n"
180+
else:
181+
entry += "### Changes\n\n"
182+
entry += git_log + "\n"
211183

212184
# Insert after header
213185
if "# Changelog" in content:

uv.lock

Lines changed: 2 additions & 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)