Debian Codegraph @

Makefile

raw
1 PYTHON = python3
2 RUFF ?= $(PYTHON) -m ruff
3 SETUP = $(PYTHON) setup.py
4 BUILD = $(PYTHON) -m build
5 TESTRUNNER ?= unittest
6 RUNTEST = PYTHONHASHSEED=random PYTHONPATH=$(shell pwd)$(if $(PYTHONPATH),:$(PYTHONPATH),) $(PYTHON) -m $(TESTRUNNER) $(TEST_OPTIONS)
7 COVERAGE = python3-coverage
8 PYDOCTOR_ARGS ?=
9
10 DESTDIR=/
11
12 all: build
13
14 doc:: sphinx
15
16 sphinx::
17 $(MAKE) -C docs html
18
19 build::
20 $(SETUP) build_ext -i
21
22 dist::
23 $(BUILD)
24
25 install::
26 $(SETUP) install --root="$(DESTDIR)"
27
28 check:: build
29 $(RUNTEST) tests.test_suite
30
31 check-tutorial:: build
32 $(RUNTEST) tests.tutorial_test_suite
33
34 check-nocompat:: build
35 $(RUNTEST) tests.nocompat_test_suite
36
37 check-compat:: build
38 $(RUNTEST) tests.compat_test_suite
39
40 check-pypy:: clean
41 $(MAKE) check-noextensions PYTHON=pypy
42
43 check-noextensions:: clean
44 $(RUNTEST) tests.test_suite
45
46 check-contrib:: clean
47 $(RUNTEST) -v contrib.test_suite
48
49 check-properties::
50 $(RUNTEST) discover -v property_tests
51
52 typing:
53 $(PYTHON) -m mypy dulwich
54
55 clean::
56 $(SETUP) clean --all
57 rm -f dulwich/*.so
58
59 style:
60 $(RUFF) check .
61
62 coverage:
63 $(COVERAGE) run -m unittest tests.test_suite contrib.test_suite
64
65 coverage-html: coverage
66 $(COVERAGE) html
67
68 .PHONY: apidocs
69
70 apidocs:
71 $(PYTHON) -m pydoctor $(PYDOCTOR_ARGS) --intersphinx https://www.dulwich.io/api/objects.inv --intersphinx http://docs.python.org/3/objects.inv --docformat=google dulwich --project-url=https://www.dulwich.io/ --project-name=dulwich
72
73 fix:
74 ruff check --fix .
75
76 reformat:
77 ruff format .
78
79 .PHONY: codespell
80
81 codespell:
82 codespell --config .codespellrc .