2022-04-24 09:56:07 +00:00
|
|
|
VENV := venv
|
|
|
|
PYTHON := $(VENV)/bin/python
|
2022-10-06 10:03:05 +00:00
|
|
|
HOST = $(shell ifconfig | grep "inet " | tail -1 | cut -d\ -f2)
|
2022-11-18 11:14:31 +00:00
|
|
|
TAG = v$(shell grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)
|
2022-04-24 09:56:07 +00:00
|
|
|
|
|
|
|
RM := rm -rf
|
|
|
|
|
2022-10-06 10:03:05 +00:00
|
|
|
.PHONY: venv clean-build clean-api clean api build
|
2022-04-24 09:56:07 +00:00
|
|
|
|
|
|
|
venv:
|
|
|
|
$(RM) $(VENV)
|
|
|
|
python3 -m venv $(VENV)
|
|
|
|
$(PYTHON) -m pip install -U pip wheel setuptools
|
2022-10-06 10:03:05 +00:00
|
|
|
$(PYTHON) -m pip install -U -r requirements.txt -r dev-requirements.txt
|
2022-04-24 09:56:07 +00:00
|
|
|
@echo "Created venv with $$($(PYTHON) --version)"
|
|
|
|
|
|
|
|
clean-build:
|
|
|
|
$(RM) *.egg-info build dist
|
|
|
|
|
|
|
|
clean-api:
|
|
|
|
$(RM) pyrogram/errors/exceptions pyrogram/raw/all.py pyrogram/raw/base pyrogram/raw/functions pyrogram/raw/types
|
|
|
|
|
2024-07-30 09:35:26 +00:00
|
|
|
clean-docs:
|
|
|
|
$(RM) docs/build docs/source/api/bound-methods docs/source/api/methods docs/source/api/types docs/source/telegram
|
|
|
|
|
2022-04-24 09:56:07 +00:00
|
|
|
clean:
|
|
|
|
make clean-build
|
|
|
|
make clean-api
|
2024-07-30 09:35:26 +00:00
|
|
|
make clean-docs
|
2022-04-24 09:56:07 +00:00
|
|
|
|
|
|
|
api:
|
|
|
|
cd compiler/api && ../../$(PYTHON) compiler.py
|
|
|
|
cd compiler/errors && ../../$(PYTHON) compiler.py
|
|
|
|
|
2024-07-30 09:35:26 +00:00
|
|
|
docs:
|
|
|
|
cd compiler/docs && ../../$(PYTHON) compiler.py
|
|
|
|
$(VENV)/bin/sphinx-build -b dirhtml "docs/source" "docs/build/html" -j auto
|
|
|
|
|
2022-04-24 09:56:07 +00:00
|
|
|
build:
|
2022-10-06 10:03:05 +00:00
|
|
|
make clean
|
2022-04-24 09:56:07 +00:00
|
|
|
$(PYTHON) setup.py sdist
|
2022-11-18 11:14:31 +00:00
|
|
|
$(PYTHON) setup.py bdist_wheel
|
|
|
|
|
|
|
|
tag:
|
|
|
|
git tag $(TAG)
|
|
|
|
git push origin $(TAG)
|
|
|
|
|
|
|
|
dtag:
|
|
|
|
git tag -d $(TAG)
|
2024-07-30 09:35:26 +00:00
|
|
|
git push origin -d $(TAG)
|