Developer Reference#
π Welcome!#
This guide will walk you through setting up your development environment, adhering to code standards, running tests, and submitting your contributions effectively.
π οΈ Prerequisites#
Ensure the following tools are installed on your system:
Python 3.11+ Download Python
Git Download Git
uv (Python package and environment manager)
pre-commit (Framework for managing Git hooks)
An IDE or text editor with Python support (e.g., VSCode, PyCharm)
π¦ Setting Up the Project#
1. Clone the Repository#
Replace <REPO_URL>
with the URL of your DOVE repository:
git clone <REPO_URL>
cd dove
2. Install Dependencies#
Use uv
to synchronize your environment with the projectβs lockfile:
uv sync --all-packages
Note: This command installs both runtime and development dependencies as specified in your
pyproject.toml
anduv.lock
files.
β Configure Pre-Commit Hooks#
Set up Git hooks to enforce code quality checks automatically:
pre-commit install --install-hooks
Optional: To run all hooks on all files manually:
pre-commit run --all-files
π§ͺ Development Workflow#
1. Create a Feature Branch#
Always create a new branch for your work:
git checkout -b feature/your-feature-name
Replace your-feature-name
with a descriptive name for your feature or fix.
2. Linting and Formatting with Ruff#
Check code for linting errors:
uv run ruff check .
Automatically fix linting errors:
uv run ruff check --fix
Format code according to style guidelines:
uv run ruff format .
Note: Ruff configurations are defined in
pyproject.toml
.
3. Run Tests with Pytest#
Execute all tests:
uv run pytest
Run tests with coverage report:
uv run pytest --cov
π Commit Your Changes#
Use Conventional Commits for clear and consistent commit messages.
Commit using Commitizen:
uv run cz commit
This will guide you through crafting a standardized commit message.
π Push and Create a Pull Request#
Push your branch to the remote repository:
git push origin feature/your-feature-name
Open a Pull Request (PR):
Navigate to your repository on GitHub.
Click on βCompare & pull requestβ for your recently pushed branch.
Fill out the PR template, detailing your changes and any relevant information.
Address Feedback:
Respond to any code review comments.
Make necessary changes and push them to your branch; the PR will update automatically.
π§° Summary of Common Commands#
Task |
Command |
---|---|
Clone repository |
|
Install dependencies |
|
Set up pre-commit hooks |
|
Create a new branch |
|
Lint code |
|
Fix linting issues |
|
Format code |
|
Run tests |
|
Run tests with coverage |
|
Commit changes |
|
Push branch to remote |
|
π Additional Resources#
pyproject.toml
: Contains project metadata and tool configurations..pre-commit-config.yaml
: Defines the pre-commit hooks used in the project.
Happy Coding! If you encounter any issues or have questions, feel free to reach out to the project maintainers or open an issue in the repository.