-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
47 lines (40 loc) · 1.31 KB
/
Dockerfile
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
FROM alpine:3.19.0
RUN ["apk", "add", "--no-cache", \
"cmake", \
"g++", \
"gcc", \
"git", \
"libsodium-dev", \
"libvpx-dev", \
"linux-headers", \
"opus-dev", \
"pkgconfig", \
"py3-pip", \
"python3", \
"python3-dev", \
"samurai"]
RUN ["python3", "-m", "venv", "/path/to/venv"]
RUN . /path/to/venv/bin/activate \
&& pip3 install --no-cache-dir coverage cython cython-lint mypy
WORKDIR /build
RUN git clone --depth=1 --recursive https://github.com/TokTok/c-toxcore /build/c-toxcore \
&& cmake -GNinja -B/build/c-toxcore/_build -H/build/c-toxcore \
-DBOOTSTRAP_DAEMON=OFF \
-DENABLE_STATIC=OFF \
-DMUST_BUILD_TOXAV=ON \
&& cmake --build /build/c-toxcore/_build --target install
COPY pytox /build/pytox
RUN . /path/to/venv/bin/activate \
&& find pytox -name "*.pyx" -or -name "*.pxd" -print0 | xargs -0 cython-lint --max-line-length 300 \
&& find pytox -name "*.pyx" -print0 | xargs -0 cython -I.
COPY setup.py /build/
ENV CFLAGS="-DCYTHON_TRACE=1 -O0"
RUN . /path/to/venv/bin/activate \
&& pip install --no-cache-dir . \
&& python3 -c 'import pytox.toxcore.tox as core; print(core.Tox_Ptr.__init__.__doc__)'
COPY .coveragerc /build/
COPY test /build/test
RUN . /path/to/venv/bin/activate \
&& coverage run -m unittest discover -v -p "*_test.py"
RUN . /path/to/venv/bin/activate \
&& coverage report -m --fail-under=70