File: rules

package info (click to toggle)
datalad-next 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,584 kB
  • sloc: python: 23,970; makefile: 205; sh: 61
file content (54 lines) | stat: -rwxr-xr-x 1,578 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
#!/usr/bin/make -f

export PYBUILD_NAME=datalad_next

# this instructs the test suite to skip any tests that require remote
# resources
export DATALAD_TESTS_NONETWORK = 1

PY3VERSIONS=$(shell py3versions -vr)

# This is not needed in debhelper 12+ but we are targeting 10
TESTIT = 1
ifneq (,$(filter nocheck,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
  TESTIT := 0
endif

ifneq (,$(filter nocheck,$(subst $(COMMA), ,$(DEB_BUILD_PROFILES))))
  TESTIT := 0
endif

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

clean::
	dh_clean
	$(MAKE) PYTHON=python3 clean
	rm -rf $(CURDIR)/.pybuild
	rm -rf $(CURDIR)/.pytest_cache
	rm -rf $(CURDIR)/debian/install-for-tests

override_dh_auto_test:
ifeq ($(TESTIT),1)
	# Install special testing directory
	dh_auto_install --destdir $(CURDIR)/debian/install-for-tests
	# Perform the tests for any support python version.
	# This requires a particular environment:
	# - (PYTHON)PATH: we need the CLI entrypoint to be available
	# - HOME: tests require a a defined home (mostly) for accessing
	#   configuration, and placing things like sockets
	set -e && \
	  for v in $(PY3VERSIONS); do \
	    distdir=$(CURDIR)/debian/install-for-tests/usr/lib/python$$v/dist-packages; \
		PATH=$(CURDIR)/debian/install-for-tests/usr/bin:$$PATH \
		PYTHONPATH=$$distdir:$$PYTHONPATH \
		HOME=$(CURDIR)/.pybuild \
		python$$v -m pytest -s -v $$distdir/datalad_next; \
	  done
endif

override_dh_auto_install:
	PYTHONPATH=. http_proxy='127.0.0.1:9' \
		sphinx-build -N -bhtml docs/source/ \
		debian/tmp/usr/share/doc/python3-datalad-next/html/
	dh_auto_install