mail4one/Makefile

65 lines
1.9 KiB
Makefile
Raw Normal View History

2024-01-12 10:55:09 -05:00
# Needs python3 >= 3.9, sed, git for build, docker for tests
.PHONY: build
build: clean
python3 -m pip install -r requirements.txt --no-compile --target build
2023-06-13 20:45:26 -04:00
cp -r mail4one/ build/
2023-06-23 21:30:31 -04:00
sed -i "s/DEVELOMENT/$(shell scripts/get_version.sh)/" build/mail4one/version.py
find build -name "*.pyi" -o -name "py.typed" | xargs -I typefile rm typefile
rm -rf build/bin build/aiosmtpd/{docs,tests,qa}
rm -rf build/mail4one/__pycache__
2023-06-14 12:00:23 -04:00
rm -rf build/*.dist-info
python3 -m zipapp \
2023-06-13 20:45:26 -04:00
--output mail4one.pyz \
--python "/usr/bin/env python3" \
--main mail4one.server:main \
--compress build
.PHONY: clean
2023-06-13 20:45:26 -04:00
clean:
rm -rf build
rm -rf mail4one.pyz
2023-06-26 17:20:50 -04:00
.PHONY: docker-tests
docker-tests:
2023-06-28 17:15:18 -04:00
docker run --pull=always -v `pwd`:/app -w /app --rm python:3.11-alpine sh scripts/runtests.sh
docker run --pull=always -v `pwd`:/app -w /app --rm python:3.10-alpine sh scripts/runtests.sh
2023-12-20 17:21:57 -05:00
docker run --pull=always -v `pwd`:/app -w /app --rm python:3.12 sh scripts/runtests.sh
2023-06-28 17:15:18 -04:00
docker run --pull=always -v `pwd`:/app -w /app --rm python:3.11 sh scripts/runtests.sh
docker run --pull=always -v `pwd`:/app -w /app --rm python:3.10 sh scripts/runtests.sh
docker run --pull=always -v `pwd`:/app -w /app --rm python:3.9 sh scripts/runtests.sh
# ============================================================================
2024-01-12 10:55:09 -05:00
# Below targets for devs. Need pipenv, black installed
requirements.txt: Pipfile.lock
pipenv requirements > requirements.txt
.PHONY: format
2023-06-26 17:20:50 -04:00
format:
2024-04-01 11:14:20 -04:00
black mail4one/*py tests/*py
.PHONY: build-dev
build-dev: requirements.txt build
.PHONY: setup
setup:
pipenv install
.PHONY: cleanup
cleanup:
pipenv --rm
.PHONY: update
2023-12-20 17:21:57 -05:00
update:
rm requirements.txt Pipfile.lock
pipenv update
pipenv requirements > requirements.txt
.PHONY: shell
shell:
MYPYPATH=$(shell ls -d `pipenv --venv`/lib/python3*/site-packages) pipenv shell
.PHONY: test
test:
pipenv run python -m unittest discover