mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
* Bump API schema to version 9.4, add new object types, methods, and properties.
* Add tests for `ChatOwnerChanged` and `ChatOwnerLeft` message types
* Add tests for `GetUserProfileAudios`, `RemoveMyProfilePhoto`, and `SetMyProfilePhoto` methods
* Bump version
* Update Makefile variables and refactor `test_get_user_profile_audios.py`
* Document new features and updates from Bot API 9.4 in changelog
* Add `ButtonStyle` enum to represent button styles in the Telegram API
* Fix review issues from PR #1761
- Remove stray '-' artifact from GameHighScore docstring and butcher schema
- Fix Makefile reformat target scope inconsistency (ruff check --fix)
- Fix ButtonStyle enum source URL (#chat -> #inlinekeyboardbutton)
- Add User.get_profile_audios() shortcut method (parallel to get_profile_photos)
- Test ChatOwnerLeft with new_owner=None (edge case)
- Add VideoQuality type and Video.qualities nesting tests
- Add User.get_profile_audios() test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Revert "Fix review issues from PR #1761"
This reverts commit 2184e98988.
* Update source links for `ButtonStyle` documentation to reflect accurate API references
* Fix review issues from PR #1761 (#1762)
* Fix review issues from PR #1761
- Remove stray '-' artifact from GameHighScore docstring
- Fix Makefile reformat target scope inconsistency (ruff check --fix)
- Add User.get_profile_audios() shortcut method (parallel to get_profile_photos)
- Test ChatOwnerLeft with new_owner=None (edge case)
- Add VideoQuality type and Video.qualities nesting tests
- Add User.get_profile_audios() test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address review comments: use fixture and variables in tests, add changelog
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address review follow-ups for PR #1762
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Reformat code
* Shut up, ruff
---------
Co-authored-by: latand <latand666@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Kostiantyn Kriuchkov <36363097+Latand@users.noreply.github.com>
132 lines
4.2 KiB
Makefile
132 lines
4.2 KiB
Makefile
.DEFAULT_GOAL := lint
|
|
|
|
package_dir := aiogram
|
|
tests_dir := tests
|
|
scripts_dir := scripts
|
|
examples_dir := examples
|
|
code_dir := $(package_dir) $(tests_dir) $(scripts_dir) $(examples_dir)
|
|
reports_dir := reports
|
|
|
|
redis_connection := redis://localhost:6379
|
|
mongo_connection := mongodb://mongo:mongo@localhost:27017
|
|
|
|
# =================================================================================================
|
|
# Environment
|
|
# =================================================================================================
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf `find . -name __pycache__`
|
|
rm -f `find . -type f -name '*.py[co]' `
|
|
rm -f `find . -type f -name '*~' `
|
|
rm -f `find . -type f -name '.*~' `
|
|
rm -rf `find . -name .pytest_cache`
|
|
rm -rf *.egg-info
|
|
rm -f report.html
|
|
rm -f .coverage
|
|
rm -rf {build,dist,site,.cache,.mypy_cache,.ruff_cache,reports}
|
|
|
|
.PHONY: install
|
|
install: clean
|
|
uv sync --all-extras --group dev --group test
|
|
uv run pre-commit install
|
|
|
|
# =================================================================================================
|
|
# Code quality
|
|
# =================================================================================================
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
uv run ruff format --check --diff $(package_dir)
|
|
uv run ruff check --show-fixes --preview $(package_dir) $(examples_dir)
|
|
uv run mypy $(package_dir)
|
|
|
|
.PHONY: reformat
|
|
reformat:
|
|
uv run ruff format $(code_dir)
|
|
uv run ruff check --fix $(code_dir)
|
|
|
|
# =================================================================================================
|
|
# Tests
|
|
# =================================================================================================
|
|
.PHONY: test-run-services
|
|
test-run-services:
|
|
@#docker-compose -f tests/docker-compose.yml -p aiogram3-dev up -d
|
|
|
|
.PHONY: test
|
|
test: test-run-services
|
|
uv run pytest --cov=aiogram --cov-config .coveragerc tests/ --redis $(redis_connection) --mongo $(mongo_connection)
|
|
|
|
.PHONY: test-coverage
|
|
test-coverage: test-run-services
|
|
mkdir -p $(reports_dir)/tests/
|
|
uv run pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/ --redis $(redis_connection) --mongo $(mongo_connection)
|
|
uv run coverage html -d $(reports_dir)/coverage
|
|
|
|
.PHONY: test-coverage-view
|
|
test-coverage-view:
|
|
uv run coverage html -d $(reports_dir)/coverage
|
|
uv run python -c "import webbrowser; webbrowser.open('file://$(shell pwd)/reports/coverage/index.html')"
|
|
|
|
# =================================================================================================
|
|
# Docs
|
|
# =================================================================================================
|
|
|
|
locales := uk_UA
|
|
locale_targets := $(addprefix docs-serve-, $(locales))
|
|
locales_pot := _build/gettext
|
|
docs_dir := docs
|
|
|
|
docs-gettext:
|
|
uv run --extra docs bash -c 'cd $(docs_dir) && make gettext'
|
|
uv run --extra docs bash -c 'cd $(docs_dir) && sphinx-intl update -p $(locales_pot) $(addprefix -l , $(locales))'
|
|
.PHONY: docs-gettext
|
|
|
|
docs-serve:
|
|
uv run --extra docs sphinx-autobuild --watch aiogram/ --watch CHANGES.rst --watch README.rst docs/ docs/_build/ $(OPTS)
|
|
.PHONY: docs-serve
|
|
|
|
$(locale_targets): docs-serve-%:
|
|
$(MAKE) docs-serve OPTS="-D language=$(subst docs-serve-,,$@)"
|
|
.PHONY: $(locale_targets)
|
|
|
|
# =================================================================================================
|
|
# Project
|
|
# =================================================================================================
|
|
|
|
.PHONY: build
|
|
build: clean
|
|
uv build
|
|
|
|
.PHONY: bump
|
|
bump:
|
|
uv run python scripts/bump_version.py $(args)
|
|
uv run python scripts/bump_versions.py
|
|
|
|
update-api:
|
|
uv run --extra cli butcher parse
|
|
uv run --extra cli butcher refresh
|
|
uv run --extra cli butcher apply all
|
|
@$(MAKE) bump
|
|
|
|
.PHONY: towncrier-build
|
|
towncrier-build:
|
|
uv run --extra docs towncrier build --yes
|
|
|
|
.PHONY: towncrier-draft
|
|
towncrier-draft:
|
|
uv run --extra docs towncrier build --draft
|
|
|
|
.PHONY: towncrier-draft-github
|
|
towncrier-draft-github:
|
|
mkdir -p dist
|
|
uv run --extra docs towncrier build --draft | pandoc - -o dist/release.md
|
|
|
|
.PHONY: prepare-release
|
|
prepare-release: bump towncrier-build
|
|
|
|
.PHONY: release
|
|
release:
|
|
git add .
|
|
git commit -m "Release $(shell uv run python -c 'from aiogram import __version__; print(__version__)')"
|
|
git tag v$(shell uv run python -c 'from aiogram import __version__; print(__version__)')
|