mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
ci: Check Python code with black and mypy
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
This commit is contained in:
parent
44b5a12171
commit
396dd7642e
3 changed files with 17 additions and 16 deletions
|
@ -88,15 +88,17 @@ build:source:
|
||||||
|
|
||||||
# Stage: test
|
# Stage: test
|
||||||
|
|
||||||
test:flake8:
|
test:python:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- flake8 --ignore=E501 python/
|
- cd python
|
||||||
|
- /venv/bin/black --check .
|
||||||
|
- /venv/bin/mypy .
|
||||||
|
- /venv/bin/flake8 .
|
||||||
|
- /venv/bin/pytest -v .
|
||||||
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
|
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
needs:
|
|
||||||
- job: "build:source: [fedora]"
|
|
||||||
|
|
||||||
test:cppcheck:
|
test:cppcheck:
|
||||||
stage: test
|
stage: test
|
||||||
|
@ -217,7 +219,7 @@ pkg:docker:
|
||||||
ARCH: arm64
|
ARCH: arm64
|
||||||
TRIPLET: aarch64-linux-gnu
|
TRIPLET: aarch64-linux-gnu
|
||||||
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
|
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
|
||||||
|
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
# Stage: deploy
|
# Stage: deploy
|
||||||
|
|
|
@ -27,7 +27,7 @@ RUN dnf -y install \
|
||||||
openssh-clients \
|
openssh-clients \
|
||||||
jq nmap-ncat \
|
jq nmap-ncat \
|
||||||
iproute iproute-tc \
|
iproute iproute-tc \
|
||||||
python-pip \
|
python python-devel python-pip \
|
||||||
gdb gdb-gdbserver \
|
gdb gdb-gdbserver \
|
||||||
cppcheck \
|
cppcheck \
|
||||||
xmlto dblatex rubygem-asciidoctor \
|
xmlto dblatex rubygem-asciidoctor \
|
||||||
|
@ -37,8 +37,7 @@ RUN dnf -y install \
|
||||||
# Tools for debugging, coverage, profiling
|
# Tools for debugging, coverage, profiling
|
||||||
RUN pip install \
|
RUN pip install \
|
||||||
gcovr \
|
gcovr \
|
||||||
protobuf \
|
protobuf
|
||||||
flake8
|
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
RUN dnf -y install \
|
RUN dnf -y install \
|
||||||
|
@ -79,6 +78,12 @@ RUN ldconfig
|
||||||
# Workaround for libnl3's search path for netem distributions
|
# Workaround for libnl3's search path for netem distributions
|
||||||
RUN ln -s /usr/lib64/tc /usr/lib/tc
|
RUN ln -s /usr/lib64/tc /usr/lib/tc
|
||||||
|
|
||||||
|
COPY ./python /python
|
||||||
|
RUN python -m venv /venv && \
|
||||||
|
source /venv/bin/activate && \
|
||||||
|
pip install /python[dev] && \
|
||||||
|
rm -r /python
|
||||||
|
|
||||||
# Expose ports for HTTP and WebSocket frontend
|
# Expose ports for HTTP and WebSocket frontend
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
|
@ -112,6 +117,8 @@ RUN --mount=type=cache,id=${DISTRO}-${FEDORA_VERSION}-${ARCH}-${REF},target=/vil
|
||||||
make -j$(nproc) install && \
|
make -j$(nproc) install && \
|
||||||
ldconfig
|
ldconfig
|
||||||
|
|
||||||
|
WORKDIR /villas
|
||||||
|
|
||||||
ENTRYPOINT ["villas"]
|
ENTRYPOINT ["villas"]
|
||||||
|
|
||||||
LABEL \
|
LABEL \
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
"""
|
|
||||||
SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
|
|
||||||
SPDX-License-Identifier: Apache-2.0
|
|
||||||
""" # noqa: E501
|
|
||||||
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
setup()
|
|
Loading…
Add table
Reference in a new issue