File: rules

package info (click to toggle)
datalad 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,148 kB
  • sloc: python: 69,414; sh: 1,521; makefile: 220
file content (61 lines) | stat: -rwxr-xr-x 2,753 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
#export DH_VERBOSE = 1

export DH_VERBOSE = 1
export PYBUILD_NAME = datalad

# test_test would be removed as 0.17.1
# test_subprocess_return_code_capture - https://github.com/datalad/datalad/issues/6109
# test_gracefull_death - too flaky https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029450
# test_completion -- patched in Debian python 3.12 and argcomplete https://github.com/kislyuk/argcomplete/issues/514
# test_ProducerConsumer  -- needs fixing for py 3.13 https://github.com/datalad/datalad/pull/7686
export PYBUILD_TEST_ARGS = -s -v -k 'not test_test and not test_subprocess_return_code_capture and not test_gracefull_death and not test_completion and not test_ProducerConsumer and not test_producer_future_key' -c $(CURDIR)/tox.ini
export DATALAD_TESTS_NONETWORK = 1
export http_proxy=
export https_proxy=

# We need to copy .egg-info so entry points are discovered. And also need
# to generate then per-Python version since some module requirements differ
export PYBUILD_BEFORE_TEST=PYTHONPATH=$(CURDIR)/bin python{version} setup.py develop --install-dir bin/ && cp -rp datalad.egg-info {build_dir}/;

# Set SOURCE_DATE_EPOCH based on changelog in a most portable (older dpkg) way
# following https://reproducible-builds.org/docs/source-date-epoch/
export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog | grep -Po '^Date: \K.*' | date -f- +%s)
export DATALAD_SOURCE_EPOCH=$(SOURCE_DATE_EPOCH)

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

clean::
	dh_clean
	-rm -rf bin build .pybuild datalad.egg-info .pytest_cache docs/source/generated/man
	-find . -name '*.pyc' -delete

override_dh_auto_configure:
	# cheap fake of an installed datalad, so we get .egg-info with entry points
	$(MAKE) bin
	# and leave the rest for dh_python* runs
	mkdir -p build; \
	    export HOME=$(CURDIR)/build;  \
        git config --global user.name "TESTING"; \
        git config --global user.email "TESTING@example.com"

override_dh_auto_test:
#	# Since pybuild overrides HOME for its own purposes, we will rely on our
#	# setup_package placing it back into HOME
	PATH=$(CURDIR)/bin:$$PATH dh_auto_test -- --test-pytest


override_dh_auto_install:
	dh_auto_install
	mv debian/python3-datalad/usr/bin/* debian/datalad/usr/bin
	rm -f debian/python*-datalad/usr/bin/*
	# Building manpages. Overcoming #532 which creates some config file.
	mkdir -p build/man
	echo "DEBUG: DATALAD_SOURCE_EPOCH=$$DATALAD_SOURCE_EPOCH"
	HOME=$(CURDIR)/build python3 setup.py build_manpage
	# Generating argcomplete helper for bash_completion.d
	{ register-python-argcomplete3 datalad || register-python-argcomplete datalad; } > debian/datalad/usr/share/bash-completion/completions/datalad

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.md