forked from pyrogram/pyrogram
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
61 lines (47 loc) · 1.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
VENV := venv
PYTHON := $(VENV)/bin/python
HOST = $(shell ifconfig | grep "inet " | tail -1 | cut -d\ -f2)
TAG = v$(shell grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)
RM := rm -rf
.PHONY: venv clean-build clean-api clean api build clean-docs docs
all: clean venv build
echo Done
venv:
$(RM) $(VENV)
python3 -m venv $(VENV)
$(PYTHON) -m pip install -U pip wheel setuptools
$(PYTHON) -m pip install -U -e .[docs]
@echo "Created venv with $$($(PYTHON) --version)"
clean-build:
$(RM) *.egg-info build dist
clean-docs:
$(RM) docs/build
$(RM) docs/build docs/source/api/bound-methods docs/source/api/methods docs/source/api/types docs/source/api/enums docs/source/telegram
clean-api:
$(RM) pyrogram/errors/exceptions pyrogram/raw/all.py pyrogram/raw/base pyrogram/raw/functions pyrogram/raw/types
clean:
make clean-build
make clean-api
api:
cd compiler/api && ../../$(PYTHON) compiler.py
cd compiler/errors && ../../$(PYTHON) compiler.py
docs-live:
make clean-docs
make api
cd compiler/docs && ../../$(PYTHON) compiler.py
$(VENV)/bin/sphinx-autobuild \
--watch pyrogram --watch docs/resources \
-b html "docs/source" "docs/build/html" -j auto
docs:
make clean-docs
cd compiler/docs && ../../$(PYTHON) compiler.py
$(VENV)/bin/sphinx-build \
-b html "docs/source" "docs/build/html" -j auto
build: clean api docs
echo Build
tag:
git tag $(TAG)
git push origin $(TAG)
dtag:
git tag -d $(TAG)
git push origin -d $(TAG)