File: Makefile

package info (click to toggle)
python-twilio 7.7.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,976 kB
  • sloc: python: 148,884; makefile: 50; sh: 2
file content (63 lines) | stat: -rw-r--r-- 1,934 bytes parent folder | download
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
62
63
.PHONY: clean install analysis test test-install develop docs docs-install

venv:
	@python --version || (echo "Python is not installed, Python 3.6+"; exit 1);
	virtualenv --python=python venv

install: venv
	. venv/bin/activate; pip install .

test-install: install
	. venv/bin/activate; pip install -r tests/requirements.txt

develop: venv
	. venv/bin/activate; pip install -e . --use-mirrors
	. venv/bin/activate; pip install -r tests/requirements.txt

analysis:
	. venv/bin/activate; flake8 --ignore=E123,E126,E128,E501,W391,W291,W293,F401 tests
	. venv/bin/activate; flake8 --ignore=E402,F401,W391,W291,W293 twilio --max-line-length=300

test: analysis
	. venv/bin/activate; pytest tests

test-with-coverage:
	. venv/bin/activate; \
  pytest --cov=twilio tests; \
  coverage xml --omit 'twilio/rest/*' -o coverage.xml

docs-install:
	. venv/bin/activate; pip install -r tests/requirements.txt

docs:
	-rm -rf docs/source/_rst
	-rm -rf docs/build
	. venv/bin/activate; sphinx-apidoc -f twilio -o docs/source/_rst
	. venv/bin/activate; sphinx-build -b html -c ./docs -d docs/build/doctrees . docs/build/html


release:
	. venv/bin/activate; python setup.py sdist upload
	. venv/bin/activate; python setup.py bdist_wheel upload

build: test-install
	. venv/bin/activate; python setup.py sdist
	. venv/bin/activate; python setup.py bdist_wheel

clean:
	rm -rf venv

nopyc:
	find . -name \*.pyc -delete

API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
docker-build:
	docker build -t twilio/twilio-python .
	docker tag twilio/twilio-python twilio/twilio-python:${GITHUB_TAG}
	docker tag twilio/twilio-python twilio/twilio-python:apidefs-${API_DEFINITIONS_SHA}
	docker tag twilio/twilio-python twilio/twilio-python:latest

docker-push:
	docker push twilio/twilio-python:${GITHUB_TAG}
	docker push twilio/twilio-python:apidefs-${API_DEFINITIONS_SHA}
	docker push twilio/twilio-python:latest