Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. PYTHON = python3
  2. RUFF ?= $(PYTHON) -m ruff
  3. SETUP = $(PYTHON) setup.py
  4. TESTRUNNER ?= unittest
  5. RUNTEST = PYTHONHASHSEED=random PYTHONPATH=$(shell pwd)$(if $(PYTHONPATH),:$(PYTHONPATH),) $(PYTHON) -m $(TESTRUNNER) $(TEST_OPTIONS)
  6. COVERAGE = python3-coverage
  7. DESTDIR=/
  8. all: build
  9. doc:: sphinx
  10. sphinx::
  11. $(MAKE) -C docs html
  12. build::
  13. $(SETUP) build
  14. $(SETUP) build_ext -i
  15. install::
  16. $(SETUP) install --root="$(DESTDIR)"
  17. check:: build
  18. $(RUNTEST) tests.test_suite
  19. check-tutorial:: build
  20. $(RUNTEST) tests.tutorial_test_suite
  21. check-nocompat:: build
  22. $(RUNTEST) tests.nocompat_test_suite
  23. check-compat:: build
  24. $(RUNTEST) tests.compat_test_suite
  25. check-pypy:: clean
  26. $(MAKE) check-noextensions PYTHON=pypy
  27. check-noextensions:: clean
  28. $(RUNTEST) tests.test_suite
  29. check-contrib:: clean
  30. $(RUNTEST) -v dulwich.contrib.test_suite
  31. check-all: check check-pypy check-noextensions
  32. typing:
  33. $(PYTHON) -m mypy dulwich
  34. clean::
  35. $(SETUP) clean --all
  36. rm -f dulwich/*.so
  37. style:
  38. $(RUFF) check .
  39. coverage:
  40. $(COVERAGE) run -m unittest tests.test_suite dulwich.contrib.test_suite
  41. coverage-html: coverage
  42. $(COVERAGE) html
  43. .PHONY: apidocs
  44. apidocs:
  45. pydoctor --intersphinx http://urllib3.readthedocs.org/en/latest/objects.inv --intersphinx http://docs.python.org/3/objects.inv --docformat=google dulwich --project-url=https://www.dulwich.io/ --project-name=dulwich
  46. fix:
  47. ruff check --fix .
  48. reformat:
  49. ruff format .
  50. .PHONY: codespell
  51. codespell:
  52. codespell --config .codespellrc .