Add --revision flag for package version bumps
Usage: uv run poe generate 4.5 --revision 1 Produces version 4.5.8.1 instead of 4.5.8.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a25340f7cf
commit
9e69eada48
20
main.py
20
main.py
@ -295,9 +295,10 @@ def generate_package_files(
|
||||
major_minor: str,
|
||||
top_level_packages: list[str],
|
||||
python_version: str,
|
||||
revision: int = 0,
|
||||
) -> None:
|
||||
"""Generate pyproject.toml and README.md for the publishable package."""
|
||||
package_version = f"{full_version}.0"
|
||||
package_version = f"{full_version}.{revision}"
|
||||
|
||||
pyproject = build_generated_pyproject(
|
||||
major_minor, package_version, top_level_packages, python_version
|
||||
@ -317,7 +318,7 @@ def generate_package_files(
|
||||
(output_dir / pkg / "py.typed").touch()
|
||||
|
||||
|
||||
def generate_for_version(blender_path: str) -> None:
|
||||
def generate_for_version(blender_path: str, revision: int = 0) -> None:
|
||||
"""Generate stubs for a single Blender executable."""
|
||||
full_version, major_minor = get_blender_version(blender_path)
|
||||
python_version = get_blender_python_version(blender_path)
|
||||
@ -344,7 +345,12 @@ def generate_for_version(blender_path: str) -> None:
|
||||
|
||||
print(" Generating package files...")
|
||||
generate_package_files(
|
||||
output_dir, full_version, major_minor, top_level_packages, python_version
|
||||
output_dir,
|
||||
full_version,
|
||||
major_minor,
|
||||
top_level_packages,
|
||||
python_version,
|
||||
revision,
|
||||
)
|
||||
|
||||
# Store the Python version for later type checking
|
||||
@ -502,6 +508,12 @@ if __name__ == "__main__":
|
||||
action="store_true",
|
||||
help="Run conformance tests against generated stubs",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--revision",
|
||||
type=int,
|
||||
default=0,
|
||||
help="Package revision number (default: 0, e.g. 4.5.8.1 for revision 1)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"versions",
|
||||
nargs="*",
|
||||
@ -528,6 +540,6 @@ if __name__ == "__main__":
|
||||
sys.exit(1)
|
||||
print(f"=== Blender {version} ===")
|
||||
blender_path = get_blender_executable(version)
|
||||
generate_for_version(str(blender_path))
|
||||
generate_for_version(str(blender_path), revision=args.revision)
|
||||
print()
|
||||
print("Done.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user