forked from artsmolin/pythogen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.69 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
.PHONY: tests
clean:
@rm -rf build dist .eggs *.egg-info
@rm -rf .coverage coverage.xml htmlcov report.xml .tox
@find . -type d -name '.mypy_cache' -exec rm -rf {} +
@find . -type d -name '__pycache__' -exec rm -rf {} +
@find . -type d -name '*pytest_cache*' -exec rm -rf {} +
@find . -type f -name "*.py[co]" -exec rm -rf {} +
install-pre-commit:
@pre-commit install && pre-commit install --hook-type commit-msg
format: install-pre-commit clean
pre-commit run --all-files
async-client:
@python pythogen/main.py tests/docs/openapi.yaml tests/clients/async_client.py
clients:
@# async clients for tests
@python pythogen/main.py tests/docs/openapi.yaml tests/clients/async_client.py
@python pythogen/main.py tests/docs/openapi.yaml tests/clients/async_client_with_metrics.py --metrics
@python pythogen/main.py tests/docs/openapi.yaml tests/clients/async_client_with_headers.py --headers X-API-KEY,X-API-SECRET
@# sync clients for tests
@python pythogen/main.py tests/docs/openapi.yaml tests/clients/sync_client.py --sync
@python pythogen/main.py tests/docs/openapi.yaml tests/clients/sync_client_with_metrics.py --sync --metrics
@# clients for examles
@python pythogen/main.py examples/petstore/openapi.yaml examples/petstore/client_async.py
@python pythogen/main.py examples/petstore/openapi.yaml examples/petstore/client_sync.py --sync
broken-clients:
@python pythogen/main.py tests/docs/openapi-with-too-much-allof.yaml tests/clients/broken_async_client.py
requirements:
pip install --upgrade pip
poetry install --remove-untracked
make install-pre-commit
tests:
docker-compose up -d --build mock_server && \
pytest --cov=pythogen tests/ -sq -v
docker-compose down
serve-docs:
mkdocs serve