File: rules

package info (click to toggle)
python-memray 1.17.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,396 kB
  • sloc: python: 28,451; ansic: 16,507; sh: 10,586; cpp: 8,494; javascript: 1,474; makefile: 822; awk: 12
file content (174 lines) | stat: -rwxr-xr-x 9,312 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/bin/make -f

export PYBUILD_NAME=memray
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

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

override_dh_shlibdeps:
	dh_shlibdeps --dpkg-shlibdeps-params=--warnings=9

override_dh_auto_install:
	dh_auto_install
	# Strip unneeded symbols and notes from shared libraries
	find debian/python3-memray -name "*.so*" -exec strip --strip-unneeded --remove-section=.note.gnu.build-id {} +

# Skip failing tests in each ARCH
export FILES_ARGS=--ignore=tests/integration/test_main.py \
--ignore=tests/integration/test_native_tracking.py

export TIMEOUT_ARGS=and not test_reading_allocations_while_reading_stack_traces \
and not test_live_tracking_waits_for_client \
and not test_live_tracking \
and not test_live_client_exits_properly_on_sigint_before_connecting \
and not test_multithreaded_extension \
and not test_misbehaving_extension \
and not test_extension_that_uses_pygilstate_ensure \
and not test_native_dlopen \
and not test_valloc_at_thread_exit \
and not test_valloc_at_thread_exit_in_subprocess \
and not test_dlopen_with_rpath

export ARM64_ARGS="${FILES_ARGS} \
-v -k 'not test_aggregation_same_python_stack_but_different_native_stack[ALL_ALLOCATIONS] \
and not test_aggregation_same_python_stack_but_different_native_stack[AGGREGATED_ALLOCATIONS] \
and not test_allocations_with_multiprocessing \
and not test_pymalloc_allocations_after_fork \
and not test_stack_cleanup_after_fork \
${TIMEOUT_ARGS}'"

export ARMHF_ARGS="${FILES_ARGS} \
--ignore=tests/integration/test_tracing.py \
--ignore=tests/integration/test_tracking.py \
-v -k 'not test_thread_name \
and not test_setting_python_thread_name \
and not test_successful_parse_of_aggregated_capture_file \
${TIMEOUT_ARGS}'"

export ARMEL_ARGS="${FILES_ARGS} \
--ignore=tests/integration/test_tracing.py \
-v -k 'not test_thread_name \
and not test_setting_python_thread_name \
and not test_aggregation_same_python_stack_and_same_native_stack[ALL_ALLOCATIONS] \
and not test_aggregation_same_python_stack_and_same_native_stack[AGGREGATED_ALLOCATIONS] \
and not test_aggregation_same_python_stack_but_different_native_stack[ALL_ALLOCATIONS] \
and not test_aggregation_same_python_stack_but_different_native_stack[AGGREGATED_ALLOCATIONS] \
${TIMEOUT_ARGS}'"

export S390X_ARGS="${FILES_ARGS} \
-v -k 'not test_aggregation_same_python_stack_and_same_native_stack[ALL_ALLOCATIONS] \
and not test_aggregation_same_python_stack_and_same_native_stack[AGGREGATED_ALLOCATIONS] \
and not test_large_number_of_frame_pops_between_subsequent_allocations \
and not test_aggregation_same_python_stack_but_different_native_stack[ALL_ALLOCATIONS] \
and not test_aggregation_same_python_stack_but_different_native_stack[AGGREGATED_ALLOCATIONS] \
and not test_inverted_very_deep_call_is_limited \
and not test_rejects_different_header_version \
and not test_allocations_with_multiprocessing \
${TIMEOUT_ARGS}'"

export AMD64_OTHERS_ARGS="${FILES_ARGS} \
-v -k 'not test_reading_allocations_while_reading_stack_traces \
and not test_live_tracking_waits_for_client \
and not test_live_tracking \
and not test_munmap_multiple_mmaps_multiple_munmaps[ALL_ALLOCATIONS] \
and not test_munmap_multiple_mmaps_multiple_munmaps[AGGREGATED_ALLOCATIONS] \
and not test_basic_attach[gdb] \
and not test_aggregated_attach[gdb] \
and not test_attach_time[gdb] \
and not test_detach_without_attach[gdb] \
${TIMEOUT_ARGS}'"

override_dh_auto_test:
ifneq (,$(filter arm64,$(DEB_BUILD_ARCH)))
	PYBUILD_TEST_ARGS=$(ARM64_ARGS) dh_auto_test
else ifneq (,$(filter armhf,$(DEB_BUILD_ARCH)))
	PYBUILD_TEST_ARGS=$(ARMHF_ARGS) dh_auto_test
else ifneq (,$(filter armel,$(DEB_BUILD_ARCH)))
	PYBUILD_TEST_ARGS=$(ARMEL_ARGS) dh_auto_test
else ifneq (,$(filter s390x,$(DEB_BUILD_ARCH)))
	PYBUILD_TEST_ARGS=$(S390X_ARGS) dh_auto_test
else ifneq (,$(filter amd64 i386 ppc64el riscv64,$(DEB_BUILD_ARCH)))
	PYBUILD_TEST_ARGS=$(AMD64_OTHERS_ARGS) dh_auto_test
else ifneq (,$(filter mips64el ppc64 loong64 sh4,$(DEB_BUILD_ARCH)))
	@echo "Skip tests in $(DEB_BUILD_ARCH)"
else
	dh_auto_test
endif

override_dh_install:
	dh_install
	rm -f debian/python3-memray/usr/bin/memray3.*

override_dh_installdocs:
	https_proxy='127.0.0.1:9' sphinx-build -b html docs build/sphinx/html

	# Remove duplicate files
	rm -f build/sphinx/html/_static/images/codespaces_testing_tab.png
	rm -f build/sphinx/html/_static/images/complex_example.png
	rm -f build/sphinx/html/_static/images/exercise1_flamegraph.png
	rm -f build/sphinx/html/_static/images/exercise2_flamegraph.png
	rm -f build/sphinx/html/_static/images/exercise3_flamegraph_basic.png
	rm -f build/sphinx/html/_static/images/exercise3_flamegraph_native.png
	rm -f build/sphinx/html/_static/images/filter_thread_dropdown.png
	rm -f build/sphinx/html/_static/images/gprof2dot_example.png
	rm -f build/sphinx/html/_static/images/icicle_flame_toggle.png
	rm -f build/sphinx/html/_static/images/inverted_flame_graph_for_inverted_example.png
	rm -f build/sphinx/html/_static/images/live_different_thread.png
	rm -f build/sphinx/html/_static/images/live_disconnected.png
	rm -f build/sphinx/html/_static/images/live_running.png
	rm -f build/sphinx/html/_static/images/logo.png
	rm -f build/sphinx/html/_static/logo.png
	rm -f build/sphinx/html/_static/images/mandelbrot_operation_native.png
	rm -f build/sphinx/html/_static/images/mandelbrot_operation_non_native.png
	rm -f build/sphinx/html/_static/images/native_mode_debug.png
	rm -f build/sphinx/html/_static/images/native_mode_no_debug.png
	rm -f build/sphinx/html/_static/images/non_relevant_checkbox.png
	rm -f build/sphinx/html/_static/images/normal_flamegraph_for_inverted_example.png
	rm -f build/sphinx/html/_static/images/output.png
	rm -f build/sphinx/html/_static/images/plot_default_options.png
	rm -f build/sphinx/html/_static/images/plot_native.png
	rm -f build/sphinx/html/_static/images/plot_python_allocators.png
	rm -f build/sphinx/html/_static/images/plot_python_allocators_native.png
	rm -f build/sphinx/html/_static/images/ports_tab.png
	rm -f build/sphinx/html/_static/images/pymalloc.png
	rm -f build/sphinx/html/_static/images/pytest_cli_output.png
	rm -f build/sphinx/html/_static/images/quotes.png
	rm -f build/sphinx/html/_static/images/rss_vs_heap.png
	rm -f build/sphinx/html/_static/images/rss_vs_heap_no_free.png
	rm -f build/sphinx/html/_static/images/simple_example.png
	rm -f build/sphinx/html/_static/images/stats_example.png
	rm -f build/sphinx/html/_static/images/summary_example.png
	rm -f build/sphinx/html/_static/images/table_example.png
	rm -f build/sphinx/html/_static/images/temporal_high_water_mark_controls.png
	rm -f build/sphinx/html/_static/images/tree_example.png

	# Create symlinks
	ln -sf ../../../_images/codespaces_testing_tab.png build/sphinx/html/_static/images/codespaces_testing_tab.png
	ln -sf ../../../_images/complex_example.png build/sphinx/html/_static/images/complex_example.png
	ln -sf ../../../_images/exercise1_flamegraph.png build/sphinx/html/_static/images/exercise1_flamegraph.png
	ln -sf ../../../_images/exercise2_flamegraph.png build/sphinx/html/_static/images/exercise2_flamegraph.png
	ln -sf ../../../_images/exercise3_flamegraph_basic.png build/sphinx/html/_static/images/exercise3_flamegraph_basic.png
	ln -sf ../../../_images/exercise3_flamegraph_native.png build/sphinx/html/_static/images/exercise3_flamegraph_native.png
	ln -sf ../../../_images/filter_thread_dropdown.png build/sphinx/html/_static/images/filter_thread_dropdown.png
	ln -sf ../../../_images/gprof2dot_example.png build/sphinx/html/_static/images/gprof2dot_example.png
	ln -sf ../../../_images/icicle_flame_toggle.png build/sphinx/html/_static/images/icicle_flame_toggle.png
	ln -sf ../../../_images/inverted_flame_graph_for_inverted_example.png build/sphinx/html/_static/images/inverted_flame_graph_for_inverted_example.png
	ln -sf ../../../_images/live_different_thread.png build/sphinx/html/_static/images/live_different_thread.png
	ln -sf ../../../_images/live_disconnected.png build/sphinx/html/_static/images/live_disconnected.png
	ln -sf ../../../_images/live_running.png build/sphinx/html/_static/images/live_running.png
	ln -sf ../../../_images/logo.png build/sphinx/html/_static/images/logo.png
	ln -sf ../../../logo.png build/sphinx/html/_static/logo.png
	ln -sf ../../../_images/mandelbrot_operation_native.png build/sphinx/html/_static/images/mandelbrot_operation_native.png
	ln -sf ../../../_images/mandelbrot_operation_non_native.png build/sphinx/html/_static/images/mandelbrot_operation_non_native.png
	ln -sf ../../../_images/native_mode_debug.png build/sphinx/html/_static/images/native_mode_debug.png
	ln -sf ../../../_images/native_mode_no_debug.png build/sphinx/html/_static/images/native_mode_no_debug.png
	ln -sf ../../../_images/non_relevant_checkbox.png build/sphinx/html/_static/images/non_relevant_checkbox.png
	ln -sf ../../../_images/normal_flamegraph_for_inverted_example.png build/sphinx/html/_static/images/normal_flamegraph_for_inverted_example.png
	ln -sf ../../../_images/output.png build/sphinx/html/_static/images/output.png
	ln -sf ../../../_images/plot_default_options.png

	dh_installdocs -ppython-memray-doc --doc-main-package=python-memray-doc build/sphinx/html
	dh_installdocs