File: rules

package info (click to toggle)
python-debian 0.1.39
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,644 kB
  • sloc: python: 7,430; makefile: 229; sh: 11
file content (62 lines) | stat: -rwxr-xr-x 1,789 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

# tell pybuild which module to install into the packages
export PYBUILD_NAME=debian

%:
	dh $@ --with python3 --buildsystem pybuild

%.py: %.py.in debian/changelog
	sed -e 's/__CHANGELOG_VERSION__/$(DEB_VERSION)/' < $< > $@

override_dh_auto_build: lib/debian/_version.py
	dh_auto_build
	lib/debian/doc-debtags > README.debtags

override_dh_auto_test:
	# don't run the tests if suppressed with DEB_BUILD_OPTIONS=nocheck
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# run all the tests with both a UTF-8 aware locale and a non-UTF-8
	# aware locale to catch errors related to encoding.
	for py in `py3versions -s`; do \
	  set -e; \
	  echo "----------------------------------------------"; \
	  echo "Testing with $$py"; \
	  echo "----------------------------------------------"; \
	  LC_ALL=C $$py -m unittest discover --verbose lib/; \
	  LC_ALL=C.UTF-8 $$py -m unittest discover --verbose lib/; \
	done
endif

override_dh_auto_install:
	dh_auto_install
	# setuputils may produce different files for different versions of
	# python and dh_python3 will leave them behind.
	rm -rf $(CURDIR)/*/usr/lib/python3.*

dist: lib/debian/_version.py
	rm -f dist/python?debian-$(DEB_VERSION)*
	python3 setup.py sdist bdist_wheel bdist_egg
	echo "You can now: twine upload --sign dist/python?debian-$(DEB_VERSION)*"

apidoc:
	rm -f docs/api/*
	cd lib && sphinx-apidoc -e --private -H python-debian \
	  -o ../docs/api/ . \
	  deb822.py debian/tests/ debian_bundle/

doc: apidoc
	PYTHONPATH=$(CURDIR)/lib \
	  make -C docs/ SPHINXOPTS="-a -v -n" html

qa: lib/debian/_version.py
	pylint --rcfile .pylintrc lib
	mypy --strict lib

.PHONY: dist doc apidoc qa