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 2.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # AutoGen Python packages
  2. [![0.4 Docs](https://img.shields.io/badge/Docs-0.4-blue)](https://microsoft.github.io/autogen/dev/)
  3. [![PyPi autogen-core](https://img.shields.io/badge/PyPi-autogen--core-blue?logo=pypi)](https://pypi.org/project/autogen-core/0.4.0.dev8/) [![PyPi autogen-agentchat](https://img.shields.io/badge/PyPi-autogen--agentchat-blue?logo=pypi)](https://pypi.org/project/autogen-agentchat/0.4.0.dev8/) [![PyPi autogen-ext](https://img.shields.io/badge/PyPi-autogen--ext-blue?logo=pypi)](https://pypi.org/project/autogen-ext/0.4.0.dev8/)
  4. This directory works as a single `uv` workspace containing all project packages. See [`packages`](./packages/) to discover all project packages.
  5. ## Development
  6. **TL;DR**, run all checks with:
  7. ```sh
  8. uv sync --all-extras
  9. source .venv/bin/activate
  10. poe check
  11. ```
  12. ### Setup
  13. `uv` is a package manager that assists in creating the necessary environment and installing packages to run AutoGen.
  14. - [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/).
  15. ### Virtual Environment
  16. During development, you may need to test changes made to any of the packages.\
  17. To do so, create a virtual environment where the AutoGen packages are installed based on the current state of the directory.\
  18. Run the following commands at the root level of the Python directory:
  19. ```sh
  20. uv sync --all-extras
  21. source .venv/bin/activate
  22. ```
  23. - `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.
  24. - `source .venv/bin/activate` activates the virtual environment.
  25. ### Common Tasks
  26. To create a pull request (PR), ensure the following checks are met. You can run each check individually:
  27. - Format: `poe format`
  28. - Lint: `poe lint`
  29. - Test: `poe test`
  30. - Mypy: `poe mypy`
  31. - Pyright: `poe pyright`
  32. - Build docs: `poe --directory ./packages/autogen-core/ docs-build`
  33. - Auto rebuild+serve docs: `poe --directory ./packages/autogen-core/ docs-serve`
  34. Alternatively, you can run all the checks with:
  35. - `poe check`
  36. > [!NOTE]
  37. > These need to be run in the virtual environment.
  38. ### Creating a New Package
  39. To create a new package, similar to `autogen-core` or `autogen-chat`, use the following:
  40. ```sh
  41. uv sync
  42. source .venv/bin/activate
  43. cookiecutter ./templates/new-package/
  44. ```