forked from am-flow/protobunny
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (102 loc) · 4.84 KB
/
Makefile
File metadata and controls
125 lines (102 loc) · 4.84 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
PATH := $(PATH):$(HOME)/.local/bin
SHELL := env PATH=$(PATH) /bin/bash
help : Makefile
@sed -n 's/^##//p' $<
.PHONY: build
build:
uv sync --all-extas
compile:
uv run protobunny generate
make format
.PHONY: format
format:
uv run ruff check . --select I --fix
uv run ruff format .
uv run toml-sort -i ./pyproject.toml --sort-first project
.PHONY: lint
lint:
uv run ruff check . --diff
uv run ruff format . --check --diff
uv run toml-sort --check ./pyproject.toml --sort-first project
uv run yamllint -d "{extends: relaxed, rules: {line-length: {max: 120}}}" .
.PHONY: test integration-test t
test:
uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
uv run pytest tests/ -m "not integration"
t:
# Usage: make t t=tests/test_connection.py::test_sync_get_message_count
PYTHONASYNCIODEBUG=1 PYTHONBREAKPOINT=ipdb.set_trace uv run pytest ${t} -s -vvvv --durations=0
integration-test:
uv run pytest tests/ -m "integration" -k rabbitmq ${t}
uv run pytest tests/ -m "integration" -k redis ${t}
uv run pytest tests/ -m "integration" -k python ${t}
uv run pytest tests/ -m "integration" -k mosquitto ${t}
uv run pytest tests/ -m "integration" -k nats ${t} # run ./nats-server -js -sd nats_storage
integration-test-py310:
source .venv310/bin/activate
UV_PROJECT_ENVIRONMENT=.venv310 uv sync --all-extras --dev
UV_PROJECT_ENVIRONMENT=.venv310 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
UV_PROJECT_ENVIRONMENT=.venv310 uv run pytest ${t} -m "integration" -vvv -s
integration-test-py311:
source .venv311/bin/activate
UV_PROJECT_ENVIRONMENT=.venv311 uv sync --all-extras --dev
UV_PROJECT_ENVIRONMENT=.venv311 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
UV_PROJECT_ENVIRONMENT=.venv311 uv run pytest ${t} -m "integration" -vvv -s
integration-test-py312:
source .venv312/bin/activate
UV_PROJECT_ENVIRONMENT=.venv312 uv sync --all-extras --dev
UV_PROJECT_ENVIRONMENT=.venv312 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
UV_PROJECT_ENVIRONMENT=.venv312 uv run pytest ${t} -m "integration" -vvv -s
integration-test-py313:
source .venv313/bin/activate
UV_PROJECT_ENVIRONMENT=.venv313 uv sync --all-extras --dev
UV_PROJECT_ENVIRONMENT=.venv313 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
UV_PROJECT_ENVIRONMENT=.venv313 uv run pytest ${t} -m "integration" -vvv -s
test-py310:
source .venv310/bin/activate
VIRTUAL_ENV=.venv310 UV_PROJECT_ENVIRONMENT=.venv310 uv sync --all-extras --dev
VIRTUAL_ENV=.venv310 UV_PROJECT_ENVIRONMENT=.venv310 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
VIRTUAL_ENV=.venv310 PYTHONASYNCIODEBUG=1 UV_PROJECT_ENVIRONMENT=.venv310 uv run pytest tests/ -m "not integration" -vvv -s
test-py311:
source .venv311/bin/activate
VIRTUAL_ENV=.venv311 UV_PROJECT_ENVIRONMENT=.venv311 uv sync --all-extras --dev
VIRTUAL_ENV=.venv311 UV_PROJECT_ENVIRONMENT=.venv311 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
VIRTUAL_ENV=.venv311 PYTHONASYNCIODEBUG=1 UV_PROJECT_ENVIRONMENT=.venv311 uv run pytest tests/ -m "not integration" -vvv -s
test-py312:
source .venv312/bin/activate
VIRTUAL_ENV=.venv312 UV_PROJECT_ENVIRONMENT=.venv312 uv sync --all-extras --dev
VIRTUAL_ENV=.venv312 UV_PROJECT_ENVIRONMENT=.venv312 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
VIRTUAL_ENV=.venv312 UV_PROJECT_ENVIRONMENT=.venv312 uv run pytest tests/ -m "not integration" -vvv -s
test-py313:
source .venv313/bin/activate
VIRTUAL_ENV=.venv313 UV_PROJECT_ENVIRONMENT=.venv313 uv sync --all-extras --dev
VIRTUAL_ENV=.venv313 UV_PROJECT_ENVIRONMENT=.venv313 uv run protobunny generate -I tests/proto --python_betterproto_out=tests tests/proto/*.proto
make format
VIRTUAL_ENV=.venv313 UV_PROJECT_ENVIRONMENT=.venv313 uv run pytest tests/ -m "not integration" -vvv -s
# Releasing
.PHONY: docs clean build-package publish-test publish-pypi copy-md
copy-md:
cp ./QUICK_START.md docs/source/quick_start.md
cp ./RECIPES.md docs/source/recipes.md
docs: copy-md
uv run sphinx-build -b html docs/source docs/build/html
clean:
rm -rf dist build *.egg-info
build-package: clean
uv build
publish-test: build-package
$(eval SECTION := testpypi)
$(eval PYPI_TOKEN := $(shell sed -n '/^\[$(SECTION)\]/,/^\[.*\]/ { /password *=/ s/.*= *//p; }' $(HOME)/.pypirc))
uv publish --publish-url https://test.pypi.org/legacy/ --token $(PYPI_TOKEN)
publish: build-package
$(eval SECTION := pypi)
$(eval PYPI_TOKEN := $(shell sed -n '/^\[$(SECTION)\]/,/^\[.*\]/ { /password *=/ s/.*= *//p; }' $(HOME)/.pypirc))
uv publish --token $(PYPI_TOKEN)