-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
36 lines (24 loc) · 1.02 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
VERSION != grep -Po 'version = "\K[^"]*' pyproject.toml
TESTENV = carthage-$(VERSION)-build-testenv
DIST = dist/carthage-$(VERSION).tar.gz
WHEEL = dist/carthage-$(VERSION)-py3-none-any.whl
dist: clean $(WHEEL) $(DIST)
$(DIST) $(WHEEL):
python3 -m build .
build: dist
test_env: $(DIST) $(WHEEL)
cp --reflink=auto $(DIST) build_test/carthage.tar.gz
-rm -f build_test/*whl
cp --reflink=auto $(WHEEL) build_test
podman build -t carthage:test build_test
test: test_env
podman run -ti --rm --privileged carthage:test sh -c 'set -e&&cd /carthage/*&&pytest-3 --carthage-config=/authorized.yml -k "not no_rootless and not test_pki" tests'
build_docs:
podman run -ti --rm --privileged -v $(PWD):/carthage carthage:test sh -c 'set -e&&cd /carthage/docs&&ls&&./setup_docs.sh'
destroy:
-podman rmi carthage:test
- rm -f build_test/*whl build_test/carthage.tar.gz
clean: destroy
rm -rf carthage.egg-info dist tmp
-find . -name __pycache__ -exec rm -rf '{}' \; 2>/dev/null
.PHONY : clean destroy test dist build test_env build_docs