| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/architecture.mk |
| 4 |
|
| 5 |
export PYBUILD_NAME=datasette |
| 6 |
export PYBUILD_DESTDIR_python3=debian/datasette |
| 7 |
export PYBUILD_BEFORE_TEST=cp -r {dir}/docs {build_dir} |
| 8 |
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/docs |
| 9 |
|
| 10 |
# Test exclusions: |
| 11 |
# - test_black.py, test_docs.py: require black/sphinx modules not needed at runtime |
| 12 |
# - test_publish_*.py: require network access |
| 13 |
# - test_cli_serve_server.py: requires installed datasette binary |
| 14 |
# - Individual tests using result.stderr: Click CliRunner compatibility issue |
| 15 |
# - test_database_page: Unicode handling difference in build environment |
| 16 |
# - test_max_csv_mb: timing-dependent, fails on slower architectures (i386, |
| 17 |
# riscv64) where SQLite's 200ms time limit fires before streaming starts |
| 18 |
export PYBUILD_TEST_ARGS=--ignore=tests/test_black.py \ |
| 19 |
--ignore=tests/test_docs.py \ |
| 20 |
--ignore=tests/test_publish_cloudrun.py \ |
| 21 |
--ignore=tests/test_publish_heroku.py \ |
| 22 |
--ignore=tests/test_cli_serve_server.py \ |
| 23 |
-k 'not test_serve_invalid_ports \ |
| 24 |
and not test_setting_type_validation \ |
| 25 |
and not test_sql_errors_logged_to_stderr \ |
| 26 |
and not test_error_on_config_json \ |
| 27 |
and not test_crossdb_warning_if_too_many_databases \ |
| 28 |
and not test_database_page \ |
| 29 |
and not test_max_csv_mb' |
| 30 |
|
| 31 |
%: |
| 32 |
dh $@ --buildsystem=pybuild |
| 33 |
|
| 34 |
ifeq ($(DEB_HOST_ARCH_BITS),32) |
| 35 |
override_dh_auto_test: |
| 36 |
# Reduce stack on 32bit archs to 1MB to avoid address space exhaustion |
| 37 |
ulimit -s 1024 && dh_auto_test |
| 38 |
endif |
| 39 |
|
| 40 |
execute_after_dh_auto_build: |
| 41 |
PYTHONPATH={build_dir} \ |
| 42 |
help2man --no-info --no-discard-stderr \ |
| 43 |
--name="multi-tool for exploring and publishing data" \ |
| 44 |
--output=debian/datasette.1 \ |
| 45 |
"python3 -m datasette" |
| 46 |
|
| 47 |
override_dh_sphinxdoc: |
| 48 |
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) |
| 49 |
PYTHONPATH=$$(dirname $$(find .pybuild/ -type d -name "datasette*dist-info" | head -n1)) \ |
| 50 |
python3 -m sphinx -b html docs/ -E -N \ |
| 51 |
debian/datasette-doc/usr/share/doc/datasette-doc/html/ |
| 52 |
dh_sphinxdoc |
| 53 |
endif |