Files
noteflow/scripts/dev_watch_server.py
Travis Vasceannie b333ea5b23 Add initial Docker and development environment setup
- Created .dockerignore to exclude unnecessary files from Docker builds.
- Added .repomixignore for managing ignored patterns in Repomix.
- Introduced Dockerfile.dev for development environment setup with Python 3.12.
- Configured docker-compose.yaml to define services, including a PostgreSQL database.
- Established a devcontainer.json for Visual Studio Code integration.
- Implemented postCreate.sh for automatic dependency installation in the dev container.
- Added constants.py to centralize configuration constants for the project.
- Updated pyproject.toml to include new development dependencies.
- Created initial documentation files for project overview and style conventions.
- Added tests for new functionalities to ensure reliability and correctness.
2025-12-19 05:02:16 +00:00

35 lines
839 B
Python

#!/usr/bin/env python3
"""Run the gRPC server with auto-reload.
Watches only the core server code (and alembic.ini) to avoid noisy directories.
"""
from __future__ import annotations
import subprocess
import sys
from pathlib import Path
from watchfiles import PythonFilter, run_process
def run_server() -> None:
"""Start the gRPC server process."""
subprocess.run([sys.executable, "-m", "noteflow.grpc.server"], check=False)
def main() -> None:
root = Path(__file__).resolve().parents[1]
watch_paths = [root / "src" / "noteflow", root / "alembic.ini"]
existing_paths = [str(path) for path in watch_paths if path.exists()] or [str(root / "src" / "noteflow")]
run_process(
*existing_paths,
target=run_server,
watch_filter=PythonFilter(),
)
if __name__ == "__main__":
main()