Skip to content

Commit 136a6ac

Browse files
committed
Fix Docker build
Signed-off-by: Aarni Koskela <[email protected]>
1 parent 812bd0c commit 136a6ac

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ echo\n\' > /browser && \
2626
chmod +x /browser && \
2727
curl https://bootstrap.pypa.io/get-pip.py | python3 - pip==18.1 && \
2828
pip3 install --no-cache-dir --no-build-isolation cython && \
29-
sed -i 's/parser.add_argument("--backend",/parser.add_argument("--backend", default="Agg",/' /root/src/labours/labours.py && \
29+
sed -i 's/DEFAULT_MATPLOTLIB_BACKEND = None/DEFAULT_MATPLOTLIB_BACKEND = "Agg"/' /root/src/labours/cli.py && \
3030
pip3 install --no-cache-dir /root/src && \
3131
pip3 install --no-cache-dir "tensorflow<2.0" && \
3232
rm -rf /root/src && \

python/labours/cli.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
from labours.readers import read_input
2323
from labours.utils import import_pandas
2424

25+
# NB: this value is modified within the Dockerfile.
26+
DEFAULT_MATPLOTLIB_BACKEND = None
27+
2528

2629
def list_matplotlib_styles() -> List[str]:
2730
script = (
@@ -58,7 +61,11 @@ def parse_args() -> Namespace:
5861
choices=list_matplotlib_styles(),
5962
help="Plot style to use.",
6063
)
61-
parser.add_argument("--backend", help="Matplotlib backend to use.")
64+
parser.add_argument(
65+
"--backend",
66+
default=DEFAULT_MATPLOTLIB_BACKEND,
67+
help="Matplotlib backend to use.",
68+
)
6269
parser.add_argument(
6370
"--background",
6471
choices=["black", "white"],

0 commit comments

Comments
 (0)