You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.8 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # AutoGen Python packages
  2. See [`autogen-core`](./packages/autogen-core/) package for main functionality.
  3. ## Development
  4. **TL;DR**, run all checks with:
  5. ```sh
  6. uv sync --all-extras
  7. source .venv/bin/activate
  8. poe check
  9. ```
  10. ### Setup
  11. `uv` is a package manager that assists in creating the necessary environment and installing packages to run AutoGen.
  12. - [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/).
  13. ### Virtual Environment
  14. During development, you may need to test changes made to any of the packages.\
  15. To do so, create a virtual environment where the AutoGen packages are installed based on the current state of the directory.\
  16. Run the following commands at the root level of the Python directory:
  17. ```sh
  18. uv sync --all-extras
  19. source .venv/bin/activate
  20. ```
  21. - `uv sync --all-extras` will create a `.venv` directory at the current level and install packages from the current directory along with any other dependencies. The `all-extras` flag adds optional dependencies.
  22. - `source .venv/bin/activate` activates the virtual environment.
  23. ### Common Tasks
  24. To create a pull request (PR), ensure the following checks are met. You can run each check individually:
  25. - Format: `poe format`
  26. - Lint: `poe lint`
  27. - Test: `poe test`
  28. - Mypy: `poe mypy`
  29. - Pyright: `poe pyright`
  30. - Build docs: `poe --directory ./packages/autogen-core/ docs-build`
  31. - Auto rebuild+serve docs: `poe --directory ./packages/autogen-core/ docs-serve`
  32. Alternatively, you can run all the checks with:
  33. - `poe check`
  34. > [!NOTE]
  35. > These need to be run in the virtual environment.
  36. ### Creating a New Package
  37. To create a new package, similar to `autogen-core` or `autogen-chat`, use the following:
  38. ```sh
  39. uv sync
  40. source .venv/bin/activate
  41. cookiecutter ./templates/new-package/
  42. ```