From 79ce3f291359420fbd41b3eacc293278480d13b5 Mon Sep 17 00:00:00 2001 From: Deeman Date: Sat, 28 Feb 2026 23:32:07 +0100 Subject: [PATCH] fix: rename root package to beanflows-pipeline to avoid workspace conflict The web package is already named 'beanflows'. Renaming the root CLI/infra package to 'beanflows-pipeline' (src/beanflows_pipeline/) resolves the uv workspace name conflict and Python namespace collision. Co-Authored-By: Claude Sonnet 4.6 --- infra/bootstrap_supervisor.sh | 2 +- infra/supervisor/beanflows-supervisor.service | 2 +- pyproject.toml | 4 ++-- .../__init__.py | 0 src/{beanflows => beanflows_pipeline}/cli.py | 16 ++++++++-------- .../export_serving.py | 0 .../pipelines.py | 2 +- .../providers/__init__.py | 2 +- .../providers/hetzner.py | 4 ++-- src/{beanflows => beanflows_pipeline}/secrets.py | 0 .../supervisor.py | 2 +- src/{beanflows => beanflows_pipeline}/workers.py | 4 ++-- 12 files changed, 19 insertions(+), 19 deletions(-) rename src/{beanflows => beanflows_pipeline}/__init__.py (100%) rename src/{beanflows => beanflows_pipeline}/cli.py (90%) rename src/{beanflows => beanflows_pipeline}/export_serving.py (100%) rename src/{beanflows => beanflows_pipeline}/pipelines.py (97%) rename src/{beanflows => beanflows_pipeline}/providers/__init__.py (86%) rename src/{beanflows => beanflows_pipeline}/providers/hetzner.py (96%) rename src/{beanflows => beanflows_pipeline}/secrets.py (100%) rename src/{beanflows => beanflows_pipeline}/supervisor.py (99%) rename src/{beanflows => beanflows_pipeline}/workers.py (90%) diff --git a/infra/bootstrap_supervisor.sh b/infra/bootstrap_supervisor.sh index 162cd48..37c2a07 100755 --- a/infra/bootstrap_supervisor.sh +++ b/infra/bootstrap_supervisor.sh @@ -115,6 +115,6 @@ echo "=== Bootstrap complete! ===" echo "" echo "Check status: systemctl status beanflows-supervisor" echo "View logs: journalctl -u beanflows-supervisor -f" -echo "Workflow status: sudo -u ${SERVICE_USER} ${UV} run -p ${REPO_DIR} python src/beanflows/supervisor.py status" +echo "Workflow status: sudo -u ${SERVICE_USER} ${UV} run -p ${REPO_DIR} python src/beanflows_pipeline/supervisor.py status" echo "Backup timer: systemctl list-timers beanflows-backup.timer" echo "Tag: $(sudo -u "${SERVICE_USER}" git -C "${REPO_DIR}" describe --tags --always)" diff --git a/infra/supervisor/beanflows-supervisor.service b/infra/supervisor/beanflows-supervisor.service index 4c15144..c53e978 100644 --- a/infra/supervisor/beanflows-supervisor.service +++ b/infra/supervisor/beanflows-supervisor.service @@ -7,7 +7,7 @@ Wants=network-online.target Type=simple User=beanflows_service WorkingDirectory=/opt/beanflows -ExecStart=/bin/sh -c 'exec uv run python src/beanflows/supervisor.py' +ExecStart=/bin/sh -c 'exec uv run python src/beanflows_pipeline/supervisor.py' Restart=always RestartSec=10 EnvironmentFile=/opt/beanflows/.env diff --git a/pyproject.toml b/pyproject.toml index 6420416..5a0752b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "beanflows" +name = "beanflows-pipeline" version = "0.1.0" description = "Add your description here" readme = "readme.md" @@ -20,7 +20,7 @@ dependencies = [ ] [project.scripts] -beanflows = "beanflows.cli:app" +beanflows = "beanflows_pipeline.cli:app" [dependency-groups] diff --git a/src/beanflows/__init__.py b/src/beanflows_pipeline/__init__.py similarity index 100% rename from src/beanflows/__init__.py rename to src/beanflows_pipeline/__init__.py diff --git a/src/beanflows/cli.py b/src/beanflows_pipeline/cli.py similarity index 90% rename from src/beanflows/cli.py rename to src/beanflows_pipeline/cli.py index bc91e19..90b46d4 100644 --- a/src/beanflows/cli.py +++ b/src/beanflows_pipeline/cli.py @@ -26,7 +26,7 @@ def worker_list( provider: Annotated[str, typer.Option("--provider", "-p")] = "hetzner", ): """List all active worker instances.""" - from beanflows.workers import list_workers + from beanflows_pipeline.workers import list_workers workers = list_workers(provider) if not workers: @@ -47,7 +47,7 @@ def worker_create( location: Annotated[str | None, typer.Option("--location", "-l")] = None, ): """Create a new worker instance.""" - from beanflows.workers import create_worker + from beanflows_pipeline.workers import create_worker typer.echo(f"Creating worker '{name}' ({server_type}) on {provider}...") worker = create_worker(name, server_type, provider, location) @@ -61,7 +61,7 @@ def worker_destroy( force: Annotated[bool, typer.Option("--force", "-f")] = False, ): """Destroy a worker instance.""" - from beanflows.workers import destroy_worker + from beanflows_pipeline.workers import destroy_worker if not force: confirm = typer.confirm(f"Destroy worker '{name}'?") @@ -82,7 +82,7 @@ def pipeline_run( name: Annotated[str, typer.Argument(help="Pipeline name (extract, transform)")], ): """Run a pipeline locally.""" - from beanflows.pipelines import run_pipeline + from beanflows_pipeline.pipelines import run_pipeline typer.echo(f"Running pipeline '{name}'...") result = run_pipeline(name) @@ -98,7 +98,7 @@ def pipeline_run( @pipeline_app.command("list") def pipeline_list(): """List available pipelines.""" - from beanflows.pipelines import PIPELINES + from beanflows_pipeline.pipelines import PIPELINES typer.echo("Available pipelines:") for name, config in PIPELINES.items(): @@ -113,7 +113,7 @@ app.add_typer(secrets_app, name="secrets") @secrets_app.command("list") def secrets_list(): """List available secrets (keys only).""" - from beanflows.secrets import list_secrets + from beanflows_pipeline.secrets import list_secrets secrets = list_secrets() if not secrets: @@ -130,7 +130,7 @@ def secrets_get( key: Annotated[str, typer.Argument(help="Secret key")], ): """Get a secret value.""" - from beanflows.secrets import get_secret + from beanflows_pipeline.secrets import get_secret value = get_secret(key) if value is None: @@ -143,7 +143,7 @@ def secrets_get( @secrets_app.command("test") def secrets_test(): """Test sops decryption (verifies sops is installed and age key is present).""" - from beanflows.secrets import test_connection + from beanflows_pipeline.secrets import test_connection typer.echo("Testing SOPS decryption...") if test_connection(): diff --git a/src/beanflows/export_serving.py b/src/beanflows_pipeline/export_serving.py similarity index 100% rename from src/beanflows/export_serving.py rename to src/beanflows_pipeline/export_serving.py diff --git a/src/beanflows/pipelines.py b/src/beanflows_pipeline/pipelines.py similarity index 97% rename from src/beanflows/pipelines.py rename to src/beanflows_pipeline/pipelines.py index d3ec673..01848aa 100644 --- a/src/beanflows/pipelines.py +++ b/src/beanflows_pipeline/pipelines.py @@ -65,7 +65,7 @@ PIPELINES = { "export_serving": { "command": ["uv", "run", "python", "-c", "import logging; logging.basicConfig(level=logging.INFO); " - "from beanflows.export_serving import export_serving; export_serving()"], + "from beanflows_pipeline.export_serving import export_serving; export_serving()"], "timeout_seconds": 300, }, } diff --git a/src/beanflows/providers/__init__.py b/src/beanflows_pipeline/providers/__init__.py similarity index 86% rename from src/beanflows/providers/__init__.py rename to src/beanflows_pipeline/providers/__init__.py index fd223ba..61fcf03 100644 --- a/src/beanflows/providers/__init__.py +++ b/src/beanflows_pipeline/providers/__init__.py @@ -15,7 +15,7 @@ class Instance: def get_provider(provider_name: str): if provider_name == "hetzner": - from beanflows.providers import hetzner + from beanflows_pipeline.providers import hetzner return hetzner else: diff --git a/src/beanflows/providers/hetzner.py b/src/beanflows_pipeline/providers/hetzner.py similarity index 96% rename from src/beanflows/providers/hetzner.py rename to src/beanflows_pipeline/providers/hetzner.py index fb599f2..9e76b4a 100644 --- a/src/beanflows/providers/hetzner.py +++ b/src/beanflows_pipeline/providers/hetzner.py @@ -7,8 +7,8 @@ from hcloud import Client from hcloud.images import Image from hcloud.server_types import ServerType -from beanflows.providers import Instance -from beanflows.secrets import get_secret +from beanflows_pipeline.providers import Instance +from beanflows_pipeline.secrets import get_secret def _get_client() -> Client: diff --git a/src/beanflows/secrets.py b/src/beanflows_pipeline/secrets.py similarity index 100% rename from src/beanflows/secrets.py rename to src/beanflows_pipeline/secrets.py diff --git a/src/beanflows/supervisor.py b/src/beanflows_pipeline/supervisor.py similarity index 99% rename from src/beanflows/supervisor.py rename to src/beanflows_pipeline/supervisor.py index 6a04f68..527eedd 100644 --- a/src/beanflows/supervisor.py +++ b/src/beanflows_pipeline/supervisor.py @@ -58,7 +58,7 @@ logging.basicConfig( datefmt="%Y-%m-%d %H:%M:%S", handlers=[logging.StreamHandler(sys.stdout)], ) -logger = logging.getLogger("beanflows.supervisor") +logger = logging.getLogger("beanflows_pipeline.supervisor") # --------------------------------------------------------------------------- diff --git a/src/beanflows/workers.py b/src/beanflows_pipeline/workers.py similarity index 90% rename from src/beanflows/workers.py rename to src/beanflows_pipeline/workers.py index 47548bc..a58b9da 100644 --- a/src/beanflows/workers.py +++ b/src/beanflows_pipeline/workers.py @@ -1,7 +1,7 @@ """Worker instance management.""" -from beanflows.providers import Instance, get_provider -from beanflows.secrets import get_secret +from beanflows_pipeline.providers import Instance, get_provider +from beanflows_pipeline.secrets import get_secret DEFAULT_PROVIDER = "hetzner"