Python implementation of the Piwik HTTP API

Makefile 957B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. TARGET?=tests
  2. SRC_PATH := pypiwik
  3. VERSION := $(shell grep -Po '"(.*)"' $(SRC_PATH)/__init__.py | sed -e 's/"//g')
  4. test_default_python:
  5. PYTHONPATH="." python tests/ -v
  6. test_py2:
  7. @echo Executing test with python2
  8. PYTHONPATH="." python2 tests/ -v
  9. test_py3:
  10. @echo Executing test with python3
  11. PYTHONPATH="." python3 tests/ -v
  12. test: test_py2 test_py3
  13. compile:
  14. @echo Compiling python code
  15. python -m compileall $(SRC_PATH)/
  16. compile_optimized:
  17. @echo Compiling python code optimized
  18. python -O -m compileall $(SRC_PATH)/
  19. coverage:
  20. coverage erase
  21. PYTHONPATH="." coverage run --source='$(SRC_PATH)' --branch tests/__main__.py
  22. coverage xml -i
  23. coverage report -m
  24. sonar:
  25. /usr/local/bin/sonar-scanner/bin/sonar-scanner -Dsonar.projectVersion=$(VERSION)
  26. clean:
  27. find -name "*.py?" -delete
  28. rm -f coverage.xml testresults.xml
  29. rm -fr htmlcov dist build *.egg-info
  30. travis: compile compile_optimized test_default_python coverage
  31. jenkins: travis sonar