|
1 | | -FROM ubuntu:22.04 |
2 | | -LABEL maintainer= "[email protected]" |
| 1 | +FROM alpine:3.19.0 |
3 | 2 |
|
4 | | -RUN apt-get update \ |
5 | | - && DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \ |
6 | | - ca-certificates \ |
7 | | - cmake \ |
8 | | - gcc \ |
9 | | - g++ \ |
10 | | - git \ |
11 | | - libopus-dev \ |
12 | | - libsodium-dev \ |
13 | | - libvpx-dev \ |
14 | | - ninja-build \ |
15 | | - pkg-config \ |
16 | | - python3 \ |
17 | | - python3-dev \ |
18 | | - python3-pip \ |
19 | | - && apt-get clean \ |
20 | | - && rm -rf /var/lib/apt/lists/* \ |
21 | | - && pip3 install --no-cache-dir cython cython-lint mypy |
| 3 | +RUN ["apk", "add", "--no-cache", \ |
| 4 | + "cmake", \ |
| 5 | + "g++", \ |
| 6 | + "gcc", \ |
| 7 | + "git", \ |
| 8 | + "libsodium-dev", \ |
| 9 | + "libvpx-dev", \ |
| 10 | + "linux-headers", \ |
| 11 | + "opus-dev", \ |
| 12 | + "pkgconfig", \ |
| 13 | + "py3-pip", \ |
| 14 | + "python3", \ |
| 15 | + "python3-dev", \ |
| 16 | + "samurai"] |
| 17 | +RUN ["python3", "-m", "venv", "/path/to/venv"] |
| 18 | + |
| 19 | +RUN . /path/to/venv/bin/activate \ |
| 20 | + && pip3 install --no-cache-dir coverage cython cython-lint mypy |
22 | 21 |
|
23 | 22 | WORKDIR /build |
24 | 23 | RUN git clone --depth=1 --recursive https://github.com/TokTok/c-toxcore /build/c-toxcore \ |
25 | 24 | && cmake -GNinja -B/build/c-toxcore/_build -H/build/c-toxcore \ |
26 | 25 | -DBOOTSTRAP_DAEMON=OFF \ |
27 | 26 | -DENABLE_STATIC=OFF \ |
28 | 27 | -DMUST_BUILD_TOXAV=ON \ |
29 | | - && cmake --build /build/c-toxcore/_build --target install --parallel "$(nproc)" \ |
30 | | - && ldconfig |
| 28 | + && cmake --build /build/c-toxcore/_build --target install |
31 | 29 |
|
32 | 30 | COPY pytox /build/pytox |
33 | 31 |
|
34 | | -RUN cython-lint --max-line-length 300 $(find pytox -name "*.pyx" -or -name "*.pxd") |
35 | | -RUN cython -I. $(find pytox -name "*.pyx") |
| 32 | +RUN . /path/to/venv/bin/activate \ |
| 33 | + && find pytox -name "*.pyx" -or -name "*.pxd" -print0 | xargs -0 cython-lint --max-line-length 300 \ |
| 34 | + && find pytox -name "*.pyx" -print0 | xargs -0 cython -I. |
36 | 35 |
|
37 | 36 | COPY setup.py /build/ |
38 | | -RUN python3 setup.py install \ |
39 | | - && python3 -c 'import pytox.toxcore.tox as core; print(core.__doc__)' |
| 37 | +ENV CFLAGS="-DCYTHON_TRACE=1 -O0" |
| 38 | +RUN . /path/to/venv/bin/activate \ |
| 39 | + && pip install --no-cache-dir . \ |
| 40 | + && python3 -c 'import pytox.toxcore.tox as core; print(core.Tox_Ptr.__init__.__doc__)' |
40 | 41 |
|
| 42 | +COPY .coveragerc /build/ |
41 | 43 | COPY test /build/test |
42 | | -RUN python3 test/tox_test.py |
| 44 | +RUN . /path/to/venv/bin/activate \ |
| 45 | + && coverage run -m unittest discover -v -p "*_test.py" |
| 46 | +RUN . /path/to/venv/bin/activate \ |
| 47 | + && coverage report -m |
0 commit comments