forked from testcontainers/testcontainers-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (26 loc) · 1.04 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
PYTHON_VERSIONS = 3.7 3.8 3.9 3.10
REQUIREMENTS = $(addprefix requirements/,${PYTHON_VERSIONS:=.txt})
TESTS = $(addprefix tests/,${PYTHON_VERSIONS})
IMAGES = $(addprefix image/,${PYTHON_VERSIONS})
RUN = docker run --rm -it
.PHONY : docs
# Default target
default : tests/3.8
# Targets to build requirement files
requirements : ${REQUIREMENTS}
${REQUIREMENTS} : requirements/%.txt : requirements.in setup.py
mkdir -p $(dir $@)
${RUN} -w /workspace -v `pwd`:/workspace --platform=linux/amd64 python:$* bash -c \
"pip install pip-tools && pip-compile --resolver=backtracking -v --upgrade -o $@ $<"
# Targets to build docker images
images : ${IMAGES}
${IMAGES} : image/% : requirements/%.txt
docker build --build-arg version=$* -t testcontainers-python:$* .
# Targets to run tests in docker containers
tests : ${TESTS}
${TESTS} : tests/% : image/%
${RUN} -v /var/run/docker.sock:/var/run/docker.sock testcontainers-python:$* \
bash -c "flake8 && pytest -v ${ARGS}"
# Target to build the documentation
docs :
sphinx-build -nW docs docs/_build/html