-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
52 lines (37 loc) · 1.34 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
49
50
51
52
#!/usr/bin/make -f
VENV_PATH = .venv/bin
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_PATH)/mypy --pretty
@echo ""
test: types
@echo "Running Python tests"
uv pip uninstall pook || true
$(VENV_PATH)/wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- $(VENV_PATH)/pytest
uv pip install pook && $(VENV_PATH)/pytest tests/test_pook.py && uv pip uninstall pook
@echo ""
safetest:
export SKIP_TRUE_REDIS=1; export SKIP_TRUE_HTTP=1; $(VENV_PATH)/pytest
publish: clean install-test-requirements
uv build --package mocket --sdist --wheel
uv publish
clean:
rm -rf .coverage *.egg-info dist/ requirements.txt uv.lock || true
find . -type d -name __pycache__ -exec rm -rf {} \; || true
.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