forked from crashvb/docker-sign-verify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
63 lines (43 loc) · 1.45 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/make -f
-include makefile.config
.PHONY: black build clean default deploy purge sign test test_code test_package venv verify
tmpdir:=$(shell mktemp --directory)
default: build
black:
python -m black .
build:
python setup.py bdist_wheel sdist
sign:
find dist -type f \( -iname "*.tar.gz" -o -iname "*.whl" \) -exec gpg --armor --detach-sig --sign {} \;
verify:
find dist -type f -iname "*.asc" -exec gpg --verify {} \;
test:
python -m pytest --log-cli-level info $(args)
test_all:
python -m pytest --log-cli-level info --allow-online-modification $(args)
test_all_verbose:
python -m pytest -r sx --log-cli-level debug --allow-online-modification $(args)
test_code:
# Note: https://github.com/PyCQA/pylint/issues/289
python -m pylint --disable C0330,R0801 --max-line-length=120 docker_sign_verify tests
test_package: build
python -m venv $(tmpdir)
cd /tmp
$(tmpdir)/bin/python -m pip install $(PWD)/dist/*.tar.gz pytest
$(tmpdir)/bin/python -m pytest
rm --force --recursive $(tmpdir)
deploy: clean build sign
python -m twine upload dist/*
deploy_test: clean build sign
python -m twine upload --repository testpypi dist/*
.venv:
python -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install --editable .[dev]
venv: .venv
clean:
rm --force --recursive .eggs build dist *.egg-info
find . -type f -name "*.pyc" -delete
find . -type d -name __pycache__ -delete
purge: clean
rm --force --recursive .venv