2
0

Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. PYTHON = python3
  2. PYFLAKES = $(PYTHON) -m pyflakes
  3. PEP8 = pep8
  4. RUFF ?= $(PYTHON) -m ruff
  5. SETUP = $(PYTHON) setup.py
  6. TESTRUNNER ?= unittest
  7. RUNTEST = PYTHONHASHSEED=random PYTHONPATH=$(shell pwd)$(if $(PYTHONPATH),:$(PYTHONPATH),) $(PYTHON) -m $(TESTRUNNER) $(TEST_OPTIONS)
  8. COVERAGE = python3-coverage
  9. DESTDIR=/
  10. all: build
  11. doc:: sphinx
  12. sphinx::
  13. $(MAKE) -C docs html
  14. build::
  15. $(SETUP) build
  16. $(SETUP) build_ext -i
  17. install::
  18. $(SETUP) install --root="$(DESTDIR)"
  19. check:: build
  20. $(RUNTEST) dulwich.tests.test_suite
  21. check-tutorial:: build
  22. $(RUNTEST) dulwich.tests.tutorial_test_suite
  23. check-nocompat:: build
  24. $(RUNTEST) dulwich.tests.nocompat_test_suite
  25. check-compat:: build
  26. $(RUNTEST) dulwich.tests.compat_test_suite
  27. check-pypy:: clean
  28. $(MAKE) check-noextensions PYTHON=pypy
  29. check-noextensions:: clean
  30. $(RUNTEST) dulwich.tests.test_suite
  31. check-contrib:: clean
  32. $(RUNTEST) -v dulwich.contrib.test_suite
  33. check-all: check check-pypy check-noextensions
  34. typing:
  35. mypy dulwich
  36. clean::
  37. $(SETUP) clean --all
  38. rm -f dulwich/*.so
  39. flakes:
  40. $(PYFLAKES) dulwich
  41. pep8:
  42. $(PEP8) dulwich
  43. style:
  44. $(RUFF) check .
  45. before-push: check
  46. git diff origin/master | $(PEP8) --diff
  47. coverage:
  48. $(COVERAGE) run -m unittest dulwich.tests.test_suite dulwich.contrib.test_suite
  49. coverage-html: coverage
  50. $(COVERAGE) html
  51. .PHONY: apidocs
  52. apidocs:
  53. 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
  54. fix:
  55. ruff check --fix .
  56. reformat:
  57. ruff format .
  58. .PHONY: codespell
  59. codespell:
  60. codespell --config .codespellrc .