Skip to content

Commit 6886e0f

Browse files
committed
feat: add new Makefile targets for API schema check, JSON generation, and bot API comparison
1 parent d613716 commit 6886e0f

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DOCS_BUILD = $(DOCS_DIR)/build
1010
API_DIRS = $(HYDROGRAM_DIR)/errors/exceptions $(HYDROGRAM_DIR)/raw/all.py $(HYDROGRAM_DIR)/raw/base $(HYDROGRAM_DIR)/raw/functions $(HYDROGRAM_DIR)/raw/types
1111
DOCS_API_DIRS = $(DOCS_SOURCE)/api/bound-methods $(DOCS_SOURCE)/api/methods $(DOCS_SOURCE)/api/types $(DOCS_SOURCE)/telegram
1212

13-
.PHONY: all clean clean-api clean-docs api api-raw api-errors docs docs-compile docs-serve live-docs towncrier towncrier-draft help
13+
.PHONY: all clean clean-api clean-docs api api-raw api-errors docs docs-compile docs-serve live-docs towncrier towncrier-draft dev-tools check-api-schema generate-docs-json compare-bot-api cherry-pick-pyro help
1414

1515
all: api docs
1616

@@ -58,6 +58,22 @@ towncrier-draft:
5858
@echo "Generating draft release notes..."
5959
@$(TOWNCRIER) build --draft
6060

61+
check-api-schema:
62+
@echo "Checking Telegram API schema for updates..."
63+
@$(PYTHON) dev_tools/check_api_schema_updates.py
64+
65+
generate-docs-json:
66+
@echo "Generating API documentation JSON..."
67+
@$(PYTHON) dev_tools/generate_docs_json.py
68+
69+
compare-bot-api:
70+
@echo "Comparing implementation against Bot API..."
71+
@$(PYTHON) dev_tools/compare_to_bot_api.py
72+
73+
cherry-pick-pyro:
74+
@echo "Usage: make cherry-pick-pyro TYPE=<pr|branch|commit> ID=<number|name|hash>"
75+
@[ "$(TYPE)" ] && [ "$(ID)" ] && $(PYTHON) dev_tools/cherry_pick_pyro.py $(TYPE) $(ID) || echo "Please provide TYPE and ID parameters"
76+
6177
help:
6278
@echo "Available targets:"
6379
@echo " all : Compile API and documentation"
@@ -67,3 +83,7 @@ help:
6783
@echo " live-docs : Start documentation server with live reload"
6884
@echo " towncrier : Generate release notes"
6985
@echo " towncrier-draft: Generate draft release notes"
86+
@echo " check-api-schema: Check Telegram API schema for updates"
87+
@echo " generate-docs-json: Generate API documentation JSON"
88+
@echo " compare-bot-api: Compare implementation against Bot API"
89+
@echo " cherry-pick-pyro: Cherry-pick code from Pyrogram (usage: make cherry-pick-pyro TYPE=<pr|branch|commit> ID=<number|name|hash>)"

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dev-dependencies = [
6161
"pre-commit>=4.2.0",
6262
"httpx[http2]>=0.28.1",
6363
"lxml>=5.3.2",
64+
"hatchling>=1.27.0",
6465
]
6566

6667
[project.optional-dependencies]

uv.lock

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)