Update version in pyproject.toml.
(new_version)
| 39 | |
| 40 | |
| 41 | def update_version(new_version): |
| 42 | """Update version in pyproject.toml.""" |
| 43 | pyproject_path = Path(__file__).parent.parent / "pyproject.toml" |
| 44 | content = pyproject_path.read_text() |
| 45 | |
| 46 | # Update version |
| 47 | new_content = re.sub( |
| 48 | r'version = "\d+\.\d+\.\d+"', f'version = "{new_version}"', content |
| 49 | ) |
| 50 | |
| 51 | pyproject_path.write_text(new_content) |
| 52 | |
| 53 | # run uv sync |
| 54 | subprocess.run(["uv", "sync"]) |
| 55 | |
| 56 | |
| 57 | def main(): |