forked from electricitymaps/electricitymaps-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
31 lines (27 loc) · 883 Bytes
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
VERSION 0.6
FROM python:3.8
WORKDIR /contrib
src-files:
COPY electricitymap ./electricitymap
COPY parsers ./parsers
COPY validators ./validators
COPY ./config+src-files/* ./config
COPY scripts ./scripts
COPY web/public/locales/en.json ./web/public/locales/en.json
COPY __init__.py ./__init__.py
COPY pyproject.toml .
SAVE ARTIFACT .
prepare:
FROM +src-files
RUN pip install poetry==1.1.12
RUN apt-get update && apt-get install -y python3-opencv tesseract-ocr tesseract-ocr-jpn tesseract-ocr-eng libgl1
RUN poetry config virtualenvs.create false
RUN poetry install -E parsers -E validators
build:
FROM +prepare
test:
FROM +build
COPY tests ./tests
COPY web/src/helpers/constants.js ./web/src/helpers/constants.js # TODO: python tests should not depend on this js file
COPY web/geo/world.geojson ./web/geo/world.geojson
RUN poetry run check