-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (43 loc) · 1.02 KB
/
Makefile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
PROJ_SLUG = hdash
CLI_NAME = hdash
PY_VERSION = 3.8
PY_LINT = pylint
FLAKE8 = flake8
FORMATTER = black
# Prepare directories
prepare:
mkdir -p deploy
mkdir -p deploy/images
mkdir -p tests/out
# Generate new requirements.txt dependencies file.
freeze:
pip freeze > requirements.txt
# Run PyLint on all code
lint:
$(PY_LINT) -j 0 $(PROJ_SLUG)
$(PY_LINT) -j 0 tests
# Run flake8 on all code
flake8:
$(FLAKE8) $(PROJ_SLUG)
$(FLAKE8) tests
# Reformat all code via Black
format:
$(FORMATTER) $(PROJ_SLUG)
$(FORMATTER) tests
# Run all unit tests
test: prepare
pytest -v -m "not smoke" tests
# Run smoke tests that require external dependencies, e.g. database, synapse, buckets.
smoke:
pytest -v -m "smoke" tests
# Deploy to Apache Airflow Dev Directory
deploy:
cp -R hdash $(AIRFLOW_DEV_HOME)
cp hdash/dags/*.py $(AIRFLOW_DEV_HOME)/dags
# Deploy to Google Cloud Composer DAG Bucket
gcp:
gsutil cp -r hdash $(HDASH_CLOUD_COMPOSER_DAG)
gsutil cp hdash/dags/*.py $(HDASH_CLOUD_COMPOSER_DAG)
# Clean things up
clean:
rm -rf deploy