forked from lbl-srg/BuildingsPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (63 loc) · 2.17 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
BPDIR=buildingspy
BPDOC=doc
PEP8_ARGS=--recursive --max-line-length=100 \
--exclude="*/thirdParty/*" \
--ignore="E402" \
--aggressive --aggressive --aggressive \
buildingspy
.PHONY: doc clean
doc:
@echo "*** Verifying that readme file used by git and pip are consistent"
cmp -s README.rst buildingspy/README.rst
@echo "*** Generating documentation"
(cd $(BPDOC); make html linkcheck)
pep8:
ifeq ($(PEP8_CORRECT_CODE), true)
@echo "*** Running autopep8 to correct code"
autopep8 --in-place $(PEP8_ARGS)
@echo "*** Checking for required code changes (apply with 'make pep8 PEP8_CORRECT_CODE=true')"
git diff --exit-code .
else
@echo "*** Checking for required code changes (apply with 'make pep8 PEP8_CORRECT_CODE=true')"
autopep8 --diff $(PEP8_ARGS)
endif
unittest:
# To run a single test, use
# python buildingspy/tests/test_development_regressiontest_optimica.py Test_regressiontest_optimica_Tester.test_regressiontest_diagnostics
python3 -m unittest discover buildingspy/tests
doctest:
python3 -m doctest \
buildingspy/fmi/*.py \
buildingspy/io/*.py \
buildingspy/examples/*.py \
buildingspy/examples/dymola/*.py \
buildingspy/simulate/*.py \
buildingspy/development/*.py
@rm -f plot.pdf plot.png roomTemperatures.png dymola.log MyModel.mat dslog.txt package.order \
run_simulate.mos run_translate.mos simulator.log translator.log
dist: clean doctest unittest doc
@# Make sure README.rst are consistent
cmp -s README.rst buildingspy/README.rst
python3 setup.py sdist bdist_wheel
rm -rf build
rm -rf buildingspy.egg-info
twine check dist/*
@echo "Source distribution is in directory dist"
@echo "To post to server, run postBuildingsPyToWeb.sh"
@echo "To upload to PyPi, run 'twine upload dist/*'"
upload-test:
@# Make sure README.rst are consistent
cmp -s README.rst buildingspy/README.rst
twine upload --verbose --repository buildingspy_test dist/*
upload:
@# Make sure README.rst are consistent
cmp -s README.rst buildingspy/README.rst
twine upload --repository buildingspy_production_upload dist/*
clean-dist:
rm -rf build
rm -rf buildingspy.egg-info
rm -rf buildingspy-*
rm -rf dist
clean-doc:
(cd $(BPDOC); make clean)
clean: clean-doc clean-dist