Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # -*- coding: utf-8 -*-
  2. #
  3. # SPDX-License-Identifier: CC0-1.0
  4. #
  5. # This file is part of lpschedule-generator.
  6. #
  7. GNU_MAKE=gmake
  8. VENV_DIR='.venv'
  9. VENV_CMD=virtualenv
  10. VENV_PREFIX=.
  11. VENV_DIR=${VENV_PREFIX}/.lpschedule-generator
  12. test:
  13. @nosetests
  14. .PHONY: test
  15. fmt:
  16. black --include 'lps_gen.py|setup.py|tests/*.py|lpschedule_generator/*.py' .
  17. .PHONY: fmt
  18. build:
  19. @python setup.py sdist bdist_wheel
  20. .PHONY: build
  21. upload:
  22. @twine upload -r pypi -s --sign-with 'gpg2' \
  23. -i '1534 126D 8C8E AD29 EDD9 1396 6BE9 3D8B F866 4377' \
  24. dist/*.tar.gz
  25. @twine upload -r pypi -s --sign-with 'gpg2' \
  26. -i '1534 126D 8C8E AD29 EDD9 1396 6BE9 3D8B F866 4377' \
  27. dist/*.whl
  28. .PHONY: upload
  29. docs:
  30. ${GNU_MAKE} -C docs html
  31. .PHONY: docs
  32. upload-docs: docs
  33. @rsync -avz --delete docs/_build/html/ $(LPSG_DOCS_HOST)
  34. .PHONY: upload-docs
  35. venv:
  36. rm -rf *.egg-info .eggs
  37. ${SHELL} -c 'if [[ -d $(VENV_DIR) ]] then mv $(VENV_DIR) $(VENV_DIR).`date +%s`; fi'
  38. ${VENV_CMD} --clear --python=python3 $(VENV_DIR)
  39. @echo 'Initialized virtualenv, run' \
  40. 'source '$(VENV_DIR)'/bin/activate' \
  41. 'to activate the virtual environment'
  42. .PHONY: venv
  43. clean: clean-build clean-pyc clean-docs
  44. .PHONY: clean
  45. clean-build:
  46. rm -rf build/
  47. rm -rf dist/
  48. rm -rf *.egg-info
  49. .PHONY: clean-build
  50. clean-pyc:
  51. find . -name '*.pyc' -exec rm -f {} +
  52. .PHONY: clean-pyc
  53. clean-venv:
  54. rm -rf ${VENV_DIR}*/
  55. .PHONY: clean-venv
  56. clean-docs:
  57. ${GNU_MAKE} -C docs clean
  58. .PHONY: clean-docs
  59. dev:
  60. python setup.py develop
  61. pip install -r requirements.txt
  62. .PHONY: dev