libstacker 0.1.0

Image alignment and stacking functions based on OpenCV and Rayon
Documentation
import re
from pathlib import Path
import subprocess

def run_cargo_outdated():
    # Run the command and let it print directly to console
    process = subprocess.run(
        ["cargo", "outdated", "-d", "1"],
        text=True
    )

def sync_versions():
    # Paths to the files
    cargo_toml_path = Path("Cargo.toml")
    readme_path = Path("README.md")

    # Read and parse version from Cargo.toml
    cargo_content = cargo_toml_path.read_text()
    version_match = re.search(r'version\s*=\s*"([\d.]+)"', cargo_content)
    if not version_match:
        raise ValueError("Could not find version in Cargo.toml")

    version_str = version_match.group(1)
    version_tuple = tuple(map(int, version_str.split('.')))

    # Read and update __init__.py
    readme_content = readme_path.read_text()

    # Replace the version in bl_info
    readme_content = re.sub(
        r'\[\!\[dependency status\]\(https://deps.rs/crate/libstacker/[\d.]+/status\.svg\)\]\(https://deps.rs/crate/libstacker/[\d.]+\)',
        f'[![dependency status](https://deps.rs/crate/libstacker/{version_str}/status.svg)](https://deps.rs/crate/libstacker/{version_str})',
        readme_content
    )

    # Replace the version in Rust dependency string
    readme_content = re.sub(
        r'libstacker\s*=\s*\{\s*version\s*=\s*"[\d.]+"',
        f'libstacker = {{ version = "{version_str}"',
        readme_content
    )

    # Write back to file
    readme_path.write_text(readme_content)
    print(f"Updated README.md version to {version_tuple}")

if __name__ == "__main__":
    sync_versions()
    run_cargo_outdated()