code quality run
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
"""Development environment setup script"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ def setup_alembic():
|
||||
if alembic_dir.exists():
|
||||
# Remove incomplete alembic directory
|
||||
import shutil
|
||||
|
||||
shutil.rmtree(alembic_dir)
|
||||
|
||||
if not run_command("alembic init alembic", "Initializing Alembic"):
|
||||
@@ -138,16 +139,23 @@ LOG_LEVEL=INFO
|
||||
|
||||
# Set up Alembic
|
||||
if not setup_alembic():
|
||||
print("⚠️ Alembic setup failed. You'll need to set up database migrations manually.")
|
||||
print(
|
||||
"⚠️ Alembic setup failed. You'll need to set up database migrations manually."
|
||||
)
|
||||
return False
|
||||
|
||||
# Create initial migration
|
||||
if not run_command("alembic revision --autogenerate -m \"Initial migration\"", "Creating initial migration"):
|
||||
if not run_command(
|
||||
'alembic revision --autogenerate -m "Initial migration"',
|
||||
"Creating initial migration",
|
||||
):
|
||||
print("⚠️ Initial migration creation failed. Check your database models.")
|
||||
|
||||
# Apply migrations
|
||||
if not run_command("alembic upgrade head", "Setting up database"):
|
||||
print("⚠️ Database setup failed. Make sure your DATABASE_URL is correct in .env")
|
||||
print(
|
||||
"⚠️ Database setup failed. Make sure your DATABASE_URL is correct in .env"
|
||||
)
|
||||
|
||||
# Run tests
|
||||
if not run_command("pytest", "Running tests"):
|
||||
@@ -157,7 +165,7 @@ LOG_LEVEL=INFO
|
||||
print("To start the development server, run:")
|
||||
print(" uvicorn main:app --reload")
|
||||
print("\nDatabase commands:")
|
||||
print(" alembic revision --autogenerate -m \"Description\" # Create migration")
|
||||
print(' alembic revision --autogenerate -m "Description" # Create migration')
|
||||
print(" alembic upgrade head # Apply migrations")
|
||||
print(" alembic current # Check status")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user