mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
feat: add version environment variable (#184)
Include the SDK version in the environment when spawning the Claude CLI process. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
cfdd28a254
commit
233cefa3e1
5 changed files with 27 additions and 22 deletions
|
|
@ -11,7 +11,7 @@ def update_version(new_version: str) -> None:
|
|||
# Update pyproject.toml
|
||||
pyproject_path = Path("pyproject.toml")
|
||||
content = pyproject_path.read_text()
|
||||
|
||||
|
||||
# Only update the version field in [project] section
|
||||
content = re.sub(
|
||||
r'^version = "[^"]*"',
|
||||
|
|
@ -20,14 +20,14 @@ def update_version(new_version: str) -> None:
|
|||
count=1,
|
||||
flags=re.MULTILINE
|
||||
)
|
||||
|
||||
|
||||
pyproject_path.write_text(content)
|
||||
print(f"Updated pyproject.toml to version {new_version}")
|
||||
|
||||
# Update __init__.py
|
||||
init_path = Path("src/claude_code_sdk/__init__.py")
|
||||
content = init_path.read_text()
|
||||
|
||||
|
||||
# Update _version.py
|
||||
version_path = Path("src/claude_code_sdk/_version.py")
|
||||
content = version_path.read_text()
|
||||
|
||||
# Only update __version__ assignment
|
||||
content = re.sub(
|
||||
r'^__version__ = "[^"]*"',
|
||||
|
|
@ -36,9 +36,9 @@ def update_version(new_version: str) -> None:
|
|||
count=1,
|
||||
flags=re.MULTILINE
|
||||
)
|
||||
|
||||
init_path.write_text(content)
|
||||
print(f"Updated __init__.py to version {new_version}")
|
||||
|
||||
version_path.write_text(content)
|
||||
print(f"Updated _version.py to version {new_version}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue