Makefile 1.08 KB
Newer Older
Gmodena's avatar
Gmodena committed
1
2
SHELL := /bin/bash

Gmodena's avatar
Gmodena committed
3
include ../Makefile.conda
Gmodena's avatar
Gmodena committed
4

Gmodena's avatar
Gmodena committed
5
6
7
8
9
mypy: ${pip_requirements_test}
	${DOCKER_CMD} bash -c "export CONDA_ALWAYS_YES=true; ${CONDA_CMD}; \
    					pip install -r ${pip_requirements_test}; \
    					mypy spark"

Gmodena's avatar
Gmodena committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# TODO(gmodena, 2021-11-01): this conflicts with Makefile layout changes in https://gitlab.wikimedia.org/gmodena/platform-airflow-dags/-/tree/T293382-add-typing
lint: ${pip_requirements_test}
	# check for syntax errors or undefined names in ${lint_targets} files.
	# exit-zero treats all errors as warnings.
	# the GitHub editor is 127 chars wide; set that as ax-line-length.
	${DOCKER_CMD} bash -c "pip install -r ${pip_requirements_test}; ${CONDA_CMD}; \
			flake8 ${lint_targets} \
			--count \
			--max-complexity=10 \
			--max-line-length=80 \
			--select=E9,F63,F7,F82 \
			--show-source \
			--statistics"

Gmodena's avatar
Gmodena committed
24
25
26
27
28
test:   ${pip_requirements_test}
	${DOCKER_CMD} bash -c "export CONDA_ALWAYS_YES=true; ${CONDA_CMD}; \
					conda install openjdk pyspark==${pyspark_version}; \
					pip install -r ${pip_requirements_test}; \
					PYTHONPATH=${PYTHONPATH}:spark/ pytest --cov spark tests/"