contributing.mdx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ---
  2. title: "Contributing to Agency Swarm"
  3. description: "Learn how to contribute to Agency Swarm"
  4. icon: "code-fork"
  5. ---
  6. We welcome contributions to Agency Swarm! By contributing, you help improve the framework for everyone. Here's how you can get involved:
  7. ## Setting Up Your Development Environment
  8. ### Prerequisites
  9. - Python 3.12 or higher
  10. - Pip
  11. - Git
  12. ### Setup
  13. 1. Clone the repository:
  14. ```bash
  15. git clone https://github.com/VRSEN/agency-swarm.git
  16. cd agency-swarm
  17. ```
  18. 2. Create and activate a virtual environment (recommended):
  19. ```bash
  20. python -m venv .venv
  21. source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
  22. ```
  23. 3. Install dependencies including development tools:
  24. ```bash
  25. pip install -e ".[dev]"
  26. ```
  27. 4. Install Pre-Commit Hooks:
  28. ```bash
  29. pip install pre-commit
  30. pre-commit install
  31. ```
  32. ## Running Tests
  33. <Tip>
  34. Testing ensures that your contributions work as intended and do not break existing functionality.
  35. </Tip>
  36. <Steps titleSize="h3">
  37. <Step title="Install Test Dependencies" icon="download" iconType="solid">
  38. Ensure all test dependencies are installed.
  39. ```bash
  40. pip install -e ".[dev]"
  41. ```
  42. </Step>
  43. <Step title="Run Tests" icon="play" iconType="solid">
  44. Run the test suite using Pytest.
  45. ```bash
  46. pytest
  47. ```
  48. </Step>
  49. <Step title="Check Test Coverage" icon="chart-bar" iconType="solid">
  50. Check the test coverage to ensure comprehensive testing.
  51. ```bash
  52. pytest --cov=agency_swarm tests/
  53. ```
  54. </Step>
  55. </Steps>
  56. ## Submitting Changes
  57. <AccordionGroup>
  58. <Accordion title="Create Branch" icon="code-branch" iconType="solid">
  59. Create a branch for your work:
  60. ```bash
  61. git checkout -b feature/your-feature-name
  62. ```
  63. </Accordion>
  64. <Accordion title="Commit Changes" icon="git" iconType="solid">
  65. Commit your updates:
  66. ```bash
  67. git add .
  68. git commit -m "Add [feature]: Description"
  69. ```
  70. </Accordion>
  71. <Accordion title="Push Branch" icon="code-fork" iconType="solid">
  72. Push your branch:
  73. ```bash
  74. git push origin feature/your-feature-name
  75. ```
  76. </Accordion>
  77. <Accordion title="Open PR" icon="paper-plane" iconType="solid">
  78. Open a pull request on GitHub:
  79. ```markdown
  80. - Provide a concise title and description.
  81. - Reference related issues.
  82. ```
  83. </Accordion>
  84. </AccordionGroup>
  85. ### Code Style and Linting
  86. This project uses `ruff` for linting and code formatting. Configuration for this tool can be found in `pyproject.toml`.
  87. Before committing your changes, please check and fix linting errors:
  88. ```bash
  89. ruff check . --fix
  90. ```
  91. It's recommended to install these tools in your development environment. If you followed the setup instructions, they should already be installed via:
  92. ```bash
  93. pip install -e ".[dev]"
  94. ```