File: Makefile

package info (click to toggle)
getmail6 6.19.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,124 kB
  • sloc: python: 6,634; sh: 897; makefile: 73
file content (82 lines) | stat: -rw-r--r-- 2,234 bytes parent folder | download
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
# docs/COPYING 2a + DRY: https://github.com/getmail6/getmail6
# Please refer to the git history regarding who changed what and when in this file.

# Needs Docker Daemon running
# systemctl start docker

.PHONY: doc
doc:
	links -dump docs/documentation.html > docs/documentation.txt
	links -dump docs/configuration.html > docs/configuration.txt
	links -dump docs/faq.html > docs/faq.txt
	links -dump docs/troubleshooting.html > docs/troubleshooting.txt

.PHONY: cleanmailserver
cleanmailserver:
	[ -d /tmp/mailserver/ ] && (cd /tmp/mailserver && docker-compose down) || true
	[ -d /tmp/mailserver/ ] && sudo rm -rf /tmp/mailserver || true

.PHONY: dockertest
dockertest:
	cd test && ./prepare_test.sh
	cd /tmp/mailserver && test/bats/bin/bats test/test_getmail_with_docker_mailserver.bats

.PHONY: fortest
fortest:
	pip install pytest

.PHONY: unittests
unittests: fortest
	pytest test/test.py test/test_mock_servers.py

.PHONY: test
test: unittests cleanmailserver dockertest
	cd /tmp/mailserver && docker-compose down

.PHONY: lint
lint:
	ruff check .

.PHONY: check
check: lint
	/usr/bin/man -l docs/getmail.1
	/usr/bin/man -l docs/getmails.1
	/usr/bin/man -l docs/getmail_fetch.1
	/usr/bin/man -l docs/getmail_maildir.1
	/usr/bin/man -l docs/getmail_mbox.1
	restview --long-description --strict

.PHONY: dist
dist: doc
	echo "need sudo to create wheel"
	sudo python setup.py bdist_wheel sdist

# ./pypi.sh to upload to PYPI no more needed due to
# .github/workflows/publish.yml
# .github/workflows/publish6.yml
.PHONY: up6
up6: dist
	twine upload dist/`ls dist -rt *.whl | tail -1` dist/`ls dist -rt *.tar.gz | tail -1` -u__token__ -p`pass show pypi.org/getmail6_api_token`

.PHONY: up
up: dist
	twine upload dist/`ls dist -rt *.whl | tail -1` dist/`ls dist -rt *.tar.gz | tail -1` -u__token__ -p`pass show pypi.org/getmail_api_token`

.PHONY: tag
tag: dist
	$(eval TAGMSG="v$(shell ./getmail --version | cut -d ' ' -f 2)")
	echo $(TAGMSG)
	git tag -s $(TAGMSG) -m"$(TAGMSG)"
	git verify-tag $(TAGMSG)
	git push origin $(TAGMSG) --follow-tags

.PHONY: cleandocker
cleandocker:
	docker network prune
	docker rm -vf $$(docker ps -aq)
	docker rmi -f $$(docker images -aq)

.PHONY: log
log:
	cd /tmp/mailserver && docker compose logs