Troubleshooting¶
This guide covers common issues you might encounter when using this package and how to resolve them.
Setup Issues¶
Prek Hook Installation Fails¶
Problem: prek install returns an error or hooks don't run on commit.
Solutions:
- Ensure you're in the project root directory
- Verify Python virtual environment is activated
-
Reinstall prek:
uv sync --group dev uv run prek install -
Check if
.gitdirectory exists (must be a git repository) - Try running manually:
uv run prek run --all-files
Virtual Environment Issues¶
Problem: Packages can't be found or dependencies conflict.
Solutions:
-
Create a fresh virtual environment:
rm -rf .venv uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install dependencies:
uv sync -
Verify installation:
python -c "import gwmock_pop; print(gwmock_pop.__version__)"
Development Issues¶
"Unstaged Changes" After Running Hooks¶
Problem: Prek modified files but they're not staged.
Solutions:
-
This is expected - review changes:
git diff -
Stage the changes:
git add . -
Try committing again
- Or use
git add -Ato stage all changes before commit
Dependency Conflicts¶
Problem: uv pip install fails with conflict messages.
Solutions:
-
Check Python version:
python --version -
Create fresh virtual environment:
rm -rf .venv && uv venv source .venv/bin/activate -
Install with verbose output to see conflict:
uv sync -vv -
Check
pyproject.tomlfor overly restrictive version constraints
Newer Version of Tool Breaks Things¶
Problem: Prek hooks or tools updated and now fail.
Solutions:
-
Check what changed:
uv run prek auto-update --dry-run -
Update individual tool:
uv run prek auto-update --repo https://github.com/tool-repo -
Test changes:
uv run prek run --all-files -
Pin to known-good version in
.pre-commit-config.yaml:rev: v1.0.0 # Specific version instead of latest
Getting Help¶
If you encounter issues not listed here:
- Check existing issues: Search GitHub Issues for your problem
- Review logs carefully: Error messages usually point to the root cause
- Search documentation: Many issues are covered in specific tool docs
- Try minimal reproduction: Isolate the problem to a single file/command
- Ask for help: Open an issue with:
- Your environment (Python version, OS)
- Steps to reproduce
- Full error message/logs
- What you've already tried