mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 04:15:11 +00:00
Add commit and tag in bump_version script, add developer instructions
This commit is contained in:
1 parent
2aa8cf4cae
commit
527abc2ed0
3 files changed
+29
-1
No files matched your search
+1
-1
@@ -22,7 +22,7 @@ See the corresponding [memory](.serena/memories/adding_new_language_support_guid
|
||||
|
||||
You can install a virtual environment with the required as follows
|
||||
|
||||
1. Create a new virtual environment: `uv venv`
|
||||
1. Create a new virtual environment: `uv venv -p 3.13`
|
||||
2. Activate the environment:
|
||||
* On Linux/Unix/macOS or Windows with Git Bash: `source .venv/bin/activate`
|
||||
* On Windows outside of Git Bash: `.venv\Scripts\activate.bat` (in cmd/ps) or `source .venv/Scripts/activate` (in git-bash)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# Developer Instructions
|
||||
|
||||
## Python Environment & Development Tools
|
||||
|
||||
See [the contributing guide](CONTRIBUTING.md) for instructions on setting up your development environment
|
||||
and tools for formatting and type checking.
|
||||
|
||||
## Release Process
|
||||
|
||||
1. Ensure clean git status
|
||||
2. Set version for release, e.g.
|
||||
|
||||
python scripts/bump_version.py --patch
|
||||
python scripts/bump_version.py --minor
|
||||
|
||||
This also creates the git tag.
|
||||
3. Push to GitHub, triggering the release process.
|
||||
|
||||
git push --tags
|
||||
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Literal
|
||||
@@ -8,6 +9,7 @@ from typing import Literal
|
||||
import click
|
||||
|
||||
from serena.constants import REPO_ROOT
|
||||
from serena.util.git import get_git_status
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -27,6 +29,10 @@ _UNRELEASED_HEADER = "# Unreleased (main)\n"
|
||||
@click.option("--version", "-v", "target_version", metavar="X.Y.Z", help="Set an explicit version instead of bumping.")
|
||||
@click.option("--dry-run", is_flag=True, help="Show what would change without writing any files.")
|
||||
def bump_version(major: bool, minor: bool, patch: bool, target_version: str | None, dry_run: bool) -> None:
|
||||
git_status = get_git_status()
|
||||
if not git_status.is_clean:
|
||||
raise click.ClickException("Working directory is not clean. Please commit or stash your changes first.")
|
||||
|
||||
log.info("bump_version called: major=%s, minor=%s, patch=%s, target_version=%s", major, minor, patch, target_version)
|
||||
version_part = resolve_version_selection(major=major, minor=minor, patch=patch, target_version=target_version)
|
||||
log.info("Resolved version_part=%s", version_part)
|
||||
@@ -39,6 +45,9 @@ def bump_version(major: bool, minor: bool, patch: bool, target_version: str | No
|
||||
click.echo(f"Dry run complete. Version would be bumped to {new_version}")
|
||||
else:
|
||||
click.echo(f"Bumped version to {new_version}")
|
||||
os.system("git add -u")
|
||||
os.system(f'git commit -m "Release v{new_version}"')
|
||||
os.system(f"git tag v{new_version}")
|
||||
|
||||
|
||||
def find_repo_root() -> Path:
|
||||
|
||||
Reference in new issue
Block a user