-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (33 loc) · 1.11 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
.PHONY: test clean upload versions
SHELL = bash
# if sandbox_dir not provided via params, create a new temporary dir for this run
ifndef sandbox_dir
sandbox_dir := $(shell mktemp -d)
global_setup := 1
endif
# required: bash, (any) python, pip, virtualenv
# optional: python2, python3, gnu coreutils
versions:
@echo Versions used:
@echo ----
@bash --version | head -1
@echo python: $$(python -V 2>&1)
@echo python2: $$(python2 -V 2>&1)
@echo python3: $$(python3 -V 2>&1)
@pip -V
@echo virtualenv: $$(virtualenv --version)
@dpkg-query -W coreutils || true
@pkg query %n-%v coreutils || true
@echo ----
test: versions tests_setup tests tests_teardown
tests_setup: tests/global_setup.sh
@if [ "$global_setup" ] && [ -x "$<" ]; then env sandbox_dir=${sandbox_dir} bash "$<"; fi
tests_teardown: tests/global_teardown.sh
@if [ "$global_setup" ] && [ -x "$<" ]; then env sandbox_dir=${sandbox_dir} bash "$<"; fi
test_%: tests/test_%
@env sandbox_dir=${sandbox_dir} bash "$<"
tests: $(patsubst tests/%,%,$(wildcard tests/test_*))
upload:
python setup.py sdist bdist_wheel upload
clean:
rm -rf build/ dist/ *.egg-info/