#!/usr/bin/make -f

# Skip tests that need the internet
export HTTP_PROXY=127.0.0.1:9
export HTTPS_PROXY=127.0.0.1:9
export PYBUILD_TEST_ARGS=-v --deselect=tests/table/test_table.py::test_create_table \
	--deselect tests/table/test_table.py::StorageTableTest::test_create_table \
	--deselect tests/table/test_table.py::StorageTableTest::test_create_table_fail_on_exist \
	--deselect tests/table/test_table.py::StorageTableTest::test_create_table_with_already_existing_table \
	--deselect tests/table/test_table.py::StorageTableTest::test_create_table_with_already_existing_table_fail_on_exist \
	--deselect tests/table/test_table.py::StorageTableTest::test_delete_table_with_existing_table \
	--deselect tests/table/test_table.py::StorageTableTest::test_delete_table_with_existing_table_fail_not_exist \
	--deselect tests/table/test_table.py::StorageTableTest::test_delete_table_with_non_existing_table \
	--deselect tests/table/test_table.py::StorageTableTest::test_delete_table_with_non_existing_table_fail_not_exist \
	--deselect tests/table/test_table.py::StorageTableTest::test_get_table_acl \
	--deselect tests/table/test_table.py::StorageTableTest::test_list_tables \
	--deselect tests/table/test_table.py::StorageTableTest::test_list_tables_with_marker \
	--deselect tests/table/test_table.py::StorageTableTest::test_list_tables_with_num_results \
	--deselect tests/table/test_table.py::StorageTableTest::test_locale \
	--deselect tests/table/test_table.py::StorageTableTest::test_set_table_acl \
	--deselect tests/table/test_table.py::StorageTableTest::test_set_table_acl_too_many_ids \
	--deselect tests/table/test_table.py::StorageTableTest::test_set_table_acl_with_empty_signed_identifier \
	--deselect tests/table/test_table.py::StorageTableTest::test_set_table_acl_with_empty_signed_identifiers \
	--deselect tests/table/test_table.py::StorageTableTest::test_set_table_acl_with_signed_identifiers \
	--deselect tests/table/test_table.py::StorageTableTest::test_table_exists \
	--deselect tests/table/test_table.py::StorageTableTest::test_table_not_exists \
	--deselect tests/table/test_table.py::StorageTableTest::test_unicode_create_table_unicode_name \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_all_operations_together \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_all_operations_together_context_manager \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_delete \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_different_partition_operations_fail \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_insert \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_insert_merge \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_insert_replace \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_inserts \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_merge \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_reuse \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_same_row_operations_fail \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_too_many_ops \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_update \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_update_if_doesnt_match \
	--deselect tests/table/test_table_batch.py::StorageTableBatchTest::test_batch_update_if_match \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_batch_entity_inserts_context_manager \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_encrypt_multiple_properties \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_encrypted_dict \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_encrypted_entity \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_encrypted_entity_encryption_resolver \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_encrypted_entity_key_resolver \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_encrypted_entity_properties_and_resolver \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_entity_invalid_value_kek_unwrap \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_entity_missing_attribute_kek_unwrap \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_entity_no_decryption \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_entity_nonmatching_kid \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_payload_formats \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_strict_mode_no_key \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_get_strict_mode_unencrypted_entity \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_invalid_encryption_operations_fail \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_invalid_encryption_operations_fail_batch \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_property_resolver_decrypt_conflict \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_query_entities_all_properties \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_query_entities_mixed_mode \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_query_entities_projection \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_replace_entity \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_strict_mode_policy_no_encrypted_properties \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_table_ops_ignore_encryption \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_validate_encryption \
	--deselect tests/table/test_table_encryption.py::StorageTableEncryptionTest::test_validate_swapping_properties_fails \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_binary_property_value \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_delete_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_delete_entity_not_existing \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_delete_entity_with_if_doesnt_match \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_delete_entity_with_if_matches \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_empty_and_spaces_property_value \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_full_metadata \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_if_match \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_no_metadata \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_not_existing \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_with_property_resolver \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_with_property_resolver_invalid \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_with_property_resolver_not_supported \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_with_select \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_get_entity_with_special_doubles \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_entity_class_instance \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_entity_conflict \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_entity_dictionary \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_entity_empty_string_pk \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_entity_empty_string_rk \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_or_merge_entity_with_existing_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_or_merge_entity_with_non_existing_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_or_replace_entity_with_existing_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_insert_or_replace_entity_with_non_existing_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_merge_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_merge_entity_not_existing \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_merge_entity_with_if_doesnt_match \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_merge_entity_with_if_matches \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_none_property_value \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_operations_on_entity_with_partition_key_having_single_quote \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_full_metadata \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_large \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_no_metadata \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_with_filter \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_with_property_resolver \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_with_select \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_with_top \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_entities_with_top_and_next \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_query_zero_entities \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_timezone \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_unicode_property_name \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_unicode_property_value \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_update_entity \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_update_entity_with_if_doesnt_match \
	--deselect tests/table/test_table_entity.py::StorageTableEntityTest::test_update_entity_with_if_matches
export PYBUILD_AFTER_CLEAN=rm -rf azure_cosmosdb_table.egg-info doc/_build doc/api

%:
	dh $@ --with python3 --buildsystem=pybuild --sourcedirectory=azure-cosmosdb-table

override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	sphinx-apidoc -f -e -o azure-cosmosdb-table/doc/api azure-cosmosdb-table/azure/cosmosdb
	$(MAKE) -C azure-cosmosdb-table/doc man
endif
endif