| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
include /usr/share/dpkg/pkg-info.mk |
| 8 |
|
| 9 |
export SETUPTOOLS_SCM_PRETEND_VERSION = $(shell debian/make_pep440_compliant "$(DEB_VERSION)") |
| 10 |
|
| 11 |
|
| 12 |
export PYBUILD_NAME=debian |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
export FORBID_MISSING_APT_PKG ?= 1 |
| 17 |
export FORBID_MISSING_CHARSET_NORMALIZER ?= 1 |
| 18 |
export FORBID_MISSING_GPGV ?= 1 |
| 19 |
export FORBID_MISSING_AR ?= 1 |
| 20 |
export FORBID_MISSING_DPKG_DEB ?= 1 |
| 21 |
export FORBID_MISSING_ZSTD ?= 1 |
| 22 |
|
| 23 |
%: |
| 24 |
dh $@ --with python3 --buildsystem pybuild |
| 25 |
|
| 26 |
execute_after_dh_auto_build: |
| 27 |
src/debian/doc-debtags > README.debtags |
| 28 |
|
| 29 |
|
| 30 |
override_dh_python3: |
| 31 |
dh_python3 --suggests-section=encodings |
| 32 |
|
| 33 |
|
| 34 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 35 |
override_dh_auto_test: test |
| 36 |
endif |
| 37 |
|
| 38 |
dist: |
| 39 |
|
| 40 |
rm -f dist/python?debian-$(SETUPTOOLS_SCM_PRETEND_VERSION)* |
| 41 |
python3 -m build --skip-dependency-check --no-isolation --sdist --wheel |
| 42 |
@echo "You can now:" |
| 43 |
@echo " twine check --strict dist/python?debian-$(SETUPTOOLS_SCM_PRETEND_VERSION)*" |
| 44 |
@echo " twine upload dist/python?debian-$(SETUPTOOLS_SCM_PRETEND_VERSION)*" |
| 45 |
|
| 46 |
apidoc: |
| 47 |
rm -f docs/api/* |
| 48 |
cd src && sphinx-apidoc -e --private -H python-debian \ |
| 49 |
-o ../docs/api/ . \ |
| 50 |
debian/tests/ |
| 51 |
|
| 52 |
doc: apidoc |
| 53 |
PYTHONPATH=$(CURDIR)/src \ |
| 54 |
make -C docs/ SPHINXOPTS="-a -v -n" html |
| 55 |
|
| 56 |
test: |
| 57 |
|
| 58 |
|
| 59 |
for py in `py3versions -s`; do \ |
| 60 |
set -e; \ |
| 61 |
echo "----------------------------------------------"; \ |
| 62 |
echo "Testing with $$py"; \ |
| 63 |
echo "----------------------------------------------"; \ |
| 64 |
LC_ALL=C $$py -m pytest; \ |
| 65 |
LC_ALL=C.UTF-8 $$py -m pytest; \ |
| 66 |
done |
| 67 |
|
| 68 |
qa: |
| 69 |
@echo "Running both pylint and mypy" |
| 70 |
@echo "----------- pylint -----------" |
| 71 |
@pylint $$(find src/debian -name \*py | grep -v test | sort); \ |
| 72 |
pylinterr=$$?; \ |
| 73 |
echo "----------- mypy -----------"; \ |
| 74 |
mypy; \ |
| 75 |
mypyerr=$$? ; \ |
| 76 |
[ $$pylinterr -eq 0 -a $$mypyerr -eq 0 ] |
| 77 |
|
| 78 |
.PHONY: dist doc apidoc qa |