mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +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
b1eb40a8b3
commit
ff2d24962f
3 changed files with 17 additions and 16 deletions
|
@ -88,15 +88,17 @@ build:source:
|
|||
|
||||
# Stage: test
|
||||
|
||||
test:flake8:
|
||||
test:python:
|
||||
stage: test
|
||||
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}
|
||||
tags:
|
||||
- docker
|
||||
needs:
|
||||
- job: "build:source: [fedora]"
|
||||
|
||||
test:cppcheck:
|
||||
stage: test
|
||||
|
@ -217,7 +219,7 @@ pkg:docker:
|
|||
ARCH: arm64
|
||||
TRIPLET: aarch64-linux-gnu
|
||||
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
|
||||
|
||||
|
||||
needs: []
|
||||
|
||||
# Stage: deploy
|
||||
|
|
|
@ -27,7 +27,7 @@ RUN dnf -y install \
|
|||
openssh-clients \
|
||||
jq nmap-ncat \
|
||||
iproute iproute-tc \
|
||||
python-pip \
|
||||
python python-devel python-pip \
|
||||
gdb gdb-gdbserver \
|
||||
cppcheck \
|
||||
xmlto dblatex rubygem-asciidoctor \
|
||||
|
@ -37,8 +37,7 @@ RUN dnf -y install \
|
|||
# Tools for debugging, coverage, profiling
|
||||
RUN pip install \
|
||||
gcovr \
|
||||
protobuf \
|
||||
flake8
|
||||
protobuf
|
||||
|
||||
# Dependencies
|
||||
RUN dnf -y install \
|
||||
|
@ -79,6 +78,12 @@ RUN ldconfig
|
|||
# Workaround for libnl3's search path for netem distributions
|
||||
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 80
|
||||
EXPOSE 443
|
||||
|
@ -112,6 +117,8 @@ RUN --mount=type=cache,id=${DISTRO}-${FEDORA_VERSION}-${ARCH}-${REF},target=/vil
|
|||
make -j$(nproc) install && \
|
||||
ldconfig
|
||||
|
||||
WORKDIR /villas
|
||||
|
||||
ENTRYPOINT ["villas"]
|
||||
|
||||
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