Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@

# Initialize git
subprocess.run(["git", "init", "-b", "main"], check=True, shell=use_shell)

# Install dependencies and generate uv.lock BEFORE committing
print("\nInstalling dependencies with uv...")
subprocess.run(["uv", "sync", "--all-extras", "--dev"], check=True, shell=use_shell)

# Stage and commit all files (including the newly generated uv.lock)
subprocess.run(["git", "add", "."], check=True, shell=use_shell)
subprocess.run(
["git", "commit", "-m", "Initial commit from cookiecutter"],
check=True,
shell=use_shell,
)

# Install dependencies
print("\nInstalling dependencies with uv...")
subprocess.run(["uv", "sync", "--all-extras", "--dev"], check=True, shell=use_shell)

print("\nSuccessfully initialized git repo and installed dependencies.")
print("\nSuccessfully initialized git repo, generated lockfile, and committed.")
print("Your new project is ready at:", os.getcwd())

except Exception as e:
print(f"\nAn error occurred during post-generation setup: {e}")
print("Please manually run 'git init' and 'uv sync --all-extras --dev'.")
print("Please manually run 'uv sync --all-extras --dev' and commit the results.")
2 changes: 0 additions & 2 deletions {{cookiecutter.project_slug}}/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,3 @@ cython_debug/
# Runtime Logs
logs/

# uv lockfile
uv.lock