diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index ac02b7d..f9d7b2c 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -21,14 +21,16 @@ jobs: - name: Git clone uses: actions/checkout@v4 - name: Build dftlib from Dockerfile - run: docker build -t volkm/dftlib . --build-arg STORMPY_BASE=movesrwth/stormpy:${{ matrix.stormpyImg }} + run: | + docker build -t volkm/dftlib . \ + --build-arg STORMPY_BASE=movesrwth/stormpy:${{ matrix.stormpyImg }} \ + --build-arg options="[smt,stormpy,test]" - name: Run Docker run: docker run -d -it --name ci volkm/dftlib - - name: Build optional dftlib libraries - run: docker exec ci bash -c "cd /opt/dftlib; pip install -e '.[smt,stormpy,test]'" - name: Run tests run: docker exec ci bash -c "cd /opt/dftlib; pytest" + BuildTest: name: Test (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest diff --git a/.github/workflows/formatapply.yml b/.github/workflows/formatapply.yml index ab905f0..e759dab 100644 --- a/.github/workflows/formatapply.yml +++ b/.github/workflows/formatapply.yml @@ -1,6 +1,7 @@ -name: apply-code-format +name: Apply code format -on: [ workflow_dispatch ] +on: + workflow_dispatch: jobs: build: diff --git a/.github/workflows/formatcheck.yml b/.github/workflows/formatcheck.yml index 4f19ae1..ac993e2 100644 --- a/.github/workflows/formatcheck.yml +++ b/.github/workflows/formatcheck.yml @@ -1,6 +1,9 @@ -name: check-code-format +name: Check code format -on: [push, pull_request, workflow_dispatch] +on: + push: + pull_request: + workflow_dispatch: jobs: build: diff --git a/Dockerfile b/Dockerfile index e17a636..62bdaad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,23 @@ -# Base Dockerfile for using dftlib -################################## +# Dockerfile for dftlib +####################### # The Docker image can be built by executing: # docker build -t yourusername/dftlib . -# A different base image can be set from the commandline with: +# A different stormpy base image can be set from the commandline with: # --build-arg STORMPY_BASE= # Set stormpy base image ARG STORMPY_BASE=movesrwth/stormpy:stable FROM $STORMPY_BASE -MAINTAINER Matthias Volk +LABEL org.opencontainers.image.authors="m.volk@tue.nl" + + +# Configuration arguments +######################### +# The arguments can be set from the commandline with: +# --build-arg = + +# Optional support to install for dftlib, such as '[test,stormpy]' +ARG options="" # Set-up virtual environment @@ -28,4 +37,4 @@ WORKDIR /opt/dftlib COPY . . # Build dftlib -RUN pip install . +RUN pip install -v .$options diff --git a/dftlib/io/latex.py b/dftlib/io/latex.py index bc01cc8..71321a7 100644 --- a/dftlib/io/latex.py +++ b/dftlib/io/latex.py @@ -65,7 +65,7 @@ def generate_tikz_node(element, is_tle=False): label_anchor = "east" label = name # Replace underscores - label = label.replace("_", "\_") + label = label.replace("_", r"\_") if is_tle: label = "\\underline{{{}}}".format(label) s += "\t\\node[labelbox] ({0}_label) at ({0}.{1}) {{{2}}};\n".format(name, label_anchor, label)