Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 #export DH_VERBOSE = 1
3
4 export DH_VERBOSE = 1
5 export PYBUILD_NAME = datalad
6
7 # test_test would be removed as 0.17.1
8 # test_subprocess_return_code_capture - https://github.com/datalad/datalad/issues/6109
9 # test_gracefull_death - too flaky https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029450
10 # test_completion -- patched in Debian python 3.12 and argcomplete https://github.com/kislyuk/argcomplete/issues/514
11 # test_ProducerConsumer -- needs fixing for py 3.13 https://github.com/datalad/datalad/pull/7686
12 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
13 export DATALAD_TESTS_NONETWORK = 1
14 export http_proxy=
15 export https_proxy=
16
17 # We need to copy .egg-info so entry points are discovered. And also need
18 # to generate then per-Python version since some module requirements differ
19 export PYBUILD_BEFORE_TEST=PYTHONPATH=$(CURDIR)/bin python{version} setup.py develop --install-dir bin/ && cp -rp datalad.egg-info {build_dir}/;
20
21 # Set SOURCE_DATE_EPOCH based on changelog in a most portable (older dpkg) way
22 # following https://reproducible-builds.org/docs/source-date-epoch/
23 include /usr/share/dpkg/pkg-info.mk
24 export DATALAD_SOURCE_EPOCH=$(SOURCE_DATE_EPOCH)
25
26 %:
27 dh $@ --buildsystem=pybuild
28
29 clean::
30 dh_clean
31 -rm -rf bin build .pybuild datalad.egg-info .pytest_cache docs/source/generated/man
32 -find . -name '*.pyc' -delete
33
34 override_dh_auto_configure:
35 # cheap fake of an installed datalad, so we get .egg-info with entry points
36 $(MAKE) bin
37 # and leave the rest for dh_python* runs
38 mkdir -p build; \
39 export HOME=$(CURDIR)/build; \
40 git config --global user.name "TESTING"; \
41 git config --global user.email "[email protected]"
42
43 override_dh_auto_test:
44 # # Since pybuild overrides HOME for its own purposes, we will rely on our
45 # # setup_package placing it back into HOME
46 PATH=$(CURDIR)/bin:$$PATH dh_auto_test -- --test-pytest
47
48
49 override_dh_auto_install:
50 dh_auto_install
51 mv debian/python3-datalad/usr/bin/* debian/datalad/usr/bin
52 rm -f debian/python*-datalad/usr/bin/*
53 # Building manpages. Overcoming #532 which creates some config file.
54 mkdir -p build/man
55 echo "DEBUG: DATALAD_SOURCE_EPOCH=$$DATALAD_SOURCE_EPOCH"
56 HOME=$(CURDIR)/build python3 setup.py build_manpage
57 # Generating argcomplete helper for bash_completion.d
58 { register-python-argcomplete3 datalad || register-python-argcomplete datalad; } > debian/datalad/usr/share/bash-completion/completions/datalad
59
60 override_dh_installchangelogs:
61 dh_installchangelogs CHANGELOG.md