"""
Build script for {{ main_project_name }}
"""
import subprocess
import sys

def main():
    """Main build function"""
    print("Building {{ main_project_name }}...")
    
    try:
        # Install dependencies
        subprocess.run(["poetry", "install"], check=True)
        
        # Run tests
        print("\nRunning tests...")
        subprocess.run(["poetry", "run", "pytest"], check=True)
        
        # Build package
        print("\nBuilding package...")
        subprocess.run(["poetry", "build"], check=True)
        
        print("\n✓ Build complete!")
        return 0
    except subprocess.CalledProcessError as e:
        print(f"\n✗ Build failed: {e}", file=sys.stderr)
        return 1

if __name__ == "__main__":
    sys.exit(main())
