p≡p for Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.7 KiB

  1. include Makefile.conf
  2. .PHONY: all compile compile-inplace dist dist-egg dist-whl install install-user venv envtest install-test test develop docs clean clean-all clean-docs
  3. all: install
  4. # Build
  5. # =====
  6. compile:
  7. python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT)
  8. compile-inplace:
  9. python3 setup.py build_ext $(DEBUG_OPT) $(PREFIX_OPT) --inplace
  10. # Packaging
  11. # =========
  12. # create wheel and egg package in dist/
  13. dist: dist-whl dist-egg
  14. # create wheel package in dist/
  15. dist-whl: compile
  16. python3 setup.py bdist_wheel
  17. # create egg package in dist/
  18. dist-egg: compile
  19. python3 setup.py bdist_egg
  20. # Installation
  21. # ============
  22. # installs the package system wide
  23. install: compile
  24. pip3 install .
  25. # installs the package into your user home
  26. install-user: compile
  27. pip3 install . --user
  28. # Envrionment
  29. # ===========
  30. # Creates and activates a new venv that has the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH
  31. # already set for the prefix specified in local.conf
  32. # Only activates venv if already existing
  33. venv:
  34. python3 -m venv $(VENV_DIR)
  35. LD_LIBRARY_PATH=$(PREFIX)/lib \
  36. DYLD_LIBRARY_PATH=$(PREFIX)/lib \
  37. bash --rcfile $(VENV_DIR)/bin/activate
  38. # Tests if the current environment is able to load the pEp module
  39. envtest:
  40. python3 -c 'import pEp'
  41. # Test
  42. # ====
  43. # Use these targets only in venv created with 'make venv'
  44. install-test: compile
  45. pip3 install .[test]
  46. test:
  47. pytest
  48. # Development
  49. develop: compile
  50. pip install -e .
  51. # Documentation
  52. # =============
  53. docs: compile-inplace
  54. make html -C docs/
  55. # Housekeeping
  56. # ============
  57. clean-all: clean
  58. rm -rf $(VENV_DIR)
  59. clean: clean-docs
  60. rm -rf $(BUILD_DIR)
  61. rm -rf $(DIST_DIR)
  62. rm -rf $(PYTHON_ARTIFACTS)
  63. rm -rf $(VERSION_FILE)
  64. rm -rf $(BUILD_INPLACE)
  65. clean-docs:
  66. make clean -C docs/