| 1 |
|
| 2 |
VERSION = $(shell python3 setup.py --version) |
| 3 |
RXVERSION = $(shell python3 setup.py --version | sed 's/\./[.]/g') |
| 4 |
TAG = v$(VERSION) |
| 5 |
NEWS = NEWS.rst |
| 6 |
|
| 7 |
all: lint test |
| 8 |
|
| 9 |
test: |
| 10 |
tox -e py38 |
| 11 |
|
| 12 |
lint: |
| 13 |
tox -q -e lint |
| 14 |
|
| 15 |
xlint: |
| 16 |
tox -q -e xlint |
| 17 |
|
| 18 |
clean: |
| 19 |
rm -rf build *.egg-info */__pycache__ tests/*.pyc |
| 20 |
rm -rf .pybuild MANIFEST |
| 21 |
|
| 22 |
xclean: clean |
| 23 |
rm -rf .tox dist |
| 24 |
|
| 25 |
sdist: |
| 26 |
python3 setup.py -q sdist |
| 27 |
|
| 28 |
checkver: |
| 29 |
@echo "Checking version" |
| 30 |
@grep -Eq '^\w+ v$(RXVERSION)\b' $(NEWS) \ |
| 31 |
|| { echo "Version '$(VERSION)' not in $(NEWS)"; exit 1; } |
| 32 |
@echo "Checking git repo" |
| 33 |
@git diff --stat --exit-code || { echo "ERROR: Unclean repo"; exit 1; } |
| 34 |
|
| 35 |
release: checkver |
| 36 |
git tag $(TAG) |
| 37 |
git push github $(TAG):$(TAG) |
| 38 |
|
| 39 |
unrelease: |
| 40 |
git push github :$(TAG) |
| 41 |
git tag -d $(TAG) |
| 42 |
|
| 43 |
shownote: |
| 44 |
awk -v VER="v$(VERSION)" -f etc/note.awk $(NEWS) \ |
| 45 |
| pandoc -f rst -t gfm --wrap=none |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
pull-python: |
| 52 |
docker pull python:3.11-slim-bookworm |
| 53 |
docker pull python:3.10-slim-bookworm |
| 54 |
docker pull python:3.9-slim-bookworm |
| 55 |
docker pull python:3.8-slim-bookworm |
| 56 |
docker pull python:3.7-slim-bookworm |
| 57 |
|
| 58 |
pull-postgres: |
| 59 |
docker pull postgres:15-bookworm |
| 60 |
docker pull postgres:14-bookworm |
| 61 |
docker pull postgres:13-bookworm |
| 62 |
docker pull postgres:12-bookworm |
| 63 |
docker pull postgres:11-bookworm |
| 64 |
|
| 65 |
prune: |
| 66 |
docker image prune -f |
| 67 |
docker image ls |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
COMPOSE_COMBO = docker compose -f etc/compose-combo.yml --project-directory . |
| 74 |
|
| 75 |
test-pg15-build: |
| 76 |
$(COMPOSE_COMBO) build test-pg15 |
| 77 |
|
| 78 |
test-pg15-shell: |
| 79 |
$(COMPOSE_COMBO) run --entrypoint bash test-pg15 |
| 80 |
|
| 81 |
test-pg10 test-pg11 test-pg12 test-pg13 test-pg14 test-pg15: |
| 82 |
$(COMPOSE_COMBO) up --build $@ |
| 83 |
|
| 84 |
test-all: |
| 85 |
$(COMPOSE_COMBO) up --build |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
COMPOSE_SPLIT = docker compose -f etc/compose-split.yml --project-directory . |
| 92 |
|
| 93 |
dtest-db-build: |
| 94 |
$(COMPOSE_SPLIT) build db |
| 95 |
|
| 96 |
dtest-db-shell: |
| 97 |
$(COMPOSE_SPLIT) run --entrypoint bash db |
| 98 |
|
| 99 |
dtest-db-up: |
| 100 |
$(COMPOSE_SPLIT) up --build db |
| 101 |
|
| 102 |
dtest-worker-build: |
| 103 |
$(COMPOSE_SPLIT) build test |
| 104 |
|
| 105 |
dtest-worker-shell: |
| 106 |
$(COMPOSE_SPLIT) run --entrypoint bash test |
| 107 |
|
| 108 |
dtest-worker-up: |
| 109 |
$(COMPOSE_SPLIT) up --build test |
| 110 |
|
| 111 |
dtest-split-run: |
| 112 |
$(COMPOSE_SPLIT) up |
| 113 |
|