forked from pyrogram/pyrogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate setup.py commands to a Makefile
- Loading branch information
1 parent
1ebc704
commit 109c9d4
Showing
6 changed files
with
59 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
VENV := venv | ||
PYTHON := $(VENV)/bin/python | ||
|
||
RM := rm -rf | ||
|
||
.PHONY: venv build docs | ||
|
||
venv: | ||
$(RM) $(VENV) | ||
python3 -m venv $(VENV) | ||
$(PYTHON) -m pip install -U pip wheel setuptools | ||
$(PYTHON) -m pip install -U -r requirements.txt -r dev-requirements.txt -r docs/requirements.txt | ||
@echo "Created venv with $$($(PYTHON) --version)" | ||
|
||
clean-build: | ||
$(RM) *.egg-info build dist | ||
|
||
clean-docs: | ||
$(RM) docs/build | ||
$(RM) docs/source/api/bound-methods docs/source/api/methods docs/source/api/types 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-docs | ||
make clean-api | ||
|
||
api: | ||
cd compiler/api && ../../$(PYTHON) compiler.py | ||
cd compiler/errors && ../../$(PYTHON) compiler.py | ||
|
||
docs-live: | ||
make clean-docs | ||
cd compiler/docs && ../../$(PYTHON) compiler.py | ||
$(RM) docs/source/telegram | ||
$(VENV)/bin/sphinx-autobuild \ | ||
--host $(shell ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2) \ | ||
--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: | ||
make clean-build | ||
make clean-api | ||
$(PYTHON) setup.py sdist | ||
$(PYTHON) setup.py bdist_wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
pytest | ||
pytest-asyncio | ||
pytest-cov | ||
pytest-cov | ||
twine |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
sphinx | ||
sphinx_rtd_theme==1.0.0 | ||
sphinx_copybutton | ||
pypandoc | ||
requests | ||
sphinx-autobuild | ||
sphinx-autobuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters