Contributing¶
You’re welcome to contribute to aiogram!
aiogram is an open-source project, and anyone can contribute to it in any possible way
Developing¶
Before making any changes in the framework code, it is necessary to fork the project and clone the project to your PC and know how to do a pull-request.
How to work with pull-request you can read in the GitHub docs
Also in due to this project is written in Python, you will need Python to be installed (is recommended to use latest Python versions, but any version starting from 3.8 can be used)
Use virtualenv¶
You can create a virtual environment in a directory using venv module (it should be pre-installed by default):
This action will create a .venv directory with the Python binaries and then you will
be able to install packages into that isolated environment.
Activate the environment¶
Linux / macOS:
source .venv/bin/activate
Windows cmd
.\.venv\Scripts\activate
Windows PowerShell
.\.venv\Scripts\activate.ps1
To check it worked, use described command, it should show the pip version and location
inside the isolated environment
pip -V
Also make sure you have the latest pip version in your virtual environment to avoid errors on next steps:
python -m pip install --upgrade pip
Setup project¶
After activating the environment install aiogram from sources and their dependencies.
Linux / macOS:
pip install -e ."[dev,test,docs,fast,redis,mongo,proxy,i18n]"
Windows:
pip install -e .[dev,test,docs,fast,redis,mongo,proxy,i18n]
It will install aiogram in editable mode into your virtual environment and all dependencies.
Alternative: Using uv (Modern Approach)¶
As an alternative to the traditional pip and venv workflow, you can use uv -
a modern, fast Python package manager that handles virtual environments, dependency resolution, and package installation.
Benefits of using uv:
10-100x faster dependency resolution than pip
Automatic virtual environment management
Reproducible builds with lockfile
Single tool for all package management needs
Installing uv:
Linux / macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Or using pip:
pip install uv
Setup project with uv:
Instead of manually creating and activating a virtual environment, uv handles this automatically:
# Clone the repository
git clone https://github.com/aiogram/aiogram.git
cd aiogram
# Install all dependencies (creates .venv automatically)
uv sync --all-extras --group dev --group test
# Install pre-commit hooks
uv run pre-commit install
That’s it! The uv sync command creates a virtual environment in .venv/,
installs all dependencies including optional extras and development tools, and generates
a uv.lock file for reproducible builds.
Running commands with uv:
When using uv, prefix commands with uv run to execute them in the managed environment:
# Format code
uv run ruff format aiogram tests scripts examples
uv run ruff check --fix aiogram tests scripts examples
# Run tests
uv run pytest tests
# Run linting
uv run ruff check aiogram examples
uv run mypy aiogram
# Start documentation server
uv run sphinx-autobuild --watch aiogram/ docs/ docs/_build/
Or use the Makefile commands which now support uv:
make install # Uses uv sync
make lint # Uses uv run
make reformat # Uses uv run
make test # Uses uv run
Making changes in code¶
At this point you can make any changes in the code that you want, it can be any fixes, implementing new features or experimenting.
Format the code (code-style)¶
Note that this project uses Ruff for formatting and linting, so you should follow that code-style. To be sure you’re correctly doing this, let’s reformat the code automatically:
Using traditional approach:
ruff format aiogram tests scripts examples
ruff check --fix aiogram tests scripts examples
Or with uv:
uv run ruff format aiogram tests scripts examples
uv run ruff check --fix aiogram tests scripts examples
Or simply use Makefile:
make reformat
Run tests¶
All changes should be tested:
Using traditional approach:
pytest tests
Or with uv:
uv run pytest tests
Or use Makefile:
make test
Also if you are doing something with Redis-storage or/and MongoDB-storage, you will need to test everything works with Redis or/and MongoDB:
Using traditional approach:
pytest --redis redis://<host>:<port>/<db> --mongo mongodb://<user>:<password>@<host>:<port> tests
Or with uv:
uv run pytest --redis redis://<host>:<port>/<db> --mongo mongodb://<user>:<password>@<host>:<port> tests
Docs¶
We are using Sphinx to render docs in different languages, all sources located in docs directory, you can change the sources and to test it you can start live-preview server and look what you are doing:
Using traditional approach:
sphinx-autobuild --watch aiogram/ docs/ docs/_build/
Or with uv:
uv run --extra docs sphinx-autobuild --watch aiogram/ docs/ docs/_build/
Or use Makefile:
make docs-serve
Docs translations¶
Translation of the documentation is very necessary and cannot be done without the help of the community from all over the world, so you are welcome to translate the documentation into different languages.
Before start, let’s up to date all texts:
Using traditional approach:
cd docs
make gettext
sphinx-intl update -p _build/gettext -l <language_code>
Or with uv:
uv run --extra docs bash -c 'cd docs && make gettext'
uv run --extra docs bash -c 'cd docs && sphinx-intl update -p _build/gettext -l <language_code>'
Or use Makefile:
make docs-gettext
Change the <language_code> in example below to the target language code, after that
you can modify texts inside docs/locale/<language_code>/LC_MESSAGES as *.po files
by using any text-editor or specialized utilites for GNU Gettext,
for example via poedit.
To view results:
Using traditional approach:
sphinx-autobuild --watch aiogram/ docs/ docs/_build/ -D language=<language_code>
Or with uv:
uv run --extra docs sphinx-autobuild --watch aiogram/ docs/ docs/_build/ -D language=<language_code>
Describe changes¶
Describe your changes in one or more sentences so that bot developers know what’s changed in their favorite framework - create <code>.<category>.rst file and write the description.
<code> is Issue or Pull-request number, after release link to this issue will
be published to the Changelog page.
<category> is a changes category marker, it can be one of:
feature- when you are implementing new featurebugfix- when you fix a bugdoc- when you improve the docsremoval- when you remove something from the frameworkmisc- when changed something inside the Core or project configuration
If you have troubles with changing category feel free to ask Core-contributors to help with choosing it.
Complete¶
After you have made all your changes, publish them to the repository and create a pull request as mentioned at the beginning of the article and wait for a review of these changes.
Star on GitHub¶
You can “star” repository on GitHub - https://github.com/aiogram/aiogram (click the star button at the top right)
Adding stars makes it easier for other people to find this project and understand how useful it is.
Guides¶
You can write guides how to develop Bots on top of aiogram and publish it into YouTube, Medium, GitHub Books, any Courses platform or any other platform that you know.
This will help more people learn about the framework and learn how to use it
Take answers¶
The developers is always asks for any question in our chats or any other platforms like GitHub Discussions, StackOverflow and others, feel free to answer to this questions.
Funding¶
The development of the project is free and not financed by commercial organizations, it is my personal initiative (@JRootJunior) and I am engaged in the development of the project in my free time.
So, if you want to financially support the project, or, for example, give me a pizza or a beer, you can do it on OpenCollective.