Nenhuma Descrição

Makefile 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .PHONY: help .check-pypi-envs .install-poetry update install docs tests build deploy
  2. .DEFAULT_GOAL := help
  3. export PATH := ${HOME}/.local/bin:$(PATH)
  4. IS_POETRY := $(shell pip freeze | grep "poetry==")
  5. CURRENT_VERSION := $(shell poetry version -s)
  6. help:
  7. @echo "Please use 'make <target>', where <target> is one of"
  8. @echo ""
  9. @echo " build builds the project .whl with poetry"
  10. @echo " deploy deploys the project using poetry (not recommended, only use if really needed)"
  11. @echo " help outputs this helper"
  12. @echo " install installs the dependencies in the env"
  13. @echo " release version=<sem. version> bumps the project version to <sem. version>, using poetry;"
  14. @echo " Updates also docs/source/conf.py version;"
  15. @echo " If no version is provided, poetry outputs the current project version"
  16. @echo " test run all the tests and linting"
  17. @echo " update updates the dependencies in poetry.lock"
  18. @echo ""
  19. @echo "Check the Makefile to know exactly what each target is doing."
  20. .install-poetry:
  21. @if [ -z ${IS_POETRY} ]; then pip install poetry; fi
  22. update: .install-poetry
  23. poetry update
  24. install: .install-poetry
  25. poetry install
  26. docs: .install-poetry
  27. poetry run sphinx-build -b html docs/source docs/build
  28. format: .install-poetry
  29. poetry run isort ocpp tests && poetry run black ocpp tests
  30. tests: .install-poetry
  31. poetry run black --check --diff ocpp tests
  32. poetry run isort --check-only ocpp tests
  33. poetry run flake8 ocpp tests
  34. poetry run py.test -vvv --cov=ocpp --cov-report=term-missing tests/
  35. build: .install-poetry
  36. poetry build
  37. release: .install-poetry
  38. @echo "Please remember to update the CHANGELOG.md, before tagging the release"
  39. @sed -i ".bkp" "s/release = '${CURRENT_VERSION}'/release = '${version}'/g" docs/source/conf.py
  40. @poetry version ${version}
  41. deploy: update tests
  42. poetry publish --build