-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (34 loc) · 1.06 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
SHELL := /bin/bash
PROJECT_VERSION := $(shell grep -m1 version pyproject.toml | cut -d\" -f2)
.ONESHELL:
all: build test-dist
test:
python -m unittest discover -s tests.disclosurecheck -t .
build: clean
@echo "Initializing environment..."
python -mvenv _tmpvenv
source _tmpvenv/bin/activate
pip install -r requirements.txt
@echo "Building distribution..."
python -mbuild .
@echo "Building container image..."
docker build -t ghcr.io/scovetta/disclosurecheck:latest -t ghcr.io/scovetta/disclosurecheck:$(PROJECT_VERSION) .
echo "Cleaning up temporary environment"
deactivate
rm -rf _tmpvenv
test-dist: build
@echo "Validating distribution..."
python -mvenv _tmpvenv
source _tmpvenv/bin/activate
pip install dist/disclosurecheck-*.tar.gz
disclosurecheck --help
echo "Cleaning up temporary environment"
deactivate
rm -rf _tmpvenv
echo "Validating image..."
docker run --rm -t ghcr.io/scovetta/disclosurecheck:$(PROJECT_VERSION) --help
clean:
@echo "Cleaning up temporary environment"
deactivate || true
rm -rf dist/* || true
rm -rf _tmpvenv || true