forked from openedx-unsupported/edx-analytics-data-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (46 loc) · 2 KB
/
Makefile
File metadata and controls
62 lines (46 loc) · 2 KB
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
54
55
56
57
58
59
60
61
62
ROOT = $(shell echo "$$PWD")
COVERAGE = $(ROOT)/build/coverage
PACKAGES = analyticsdataserver analytics_data_api
DATABASES = default analytics
.PHONY: requirements develop clean diff.report view.diff.report quality
requirements:
pip install -q -r requirements/base.txt
test.requirements: requirements
pip install -q -r requirements/test.txt
develop: test.requirements
pip install -q -r requirements/local.txt
clean:
find . -name '*.pyc' -delete
coverage erase
test: clean
. ./.test_env && ./manage.py test --settings=analyticsdataserver.settings.test --with-ignore-docstrings \
--exclude-dir=analyticsdataserver/settings --with-coverage --cover-inclusive --cover-branches \
--cover-html --cover-html-dir=$(COVERAGE)/html/ \
--cover-xml --cover-xml-file=$(COVERAGE)/coverage.xml \
$(foreach package,$(PACKAGES),--cover-package=$(package)) \
$(PACKAGES)
diff.report:
diff-cover $(COVERAGE)/coverage.xml --html-report $(COVERAGE)/diff_cover.html
diff-quality --violations=pep8 --html-report $(COVERAGE)/diff_quality_pep8.html
diff-quality --violations=pylint --html-report $(COVERAGE)/diff_quality_pylint.html
view.diff.report:
xdg-open file:///$(COVERAGE)/diff_cover.html
xdg-open file:///$(COVERAGE)/diff_quality_pep8.html
xdg-open file:///$(COVERAGE)/diff_quality_pylint.html
quality:
pep8 $(PACKAGES)
pylint $(PACKAGES)
# Ignore module level docstrings and all test files
#pep257 --ignore=D100,D203 --match='(?!test).*py' $(PACKAGES)
validate: test.requirements test quality
migrate:
$(foreach db_name,$(DATABASES),./manage.py migrate --noinput --database=$(db_name);)
loaddata: migrate
python manage.py loaddata problem_response_answer_distribution --database=analytics
python manage.py generate_fake_course_data
demo: clean requirements loaddata
python manage.py set_api_key edx edx
travis: clean requirements migrate
python manage.py set_api_key edx edx
python manage.py loaddata problem_response_answer_distribution --database=analytics
python manage.py generate_fake_course_data --num-weeks=1