-
Notifications
You must be signed in to change notification settings - Fork 41
/
Makefile
48 lines (34 loc) · 1.29 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
#!/usr/bin/make -f
install-dev-requirements:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv && uv pip install hatch
install-test-requirements:
uv pip install --editable .[test]
prepare-hosts: _services-up
@bash scripts/patch_hosts.sh
_services-up:
docker compose up -d
services-up: _services-up prepare-hosts
services-down:
docker compose down --remove-orphans
setup: develop
pre-commit install
develop: install-dev-requirements install-test-requirements
types:
@echo "Type checking Python files"
.venv/bin/mypy --pretty
@echo ""
test: types
@echo "Running Python tests"
export VIRTUAL_ENV=.venv; .venv/bin/wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- .venv/bin/pytest tests/ || exit 1
@echo ""
safetest:
export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; make test
publish: install-test-requirements
python -m build --sdist .
twine upload --repository mocket dist/mocket-$(shell python -c 'import mocket; print(mocket.__version__)').tar.gz
clean:
rm -rf *.egg-info dist/ requirements.txt Pipfile.lock
find . -type d -name __pycache__ -exec rm -rf {} \;
.PHONY: clean publish safetest test setup develop lint-python test-python _services-up
.PHONY: prepare-hosts services-up services-down install-test-requirements install-dev-requirements