From baffd113b7110e7993bf1e9dd06a5238480f4270 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 13 May 2026 16:41:58 +0000 Subject: [PATCH 1/2] feat: regenerate google-cloud-a packages This Pull Request drops support for Python <=3.9 in generated packages. This is part of our ongoing effort to modernize the Cloud Python SDK libraries and remove support for End-of-Life (EOL) Python versions. - Removed Python <=3.9 from testing, configuration, and constraints files. - Resolved dependency conflicts arising from dropping Python <=3.9 support. - Cleaned up obsolete code related to Python <=3.9 support. - Updated select copyright dates - Updated some autogenerated headings - Updated some tests to resolve issues discovered during this migration. --- .../google-cloud-access-approval/docs/conf.py | 4 +- .../cloud/accessapproval_v1/__init__.py | 25 +-- .../google-cloud-access-approval/noxfile.py | 4 +- .../google-cloud-access-approval/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../accessapproval_v1/test_access_approval.py | 20 +-- .../docs/conf.py | 4 +- .../advisorynotifications_v1/__init__.py | 25 +-- .../noxfile.py | 4 +- .../setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../test_advisory_notifications_service.py | 28 ++-- .../docs/conf.py | 4 +- .../cloud/alloydb/connectors_v1/__init__.py | 25 +-- .../alloydb/connectors_v1alpha/__init__.py | 25 +-- .../alloydb/connectors_v1beta/__init__.py | 25 +-- .../noxfile.py | 4 +- .../google-cloud-alloydb-connectors/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- packages/google-cloud-alloydb/docs/conf.py | 4 +- .../google/cloud/alloydb_v1/__init__.py | 25 +-- .../services/alloy_db_admin/async_client.py | 86 +++++----- .../alloy_dbcsql_admin/async_client.py | 6 +- .../cloud/alloydb_v1/types/resources.py | 4 +- .../google/cloud/alloydb_v1alpha/__init__.py | 25 +-- .../services/alloy_db_admin/async_client.py | 86 +++++----- .../alloy_dbcsql_admin/async_client.py | 6 +- .../cloud/alloydb_v1alpha/types/resources.py | 4 +- .../google/cloud/alloydb_v1beta/__init__.py | 25 +-- .../services/alloy_db_admin/async_client.py | 86 +++++----- .../alloy_dbcsql_admin/async_client.py | 6 +- .../cloud/alloydb_v1beta/types/resources.py | 4 +- packages/google-cloud-alloydb/noxfile.py | 4 +- ...y_db_admin_batch_create_instances_async.py | 6 +- ...ated_alloy_db_admin_create_backup_async.py | 6 +- ...ted_alloy_db_admin_create_cluster_async.py | 6 +- ...ed_alloy_db_admin_create_instance_async.py | 6 +- ...db_admin_create_secondary_cluster_async.py | 6 +- ...b_admin_create_secondary_instance_async.py | 6 +- ...ated_alloy_db_admin_delete_backup_async.py | 6 +- ...ted_alloy_db_admin_delete_cluster_async.py | 6 +- ...ed_alloy_db_admin_delete_instance_async.py | 6 +- ...ted_alloy_db_admin_export_cluster_async.py | 6 +- ..._alloy_db_admin_failover_instance_async.py | 6 +- ...ted_alloy_db_admin_import_cluster_async.py | 6 +- ...rated_alloy_db_admin_inject_fault_async.py | 6 +- ...ed_alloy_db_admin_promote_cluster_async.py | 6 +- ...d_alloy_db_admin_restart_instance_async.py | 6 +- ...ed_alloy_db_admin_restore_cluster_async.py | 6 +- ...alloy_db_admin_switchover_cluster_async.py | 6 +- ...ated_alloy_db_admin_update_backup_async.py | 6 +- ...ted_alloy_db_admin_update_cluster_async.py | 6 +- ...ed_alloy_db_admin_update_instance_async.py | 6 +- ...ed_alloy_db_admin_upgrade_cluster_async.py | 6 +- ...csql_admin_restore_from_cloud_sql_async.py | 6 +- ...y_db_admin_batch_create_instances_async.py | 6 +- ...ated_alloy_db_admin_create_backup_async.py | 6 +- ...ted_alloy_db_admin_create_cluster_async.py | 6 +- ...ed_alloy_db_admin_create_instance_async.py | 6 +- ...db_admin_create_secondary_cluster_async.py | 6 +- ...b_admin_create_secondary_instance_async.py | 6 +- ...ated_alloy_db_admin_delete_backup_async.py | 6 +- ...ted_alloy_db_admin_delete_cluster_async.py | 6 +- ...ed_alloy_db_admin_delete_instance_async.py | 6 +- ...ted_alloy_db_admin_export_cluster_async.py | 6 +- ..._alloy_db_admin_failover_instance_async.py | 6 +- ...ted_alloy_db_admin_import_cluster_async.py | 6 +- ...rated_alloy_db_admin_inject_fault_async.py | 6 +- ...ed_alloy_db_admin_promote_cluster_async.py | 6 +- ...d_alloy_db_admin_restart_instance_async.py | 6 +- ...ed_alloy_db_admin_restore_cluster_async.py | 6 +- ...alloy_db_admin_switchover_cluster_async.py | 6 +- ...ated_alloy_db_admin_update_backup_async.py | 6 +- ...ted_alloy_db_admin_update_cluster_async.py | 6 +- ...ed_alloy_db_admin_update_instance_async.py | 6 +- ...ed_alloy_db_admin_upgrade_cluster_async.py | 6 +- ...csql_admin_restore_from_cloud_sql_async.py | 6 +- ...y_db_admin_batch_create_instances_async.py | 6 +- ...ated_alloy_db_admin_create_backup_async.py | 6 +- ...ted_alloy_db_admin_create_cluster_async.py | 6 +- ...ed_alloy_db_admin_create_instance_async.py | 6 +- ...db_admin_create_secondary_cluster_async.py | 6 +- ...b_admin_create_secondary_instance_async.py | 6 +- ...ated_alloy_db_admin_delete_backup_async.py | 6 +- ...ted_alloy_db_admin_delete_cluster_async.py | 6 +- ...ed_alloy_db_admin_delete_instance_async.py | 6 +- ...ted_alloy_db_admin_export_cluster_async.py | 6 +- ..._alloy_db_admin_failover_instance_async.py | 6 +- ...ted_alloy_db_admin_import_cluster_async.py | 6 +- ...rated_alloy_db_admin_inject_fault_async.py | 6 +- ...ed_alloy_db_admin_promote_cluster_async.py | 6 +- ...d_alloy_db_admin_restart_instance_async.py | 6 +- ...ed_alloy_db_admin_restore_cluster_async.py | 6 +- ...alloy_db_admin_switchover_cluster_async.py | 6 +- ...ated_alloy_db_admin_update_backup_async.py | 6 +- ...ted_alloy_db_admin_update_cluster_async.py | 6 +- ...ed_alloy_db_admin_update_instance_async.py | 6 +- ...ed_alloy_db_admin_upgrade_cluster_async.py | 6 +- ...csql_admin_restore_from_cloud_sql_async.py | 6 +- packages/google-cloud-alloydb/setup.py | 11 +- .../testing/constraints-3.10.txt | 23 +-- .../testing/constraints-3.9.txt | 14 -- .../gapic/alloydb_v1/test_alloy_db_admin.py | 122 ++++++-------- .../alloydb_v1/test_alloy_dbcsql_admin.py | 16 +- .../alloydb_v1alpha/test_alloy_db_admin.py | 124 ++++++--------- .../test_alloy_dbcsql_admin.py | 16 +- .../alloydb_v1beta/test_alloy_db_admin.py | 124 ++++++--------- .../alloydb_v1beta/test_alloy_dbcsql_admin.py | 16 +- .../google-cloud-api-gateway/docs/conf.py | 4 +- .../google/cloud/apigateway_v1/__init__.py | 25 +-- .../api_gateway_service/async_client.py | 38 ++--- packages/google-cloud-api-gateway/noxfile.py | 4 +- ...ed_api_gateway_service_create_api_async.py | 6 +- ...gateway_service_create_api_config_async.py | 6 +- ...pi_gateway_service_create_gateway_async.py | 6 +- ...ed_api_gateway_service_delete_api_async.py | 6 +- ...gateway_service_delete_api_config_async.py | 6 +- ...pi_gateway_service_delete_gateway_async.py | 6 +- ...ed_api_gateway_service_update_api_async.py | 6 +- ...gateway_service_update_api_config_async.py | 6 +- ...pi_gateway_service_update_gateway_async.py | 6 +- packages/google-cloud-api-gateway/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../apigateway_v1/test_api_gateway_service.py | 62 +++----- packages/google-cloud-api-keys/docs/conf.py | 4 +- .../google/cloud/api_keys_v2/__init__.py | 25 +-- .../services/api_keys/async_client.py | 18 +-- packages/google-cloud-api-keys/noxfile.py | 4 +- ..._v2_generated_api_keys_create_key_async.py | 6 +- ..._v2_generated_api_keys_delete_key_async.py | 6 +- ...2_generated_api_keys_undelete_key_async.py | 6 +- ..._v2_generated_api_keys_update_key_async.py | 6 +- packages/google-cloud-api-keys/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../unit/gapic/api_keys_v2/test_api_keys.py | 36 ++--- .../google-cloud-apigee-connect/docs/conf.py | 4 +- .../google/cloud/apigeeconnect_v1/__init__.py | 25 +-- .../google-cloud-apigee-connect/noxfile.py | 4 +- packages/google-cloud-apigee-connect/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../test_connection_service.py | 20 +-- .../gapic/apigeeconnect_v1/test_tether.py | 14 +- .../google-cloud-apigee-registry/docs/conf.py | 4 +- .../cloud/apigee_registry_v1/__init__.py | 25 +-- .../services/provisioning/async_client.py | 10 +- .../google-cloud-apigee-registry/noxfile.py | 4 +- ...ated_provisioning_create_instance_async.py | 6 +- ...ated_provisioning_delete_instance_async.py | 6 +- .../google-cloud-apigee-registry/setup.py | 11 +- .../testing/constraints-3.10.txt | 23 +-- .../testing/constraints-3.9.txt | 14 -- .../apigee_registry_v1/test_provisioning.py | 20 +-- .../gapic/apigee_registry_v1/test_registry.py | 124 ++++++--------- packages/google-cloud-apihub/docs/conf.py | 4 +- .../google/cloud/apihub_v1/__init__.py | 25 +-- .../services/api_hub_collect/async_client.py | 6 +- .../services/api_hub_plugin/async_client.py | 26 +-- .../services/provisioning/async_client.py | 10 +- packages/google-cloud-apihub/noxfile.py | 4 +- ..._api_hub_collect_collect_api_data_async.py | 6 +- ...hub_plugin_create_plugin_instance_async.py | 6 +- ...ated_api_hub_plugin_delete_plugin_async.py | 6 +- ...hub_plugin_delete_plugin_instance_async.py | 6 +- ...in_disable_plugin_instance_action_async.py | 6 +- ...gin_enable_plugin_instance_action_async.py | 6 +- ...in_execute_plugin_instance_action_async.py | 6 +- ...visioning_create_api_hub_instance_async.py | 6 +- ...visioning_delete_api_hub_instance_async.py | 6 +- packages/google-cloud-apihub/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../unit/gapic/apihub_v1/test_api_hub.py | 138 ++++++---------- .../gapic/apihub_v1/test_api_hub_collect.py | 16 +- .../gapic/apihub_v1/test_api_hub_curate.py | 30 ++-- .../apihub_v1/test_api_hub_dependencies.py | 30 ++-- .../gapic/apihub_v1/test_api_hub_discovery.py | 30 ++-- .../gapic/apihub_v1/test_api_hub_plugin.py | 54 +++---- .../test_host_project_registration_service.py | 24 +-- .../gapic/apihub_v1/test_linting_service.py | 22 +-- .../unit/gapic/apihub_v1/test_provisioning.py | 22 +-- ...test_runtime_project_attachment_service.py | 28 ++-- .../google-cloud-apiregistry/docs/conf.py | 4 +- .../cloud/apiregistry_v1beta/__init__.py | 25 +-- packages/google-cloud-apiregistry/noxfile.py | 4 +- packages/google-cloud-apiregistry/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../test_cloud_api_registry.py | 34 ++-- .../google-cloud-appengine-admin/docs/conf.py | 4 +- .../cloud/appengine_admin_v1/__init__.py | 25 +-- .../services/applications/async_client.py | 14 +- .../services/domain_mappings/async_client.py | 14 +- .../services/instances/async_client.py | 10 +- .../services/services/async_client.py | 10 +- .../services/versions/async_client.py | 14 +- .../google-cloud-appengine-admin/noxfile.py | 4 +- ...d_applications_create_application_async.py | 6 +- ...d_applications_repair_application_async.py | 6 +- ...d_applications_update_application_async.py | 6 +- ...in_mappings_create_domain_mapping_async.py | 6 +- ...in_mappings_delete_domain_mapping_async.py | 6 +- ...in_mappings_update_domain_mapping_async.py | 6 +- ...enerated_instances_debug_instance_async.py | 6 +- ...nerated_instances_delete_instance_async.py | 6 +- ...generated_services_delete_service_async.py | 6 +- ...generated_services_update_service_async.py | 6 +- ...generated_versions_create_version_async.py | 6 +- ...generated_versions_delete_version_async.py | 6 +- ...generated_versions_update_version_async.py | 6 +- .../google-cloud-appengine-admin/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../appengine_admin_v1/test_applications.py | 14 +- .../test_authorized_certificates.py | 18 +-- .../test_authorized_domains.py | 20 +-- .../test_domain_mappings.py | 20 +-- .../gapic/appengine_admin_v1/test_firewall.py | 20 +-- .../appengine_admin_v1/test_instances.py | 20 +-- .../gapic/appengine_admin_v1/test_services.py | 20 +-- .../gapic/appengine_admin_v1/test_versions.py | 20 +-- .../docs/conf.py | 4 +- .../cloud/appengine_logging_v1/__init__.py | 25 +-- .../google-cloud-appengine-logging/noxfile.py | 4 +- .../google-cloud-appengine-logging/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- packages/google-cloud-apphub/docs/conf.py | 4 +- .../google/cloud/apphub_v1/__init__.py | 25 +-- .../services/app_hub/async_client.py | 46 +++--- packages/google-cloud-apphub/noxfile.py | 4 +- ...erated_app_hub_create_application_async.py | 6 +- ..._generated_app_hub_create_service_async.py | 6 +- ...create_service_project_attachment_async.py | 6 +- ...generated_app_hub_create_workload_async.py | 6 +- ...erated_app_hub_delete_application_async.py | 6 +- ..._generated_app_hub_delete_service_async.py | 6 +- ...delete_service_project_attachment_async.py | 6 +- ...generated_app_hub_delete_workload_async.py | 6 +- ...erated_app_hub_update_application_async.py | 6 +- ..._generated_app_hub_update_service_async.py | 6 +- ...generated_app_hub_update_workload_async.py | 6 +- packages/google-cloud-apphub/setup.py | 11 +- .../testing/constraints-3.10.txt | 23 +-- .../testing/constraints-3.9.txt | 14 -- .../unit/gapic/apphub_v1/test_app_hub.py | 102 +++++------- .../google-cloud-appoptimize/docs/conf.py | 4 +- .../cloud/appoptimize_v1beta/__init__.py | 25 +-- .../services/app_optimize/async_client.py | 6 +- packages/google-cloud-appoptimize/noxfile.py | 4 +- ...erated_app_optimize_create_report_async.py | 6 +- packages/google-cloud-appoptimize/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../appoptimize_v1beta/test_app_optimize.py | 36 ++--- .../docs/conf.py | 4 +- .../cloud/artifactregistry_v1/__init__.py | 25 +-- .../artifact_registry/async_client.py | 46 +++--- .../artifactregistry_v1beta2/__init__.py | 25 +-- .../artifact_registry/async_client.py | 26 +-- .../google-cloud-artifact-registry/noxfile.py | 4 +- ...ct_registry_batch_delete_versions_async.py | 6 +- ...tifact_registry_create_attachment_async.py | 6 +- ...tifact_registry_create_repository_async.py | 6 +- ...tifact_registry_delete_attachment_async.py | 6 +- ...ted_artifact_registry_delete_file_async.py | 6 +- ..._artifact_registry_delete_package_async.py | 6 +- ...tifact_registry_delete_repository_async.py | 6 +- ..._artifact_registry_delete_version_async.py | 6 +- ...artifact_registry_export_artifact_async.py | 6 +- ...act_registry_import_apt_artifacts_async.py | 6 +- ...act_registry_import_yum_artifacts_async.py | 6 +- ...tifact_registry_create_repository_async.py | 6 +- ..._artifact_registry_delete_package_async.py | 6 +- ...tifact_registry_delete_repository_async.py | 6 +- ..._artifact_registry_delete_version_async.py | 6 +- ...act_registry_import_apt_artifacts_async.py | 6 +- ...act_registry_import_yum_artifacts_async.py | 6 +- .../google-cloud-artifact-registry/setup.py | 11 +- .../testing/constraints-3.10.txt | 23 +-- .../testing/constraints-3.9.txt | 14 -- .../test_artifact_registry.py | 150 ++++++------------ .../test_artifact_registry.py | 60 ++----- packages/google-cloud-asset/docs/conf.py | 4 +- .../google/cloud/asset_v1/__init__.py | 25 +-- .../services/asset_service/async_client.py | 10 +- .../google/cloud/asset_v1p1beta1/__init__.py | 25 +-- .../google/cloud/asset_v1p2beta1/__init__.py | 25 +-- .../google/cloud/asset_v1p5beta1/__init__.py | 25 +-- packages/google-cloud-asset/noxfile.py | 4 +- ...ce_analyze_iam_policy_longrunning_async.py | 6 +- ...rated_asset_service_export_assets_async.py | 6 +- packages/google-cloud-asset/setup.py | 12 +- .../testing/constraints-3.10.txt | 27 ++-- .../testing/constraints-3.9.txt | 17 -- .../unit/gapic/asset_v1/test_asset_service.py | 98 ++++-------- .../asset_v1p1beta1/test_asset_service.py | 30 +--- .../asset_v1p2beta1/test_asset_service.py | 24 ++- .../asset_v1p5beta1/test_asset_service.py | 22 +-- .../docs/conf.py | 4 +- .../cloud/assuredworkloads_v1/__init__.py | 25 +-- .../assured_workloads_service/async_client.py | 6 +- .../assuredworkloads_v1beta1/__init__.py | 25 +-- .../assured_workloads_service/async_client.py | 6 +- .../google-cloud-assured-workloads/noxfile.py | 4 +- ...workloads_service_create_workload_async.py | 6 +- ...workloads_service_create_workload_async.py | 6 +- .../google-cloud-assured-workloads/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../test_assured_workloads_service.py | 38 ++--- .../test_assured_workloads_service.py | 26 +-- .../google-cloud-auditmanager/docs/conf.py | 4 +- .../google/cloud/auditmanager_v1/__init__.py | 25 +-- .../services/audit_manager/async_client.py | 6 +- packages/google-cloud-auditmanager/noxfile.py | 4 +- ...dit_manager_generate_audit_report_async.py | 6 +- packages/google-cloud-auditmanager/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 13 -- .../auditmanager_v1/test_audit_manager.py | 46 ++---- packages/google-cloud-automl/docs/conf.py | 4 +- .../google/cloud/automl_v1/__init__.py | 25 +-- .../services/auto_ml/async_client.py | 38 ++--- .../prediction_service/async_client.py | 6 +- .../google/cloud/automl_v1/types/io.py | 71 ++++++--- .../google/cloud/automl_v1beta1/__init__.py | 25 +-- .../services/auto_ml/async_client.py | 38 ++--- .../prediction_service/async_client.py | 6 +- packages/google-cloud-automl/noxfile.py | 4 +- ..._generated_auto_ml_create_dataset_async.py | 6 +- ...v1_generated_auto_ml_create_model_async.py | 6 +- ..._generated_auto_ml_delete_dataset_async.py | 6 +- ...v1_generated_auto_ml_delete_model_async.py | 6 +- ...v1_generated_auto_ml_deploy_model_async.py | 6 +- ..._v1_generated_auto_ml_export_data_async.py | 6 +- ...v1_generated_auto_ml_export_model_async.py | 6 +- ..._v1_generated_auto_ml_import_data_async.py | 6 +- ..._generated_auto_ml_undeploy_model_async.py | 6 +- ..._prediction_service_batch_predict_async.py | 6 +- ...a1_generated_auto_ml_create_model_async.py | 6 +- ..._generated_auto_ml_delete_dataset_async.py | 6 +- ...a1_generated_auto_ml_delete_model_async.py | 6 +- ...a1_generated_auto_ml_deploy_model_async.py | 6 +- ...ta1_generated_auto_ml_export_data_async.py | 6 +- ...auto_ml_export_evaluated_examples_async.py | 6 +- ...a1_generated_auto_ml_export_model_async.py | 6 +- ...ta1_generated_auto_ml_import_data_async.py | 6 +- ..._generated_auto_ml_undeploy_model_async.py | 6 +- ..._prediction_service_batch_predict_async.py | 6 +- packages/google-cloud-automl/setup.py | 11 +- .../testing/constraints-3.10.txt | 21 +-- .../testing/constraints-3.9.txt | 18 --- .../unit/gapic/automl_v1/test_auto_ml.py | 68 +++----- .../automl_v1/test_prediction_service.py | 18 +-- .../unit/gapic/automl_v1beta1/test_auto_ml.py | 92 ++++------- .../automl_v1beta1/test_prediction_service.py | 18 +-- 362 files changed, 2085 insertions(+), 3536 deletions(-) delete mode 100644 packages/google-cloud-access-approval/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-advisorynotifications/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-alloydb-connectors/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-alloydb/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-api-gateway/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-api-keys/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-apigee-connect/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-apigee-registry/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-apihub/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-apiregistry/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-appengine-admin/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-appengine-logging/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-apphub/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-appoptimize/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-artifact-registry/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-asset/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-assured-workloads/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-auditmanager/testing/constraints-3.9.txt delete mode 100644 packages/google-cloud-automl/testing/constraints-3.9.txt diff --git a/packages/google-cloud-access-approval/docs/conf.py b/packages/google-cloud-access-approval/docs/conf.py index 24aafc288986..d72933a9d685 100644 --- a/packages/google-cloud-access-approval/docs/conf.py +++ b/packages/google-cloud-access-approval/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-access-approval" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-access-approval/google/cloud/accessapproval_v1/__init__.py b/packages/google-cloud-access-approval/google/cloud/accessapproval_v1/__init__.py index c5ec929a2123..abffedbe7fe8 100644 --- a/packages/google-cloud-access-approval/google/cloud/accessapproval_v1/__init__.py +++ b/packages/google-cloud-access-approval/google/cloud/accessapproval_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.access_approval import AccessApprovalAsyncClient, AccessApprovalClient from .types.accessapproval import ( @@ -63,28 +57,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.accessapproval_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-access-approval/noxfile.py b/packages/google-cloud-access-approval/noxfile.py index d6a8cf47d154..4bf24da00ada 100644 --- a/packages/google-cloud-access-approval/noxfile.py +++ b/packages/google-cloud-access-approval/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-access-approval/setup.py b/packages/google-cloud-access-approval/setup.py index 1453290de178..cfe01a0a864d 100644 --- a/packages/google-cloud-access-approval/setup.py +++ b/packages/google-cloud-access-approval/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-access-approval/testing/constraints-3.10.txt b/packages/google-cloud-access-approval/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-access-approval/testing/constraints-3.10.txt +++ b/packages/google-cloud-access-approval/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-access-approval/testing/constraints-3.9.txt b/packages/google-cloud-access-approval/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-access-approval/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-access-approval/tests/unit/gapic/accessapproval_v1/test_access_approval.py b/packages/google-cloud-access-approval/tests/unit/gapic/accessapproval_v1/test_access_approval.py index 62eee46f7ede..0d964d13f875 100644 --- a/packages/google-cloud-access-approval/tests/unit/gapic/accessapproval_v1/test_access_approval.py +++ b/packages/google-cloud-access-approval/tests/unit/gapic/accessapproval_v1/test_access_approval.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1854,11 +1848,7 @@ async def test_list_approval_requests_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_approval_requests(request={}) - ).pages: + async for page_ in (await client.list_approval_requests(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-advisorynotifications/docs/conf.py b/packages/google-cloud-advisorynotifications/docs/conf.py index 83378ae9db86..1b7a12642661 100644 --- a/packages/google-cloud-advisorynotifications/docs/conf.py +++ b/packages/google-cloud-advisorynotifications/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-advisorynotifications" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/__init__.py b/packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/__init__.py index 02fafaef59e7..0c721afc0fc0 100644 --- a/packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/__init__.py +++ b/packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.advisory_notifications_service import ( AdvisoryNotificationsServiceAsyncClient, @@ -61,28 +55,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.advisorynotifications_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-advisorynotifications/noxfile.py b/packages/google-cloud-advisorynotifications/noxfile.py index 79a4a374fa34..803ec10f214b 100644 --- a/packages/google-cloud-advisorynotifications/noxfile.py +++ b/packages/google-cloud-advisorynotifications/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-advisorynotifications/setup.py b/packages/google-cloud-advisorynotifications/setup.py index 35a4aa8cffac..69048b7597e7 100644 --- a/packages/google-cloud-advisorynotifications/setup.py +++ b/packages/google-cloud-advisorynotifications/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-advisorynotifications/testing/constraints-3.10.txt b/packages/google-cloud-advisorynotifications/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-advisorynotifications/testing/constraints-3.10.txt +++ b/packages/google-cloud-advisorynotifications/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-advisorynotifications/testing/constraints-3.9.txt b/packages/google-cloud-advisorynotifications/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-advisorynotifications/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-advisorynotifications/tests/unit/gapic/advisorynotifications_v1/test_advisory_notifications_service.py b/packages/google-cloud-advisorynotifications/tests/unit/gapic/advisorynotifications_v1/test_advisory_notifications_service.py index f46b55e0d2b5..e5962310d51f 100644 --- a/packages/google-cloud-advisorynotifications/tests/unit/gapic/advisorynotifications_v1/test_advisory_notifications_service.py +++ b/packages/google-cloud-advisorynotifications/tests/unit/gapic/advisorynotifications_v1/test_advisory_notifications_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1962,11 +1956,7 @@ async def test_list_notifications_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_notifications(request={}) - ).pages: + async for page_ in (await client.list_notifications(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3072,7 +3062,7 @@ def test_list_notifications_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_notifications_rest_unset_required_fields(): @@ -3325,7 +3315,7 @@ def test_get_notification_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_notification_rest_unset_required_fields(): @@ -3503,7 +3493,7 @@ def test_get_settings_rest_required_fields(request_type=service.GetSettingsReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_settings_rest_unset_required_fields(): @@ -3677,7 +3667,7 @@ def test_update_settings_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_settings_rest_unset_required_fields(): diff --git a/packages/google-cloud-alloydb-connectors/docs/conf.py b/packages/google-cloud-alloydb-connectors/docs/conf.py index 1509769410e9..816fa6916e20 100644 --- a/packages/google-cloud-alloydb-connectors/docs/conf.py +++ b/packages/google-cloud-alloydb-connectors/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-alloydb-connectors" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1/__init__.py b/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1/__init__.py index 0e9e13b85f1e..31debc4106be 100644 --- a/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1/__init__.py +++ b/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .types.resources import MetadataExchangeRequest, MetadataExchangeResponse @@ -40,28 +34,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.alloydb.connectors_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1alpha/__init__.py b/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1alpha/__init__.py index 9fa9c91250f0..a98244871cda 100644 --- a/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1alpha/__init__.py +++ b/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1alpha/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .types.resources import MetadataExchangeRequest, MetadataExchangeResponse @@ -40,28 +34,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.alloydb.connectors_v1alpha" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1beta/__init__.py b/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1beta/__init__.py index 0e05c0b64696..66c5491aeda7 100644 --- a/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1beta/__init__.py +++ b/packages/google-cloud-alloydb-connectors/google/cloud/alloydb/connectors_v1beta/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .types.resources import MetadataExchangeRequest, MetadataExchangeResponse @@ -40,28 +34,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.alloydb.connectors_v1beta" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-alloydb-connectors/noxfile.py b/packages/google-cloud-alloydb-connectors/noxfile.py index 1720b4b4f31a..e1512614a06a 100644 --- a/packages/google-cloud-alloydb-connectors/noxfile.py +++ b/packages/google-cloud-alloydb-connectors/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-alloydb-connectors/setup.py b/packages/google-cloud-alloydb-connectors/setup.py index f69d50cfb965..a32dd0c22e79 100644 --- a/packages/google-cloud-alloydb-connectors/setup.py +++ b/packages/google-cloud-alloydb-connectors/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-alloydb-connectors/testing/constraints-3.10.txt b/packages/google-cloud-alloydb-connectors/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-alloydb-connectors/testing/constraints-3.10.txt +++ b/packages/google-cloud-alloydb-connectors/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-alloydb-connectors/testing/constraints-3.9.txt b/packages/google-cloud-alloydb-connectors/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-alloydb-connectors/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-alloydb/docs/conf.py b/packages/google-cloud-alloydb/docs/conf.py index 05846a91dd19..a08741ad6278 100644 --- a/packages/google-cloud-alloydb/docs/conf.py +++ b/packages/google-cloud-alloydb/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-alloydb" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/__init__.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/__init__.py index 6849b3ac2d54..5b2a718d48ac 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/__init__.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.alloy_db_admin import AlloyDBAdminAsyncClient, AlloyDBAdminClient from .services.alloy_dbcsql_admin import ( @@ -130,28 +124,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.alloydb_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_db_admin/async_client.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_db_admin/async_client.py index 0cb4cef4115e..a4ac623f4067 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_db_admin/async_client.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_db_admin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -618,11 +618,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -766,11 +766,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -923,11 +923,11 @@ async def sample_export_cluster(): ) # Make the request - operation = client.export_cluster(request=request) + operation = await client.export_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1099,11 +1099,11 @@ async def sample_import_cluster(): ) # Make the request - operation = client.import_cluster(request=request) + operation = await client.import_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1261,11 +1261,11 @@ async def sample_upgrade_cluster(): ) # Make the request - operation = client.upgrade_cluster(request=request) + operation = await client.upgrade_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1396,11 +1396,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1532,11 +1532,11 @@ async def sample_promote_cluster(): ) # Make the request - operation = client.promote_cluster(request=request) + operation = await client.promote_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1662,11 +1662,11 @@ async def sample_switchover_cluster(): ) # Make the request - operation = client.switchover_cluster(request=request) + operation = await client.switchover_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1802,11 +1802,11 @@ async def sample_restore_cluster(): ) # Make the request - operation = client.restore_cluster(request=request) + operation = await client.restore_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1914,11 +1914,11 @@ async def sample_create_secondary_cluster(): ) # Make the request - operation = client.create_secondary_cluster(request=request) + operation = await client.create_secondary_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2313,11 +2313,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2462,11 +2462,11 @@ async def sample_create_secondary_instance(): ) # Make the request - operation = client.create_secondary_instance(request=request) + operation = await client.create_secondary_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2621,11 +2621,11 @@ async def sample_batch_create_instances(): ) # Make the request - operation = client.batch_create_instances(request=request) + operation = await client.batch_create_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2727,11 +2727,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2864,11 +2864,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2999,11 +2999,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3128,11 +3128,11 @@ async def sample_inject_fault(): ) # Make the request - operation = client.inject_fault(request=request) + operation = await client.inject_fault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3264,11 +3264,11 @@ async def sample_restart_instance(): ) # Make the request - operation = client.restart_instance(request=request) + operation = await client.restart_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3788,11 +3788,11 @@ async def sample_create_backup(): ) # Make the request - operation = client.create_backup(request=request) + operation = await client.create_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3931,11 +3931,11 @@ async def sample_update_backup(): ) # Make the request - operation = client.update_backup(request=request) + operation = await client.update_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4069,11 +4069,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_dbcsql_admin/async_client.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_dbcsql_admin/async_client.py index fc101c598ed0..299eb9f557b2 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_dbcsql_admin/async_client.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/services/alloy_dbcsql_admin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -359,11 +359,11 @@ async def sample_restore_from_cloud_sql(): ) # Make the request - operation = client.restore_from_cloud_sql(request=request) + operation = await client.restore_from_cloud_sql(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/types/resources.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/types/resources.py index 1d185531d40c..bad6a904c58b 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1/types/resources.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1/types/resources.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1655,7 +1655,7 @@ class QueryInsightsInstanceConfig(proto.Message): query_string_length (int): Query string length. The default value is 1024. Any integer between 256 and 4500 is - considered valid. + considered valid. query_plans_per_minute (int): Number of query execution plans captured by Insights per minute for all queries combined. diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/__init__.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/__init__.py index 241105bf128b..2745dc6bc514 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/__init__.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.alloy_db_admin import AlloyDBAdminAsyncClient, AlloyDBAdminClient from .services.alloy_dbcsql_admin import ( @@ -138,28 +132,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.alloydb_v1alpha" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_db_admin/async_client.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_db_admin/async_client.py index 8d5ef443544f..17b579e861a6 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_db_admin/async_client.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_db_admin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -624,11 +624,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -772,11 +772,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -929,11 +929,11 @@ async def sample_export_cluster(): ) # Make the request - operation = client.export_cluster(request=request) + operation = await client.export_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1105,11 +1105,11 @@ async def sample_import_cluster(): ) # Make the request - operation = client.import_cluster(request=request) + operation = await client.import_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1267,11 +1267,11 @@ async def sample_upgrade_cluster(): ) # Make the request - operation = client.upgrade_cluster(request=request) + operation = await client.upgrade_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1402,11 +1402,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1538,11 +1538,11 @@ async def sample_promote_cluster(): ) # Make the request - operation = client.promote_cluster(request=request) + operation = await client.promote_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1668,11 +1668,11 @@ async def sample_switchover_cluster(): ) # Make the request - operation = client.switchover_cluster(request=request) + operation = await client.switchover_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1808,11 +1808,11 @@ async def sample_restore_cluster(): ) # Make the request - operation = client.restore_cluster(request=request) + operation = await client.restore_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1920,11 +1920,11 @@ async def sample_create_secondary_cluster(): ) # Make the request - operation = client.create_secondary_cluster(request=request) + operation = await client.create_secondary_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2319,11 +2319,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2468,11 +2468,11 @@ async def sample_create_secondary_instance(): ) # Make the request - operation = client.create_secondary_instance(request=request) + operation = await client.create_secondary_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2627,11 +2627,11 @@ async def sample_batch_create_instances(): ) # Make the request - operation = client.batch_create_instances(request=request) + operation = await client.batch_create_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2733,11 +2733,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2870,11 +2870,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3005,11 +3005,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3134,11 +3134,11 @@ async def sample_inject_fault(): ) # Make the request - operation = client.inject_fault(request=request) + operation = await client.inject_fault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3270,11 +3270,11 @@ async def sample_restart_instance(): ) # Make the request - operation = client.restart_instance(request=request) + operation = await client.restart_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3795,11 +3795,11 @@ async def sample_create_backup(): ) # Make the request - operation = client.create_backup(request=request) + operation = await client.create_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3938,11 +3938,11 @@ async def sample_update_backup(): ) # Make the request - operation = client.update_backup(request=request) + operation = await client.update_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4076,11 +4076,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_dbcsql_admin/async_client.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_dbcsql_admin/async_client.py index 11d8d1d18bc0..1041359d689e 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_dbcsql_admin/async_client.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/services/alloy_dbcsql_admin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -359,11 +359,11 @@ async def sample_restore_from_cloud_sql(): ) # Make the request - operation = client.restore_from_cloud_sql(request=request) + operation = await client.restore_from_cloud_sql(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/types/resources.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/types/resources.py index 5e4ac27f3d3d..d78f708b4359 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/types/resources.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/types/resources.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1698,7 +1698,7 @@ class QueryInsightsInstanceConfig(proto.Message): query_string_length (int): Query string length. The default value is 1024. Any integer between 256 and 4500 is - considered valid. + considered valid. query_plans_per_minute (int): Number of query execution plans captured by Insights per minute for all queries combined. diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/__init__.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/__init__.py index e17512954ffa..5fe84055a0e0 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/__init__.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.alloy_db_admin import AlloyDBAdminAsyncClient, AlloyDBAdminClient from .services.alloy_dbcsql_admin import ( @@ -138,28 +132,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.alloydb_v1beta" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_db_admin/async_client.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_db_admin/async_client.py index f949850773d3..f7d06babd08b 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_db_admin/async_client.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_db_admin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -624,11 +624,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -772,11 +772,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -929,11 +929,11 @@ async def sample_export_cluster(): ) # Make the request - operation = client.export_cluster(request=request) + operation = await client.export_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1105,11 +1105,11 @@ async def sample_import_cluster(): ) # Make the request - operation = client.import_cluster(request=request) + operation = await client.import_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1267,11 +1267,11 @@ async def sample_upgrade_cluster(): ) # Make the request - operation = client.upgrade_cluster(request=request) + operation = await client.upgrade_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1402,11 +1402,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1538,11 +1538,11 @@ async def sample_promote_cluster(): ) # Make the request - operation = client.promote_cluster(request=request) + operation = await client.promote_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1668,11 +1668,11 @@ async def sample_switchover_cluster(): ) # Make the request - operation = client.switchover_cluster(request=request) + operation = await client.switchover_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1808,11 +1808,11 @@ async def sample_restore_cluster(): ) # Make the request - operation = client.restore_cluster(request=request) + operation = await client.restore_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1920,11 +1920,11 @@ async def sample_create_secondary_cluster(): ) # Make the request - operation = client.create_secondary_cluster(request=request) + operation = await client.create_secondary_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2319,11 +2319,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2468,11 +2468,11 @@ async def sample_create_secondary_instance(): ) # Make the request - operation = client.create_secondary_instance(request=request) + operation = await client.create_secondary_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2627,11 +2627,11 @@ async def sample_batch_create_instances(): ) # Make the request - operation = client.batch_create_instances(request=request) + operation = await client.batch_create_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2733,11 +2733,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2870,11 +2870,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3005,11 +3005,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3134,11 +3134,11 @@ async def sample_inject_fault(): ) # Make the request - operation = client.inject_fault(request=request) + operation = await client.inject_fault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3270,11 +3270,11 @@ async def sample_restart_instance(): ) # Make the request - operation = client.restart_instance(request=request) + operation = await client.restart_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3795,11 +3795,11 @@ async def sample_create_backup(): ) # Make the request - operation = client.create_backup(request=request) + operation = await client.create_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3938,11 +3938,11 @@ async def sample_update_backup(): ) # Make the request - operation = client.update_backup(request=request) + operation = await client.update_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -4076,11 +4076,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_dbcsql_admin/async_client.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_dbcsql_admin/async_client.py index d2bf30a1b0e2..f61be65ac1c8 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_dbcsql_admin/async_client.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_dbcsql_admin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -359,11 +359,11 @@ async def sample_restore_from_cloud_sql(): ) # Make the request - operation = client.restore_from_cloud_sql(request=request) + operation = await client.restore_from_cloud_sql(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/types/resources.py b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/types/resources.py index 624e72dd7c1d..ff5a05bb29d2 100644 --- a/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/types/resources.py +++ b/packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/types/resources.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1690,7 +1690,7 @@ class QueryInsightsInstanceConfig(proto.Message): query_string_length (int): Query string length. The default value is 1024. Any integer between 256 and 4500 is - considered valid. + considered valid. query_plans_per_minute (int): Number of query execution plans captured by Insights per minute for all queries combined. diff --git a/packages/google-cloud-alloydb/noxfile.py b/packages/google-cloud-alloydb/noxfile.py index 94a9f19c779e..caaec7eb0645 100644 --- a/packages/google-cloud-alloydb/noxfile.py +++ b/packages/google-cloud-alloydb/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_batch_create_instances_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_batch_create_instances_async.py index cadef9e12de8..98d36d286940 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_batch_create_instances_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_batch_create_instances_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_batch_create_instances(): ) # Make the request - operation = client.batch_create_instances(request=request) + operation = await client.batch_create_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_backup_async.py index bd5c995f2870..5b84c47b2804 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_backup(): ) # Make the request - operation = client.create_backup(request=request) + operation = await client.create_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_cluster_async.py index dd2d63726631..f11506512cbc 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_instance_async.py index 307eb9fd73e8..390c3a7173d7 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_cluster_async.py index 5f7e41c3e212..c7a8445aad67 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_secondary_cluster(): ) # Make the request - operation = client.create_secondary_cluster(request=request) + operation = await client.create_secondary_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_instance_async.py index 7b09acf02adb..f68518e7722f 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_create_secondary_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_secondary_instance(): ) # Make the request - operation = client.create_secondary_instance(request=request) + operation = await client.create_secondary_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_backup_async.py index 38bc43e2d86e..4a19a8da4b66 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_cluster_async.py index c404cd77c170..21f29de995fb 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_instance_async.py index a85d7612d390..f3b529c85812 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_delete_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_export_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_export_cluster_async.py index 199203dab014..4b94e23d4b51 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_export_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_export_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +53,11 @@ async def sample_export_cluster(): ) # Make the request - operation = client.export_cluster(request=request) + operation = await client.export_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_failover_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_failover_instance_async.py index 6071c8e16bd3..0fc0d152231f 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_failover_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_failover_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_import_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_import_cluster_async.py index 9fa79b2eba1c..18a695807c54 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_import_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_import_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_import_cluster(): ) # Make the request - operation = client.import_cluster(request=request) + operation = await client.import_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_inject_fault_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_inject_fault_async.py index 60d14446411e..f960c33273c4 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_inject_fault_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_inject_fault_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_inject_fault(): ) # Make the request - operation = client.inject_fault(request=request) + operation = await client.inject_fault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_promote_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_promote_cluster_async.py index fc66aa0565c7..a32e9ce5d27a 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_promote_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_promote_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_promote_cluster(): ) # Make the request - operation = client.promote_cluster(request=request) + operation = await client.promote_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restart_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restart_instance_async.py index 51343f731bb3..20c41c494100 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restart_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restart_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_restart_instance(): ) # Make the request - operation = client.restart_instance(request=request) + operation = await client.restart_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restore_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restore_cluster_async.py index 3afea19b9de2..697429c5cccb 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restore_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_restore_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,11 +54,11 @@ async def sample_restore_cluster(): ) # Make the request - operation = client.restore_cluster(request=request) + operation = await client.restore_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_switchover_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_switchover_cluster_async.py index 74d5da2403ab..301ee8121d04 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_switchover_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_switchover_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_switchover_cluster(): ) # Make the request - operation = client.switchover_cluster(request=request) + operation = await client.switchover_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_backup_async.py index 19970ac0fbdb..bcd7567e039b 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_backup(): ) # Make the request - operation = client.update_backup(request=request) + operation = await client.update_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_cluster_async.py index 6a644b2e1100..fc1a9284f534 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_instance_async.py index f14a31268aaa..0fb1ea722632 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_update_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_upgrade_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_upgrade_cluster_async.py index ea5a139dd0e2..468e489cb04a 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_upgrade_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_db_admin_upgrade_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_upgrade_cluster(): ) # Make the request - operation = client.upgrade_cluster(request=request) + operation = await client.upgrade_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py index 38bc3f1d7543..8260204efd8e 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,11 +55,11 @@ async def sample_restore_from_cloud_sql(): ) # Make the request - operation = client.restore_from_cloud_sql(request=request) + operation = await client.restore_from_cloud_sql(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_batch_create_instances_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_batch_create_instances_async.py index c9a424e20bc2..651519f7bb81 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_batch_create_instances_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_batch_create_instances_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_batch_create_instances(): ) # Make the request - operation = client.batch_create_instances(request=request) + operation = await client.batch_create_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_backup_async.py index b7ab20d13f17..321e23a72855 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_backup(): ) # Make the request - operation = client.create_backup(request=request) + operation = await client.create_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_cluster_async.py index 33d2462d4d2e..10c666a21a4e 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_instance_async.py index 0197650053fd..7e24c2958b97 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_cluster_async.py index c6040127b252..06b0e9204c53 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_secondary_cluster(): ) # Make the request - operation = client.create_secondary_cluster(request=request) + operation = await client.create_secondary_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_instance_async.py index f7cf02809e5c..c0b21feed9ff 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_create_secondary_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_secondary_instance(): ) # Make the request - operation = client.create_secondary_instance(request=request) + operation = await client.create_secondary_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_backup_async.py index 1e5677a13c97..ddb462c6cf58 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_cluster_async.py index 08d960374a34..a22016967e48 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_instance_async.py index 2961fcb3f345..fc66bc261eff 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_delete_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_export_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_export_cluster_async.py index f67673327c50..943f93d99738 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_export_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_export_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +53,11 @@ async def sample_export_cluster(): ) # Make the request - operation = client.export_cluster(request=request) + operation = await client.export_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_failover_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_failover_instance_async.py index d084da73e600..c300908879fc 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_failover_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_failover_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_import_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_import_cluster_async.py index cf1aaff68ddc..2c7e33e3e537 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_import_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_import_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_import_cluster(): ) # Make the request - operation = client.import_cluster(request=request) + operation = await client.import_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_inject_fault_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_inject_fault_async.py index a5ecc0623603..05574a507463 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_inject_fault_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_inject_fault_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_inject_fault(): ) # Make the request - operation = client.inject_fault(request=request) + operation = await client.inject_fault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_promote_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_promote_cluster_async.py index 91cc0ac6073b..5741584c93a6 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_promote_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_promote_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_promote_cluster(): ) # Make the request - operation = client.promote_cluster(request=request) + operation = await client.promote_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restart_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restart_instance_async.py index 29ff21ad3c9b..010bcc0289bc 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restart_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restart_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_restart_instance(): ) # Make the request - operation = client.restart_instance(request=request) + operation = await client.restart_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restore_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restore_cluster_async.py index 26a0ab0244e9..2484c7de6893 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restore_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_restore_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,11 +54,11 @@ async def sample_restore_cluster(): ) # Make the request - operation = client.restore_cluster(request=request) + operation = await client.restore_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_switchover_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_switchover_cluster_async.py index 9586a67146a2..5d6d7e286f88 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_switchover_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_switchover_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_switchover_cluster(): ) # Make the request - operation = client.switchover_cluster(request=request) + operation = await client.switchover_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_backup_async.py index 3671d87f9762..68aba41f9b44 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_backup(): ) # Make the request - operation = client.update_backup(request=request) + operation = await client.update_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_cluster_async.py index 3bb3fbeee880..7e7cd5566f2c 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_instance_async.py index 907eaffec007..f81e990c4968 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_update_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_upgrade_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_upgrade_cluster_async.py index db8f21f3fa29..66b653959be4 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_upgrade_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_db_admin_upgrade_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_upgrade_cluster(): ) # Make the request - operation = client.upgrade_cluster(request=request) + operation = await client.upgrade_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py index 13d9cb5d9150..5bce0a1e6c47 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1alpha_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,11 +55,11 @@ async def sample_restore_from_cloud_sql(): ) # Make the request - operation = client.restore_from_cloud_sql(request=request) + operation = await client.restore_from_cloud_sql(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_batch_create_instances_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_batch_create_instances_async.py index 8996381fd4ba..9542c77091c0 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_batch_create_instances_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_batch_create_instances_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_batch_create_instances(): ) # Make the request - operation = client.batch_create_instances(request=request) + operation = await client.batch_create_instances(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_backup_async.py index 798978699087..886564f1c8fb 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_backup(): ) # Make the request - operation = client.create_backup(request=request) + operation = await client.create_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_cluster_async.py index e163cd7edb43..ac493b9689da 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_cluster(): ) # Make the request - operation = client.create_cluster(request=request) + operation = await client.create_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_instance_async.py index a8b07f2fe75d..a0d2107aef3f 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_cluster_async.py index 6c90dbbe9a27..6ef65fd0e0a8 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_secondary_cluster(): ) # Make the request - operation = client.create_secondary_cluster(request=request) + operation = await client.create_secondary_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_instance_async.py index 2998ae25720b..ce83d263aba3 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_create_secondary_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_secondary_instance(): ) # Make the request - operation = client.create_secondary_instance(request=request) + operation = await client.create_secondary_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_backup_async.py index 516e391993f6..a122330f1127 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_backup(): ) # Make the request - operation = client.delete_backup(request=request) + operation = await client.delete_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_cluster_async.py index ba131a66a9dd..17deec4a127b 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_cluster(): ) # Make the request - operation = client.delete_cluster(request=request) + operation = await client.delete_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_instance_async.py index 44263cb80e6c..5623ae27fa5f 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_delete_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_export_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_export_cluster_async.py index 872c47c7d36c..be98224acf9f 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_export_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_export_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +53,11 @@ async def sample_export_cluster(): ) # Make the request - operation = client.export_cluster(request=request) + operation = await client.export_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_failover_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_failover_instance_async.py index 85851fd820b0..c25bf38c4f90 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_failover_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_failover_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_failover_instance(): ) # Make the request - operation = client.failover_instance(request=request) + operation = await client.failover_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_import_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_import_cluster_async.py index 974eb39e45bd..0423623fa403 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_import_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_import_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_import_cluster(): ) # Make the request - operation = client.import_cluster(request=request) + operation = await client.import_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_inject_fault_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_inject_fault_async.py index 3ab0d385549d..71cab5e6f879 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_inject_fault_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_inject_fault_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_inject_fault(): ) # Make the request - operation = client.inject_fault(request=request) + operation = await client.inject_fault(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_promote_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_promote_cluster_async.py index 11476af59aaf..f2a1632694d8 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_promote_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_promote_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_promote_cluster(): ) # Make the request - operation = client.promote_cluster(request=request) + operation = await client.promote_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restart_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restart_instance_async.py index 289a29a34b60..fb0debe2366b 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restart_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restart_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_restart_instance(): ) # Make the request - operation = client.restart_instance(request=request) + operation = await client.restart_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restore_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restore_cluster_async.py index 65807a6ce711..bffd09efdac8 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restore_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_restore_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,11 +54,11 @@ async def sample_restore_cluster(): ) # Make the request - operation = client.restore_cluster(request=request) + operation = await client.restore_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_switchover_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_switchover_cluster_async.py index a1f248195b28..76651bbf520f 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_switchover_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_switchover_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_switchover_cluster(): ) # Make the request - operation = client.switchover_cluster(request=request) + operation = await client.switchover_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_backup_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_backup_async.py index 42e593a4757a..70f46a1550b5 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_backup_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_backup_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_backup(): ) # Make the request - operation = client.update_backup(request=request) + operation = await client.update_backup(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_cluster_async.py index 4af65df303bf..022af37f6cc6 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_update_cluster(): ) # Make the request - operation = client.update_cluster(request=request) + operation = await client.update_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_instance_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_instance_async.py index 43727efa2d4f..08fdd49cd755 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_instance_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_update_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_instance(): ) # Make the request - operation = client.update_instance(request=request) + operation = await client.update_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_upgrade_cluster_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_upgrade_cluster_async.py index df8bb2e6b8ce..752c1d4593ab 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_upgrade_cluster_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_db_admin_upgrade_cluster_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_upgrade_cluster(): ) # Make the request - operation = client.upgrade_cluster(request=request) + operation = await client.upgrade_cluster(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py index 9c99b3295615..d0ff3ebcbe10 100644 --- a/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py +++ b/packages/google-cloud-alloydb/samples/generated_samples/alloydb_v1beta_generated_alloy_dbcsql_admin_restore_from_cloud_sql_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,11 +55,11 @@ async def sample_restore_from_cloud_sql(): ) # Make the request - operation = client.restore_from_cloud_sql(request=request) + operation = await client.restore_from_cloud_sql(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-alloydb/setup.py b/packages/google-cloud-alloydb/setup.py index 7d665d1514ba..9fc5f7481d3a 100644 --- a/packages/google-cloud-alloydb/setup.py +++ b/packages/google-cloud-alloydb/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -72,7 +72,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -80,7 +80,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -91,7 +90,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-alloydb/testing/constraints-3.10.txt b/packages/google-cloud-alloydb/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-alloydb/testing/constraints-3.10.txt +++ b/packages/google-cloud-alloydb/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 +grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-alloydb/testing/constraints-3.9.txt b/packages/google-cloud-alloydb/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-alloydb/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_db_admin.py b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_db_admin.py index 6c4493dbb5f8..9d9dea962d4e 100644 --- a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_db_admin.py +++ b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_db_admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1825,11 +1819,7 @@ async def test_list_clusters_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_clusters(request={}) - ).pages: + async for page_ in (await client.list_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6144,11 +6134,7 @@ async def test_list_instances_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10073,11 +10059,7 @@ async def test_list_backups_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_backups(request={}) - ).pages: + async for page_ in (await client.list_backups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12006,9 +11988,7 @@ async def test_list_supported_database_flags_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_supported_database_flags(request={}) ).pages: pages.append(page_) @@ -13237,11 +13217,7 @@ async def test_list_users_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_users(request={}) - ).pages: + async for page_ in (await client.list_users(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15108,11 +15084,7 @@ async def test_list_databases_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_databases(request={}) - ).pages: + async for page_ in (await client.list_databases(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15233,7 +15205,7 @@ def test_list_clusters_rest_required_fields(request_type=service.ListClustersReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_clusters_rest_unset_required_fields(): @@ -15481,7 +15453,7 @@ def test_get_cluster_rest_required_fields(request_type=service.GetClusterRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_rest_unset_required_fields(): @@ -15679,7 +15651,7 @@ def test_create_cluster_rest_required_fields(request_type=service.CreateClusterR ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cluster_rest_unset_required_fields(): @@ -15881,7 +15853,7 @@ def test_update_cluster_rest_required_fields(request_type=service.UpdateClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_cluster_rest_unset_required_fields(): @@ -16079,7 +16051,7 @@ def test_export_cluster_rest_required_fields(request_type=service.ExportClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_cluster_rest_unset_required_fields(): @@ -16277,7 +16249,7 @@ def test_import_cluster_rest_required_fields(request_type=service.ImportClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_cluster_rest_unset_required_fields(): @@ -16469,7 +16441,7 @@ def test_upgrade_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_upgrade_cluster_rest_unset_required_fields(): @@ -16663,7 +16635,7 @@ def test_delete_cluster_rest_required_fields(request_type=service.DeleteClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cluster_rest_unset_required_fields(): @@ -16850,7 +16822,7 @@ def test_promote_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_promote_cluster_rest_unset_required_fields(): @@ -17032,7 +17004,7 @@ def test_switchover_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_switchover_cluster_rest_unset_required_fields(): @@ -17214,7 +17186,7 @@ def test_restore_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_cluster_rest_unset_required_fields(): @@ -17371,7 +17343,7 @@ def test_create_secondary_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_secondary_cluster_rest_unset_required_fields(): @@ -17577,7 +17549,7 @@ def test_list_instances_rest_required_fields(request_type=service.ListInstancesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -17830,7 +17802,7 @@ def test_get_instance_rest_required_fields(request_type=service.GetInstanceReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -18033,7 +18005,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -18258,7 +18230,7 @@ def test_create_secondary_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_secondary_instance_rest_unset_required_fields(): @@ -18464,7 +18436,7 @@ def test_batch_create_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_create_instances_rest_unset_required_fields(): @@ -18598,7 +18570,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -18799,7 +18771,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -18990,7 +18962,7 @@ def test_failover_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_failover_instance_rest_unset_required_fields(): @@ -19168,7 +19140,7 @@ def test_inject_fault_rest_required_fields(request_type=service.InjectFaultReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_inject_fault_rest_unset_required_fields(): @@ -19360,7 +19332,7 @@ def test_restart_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restart_instance_rest_unset_required_fields(): @@ -19545,7 +19517,7 @@ def test_execute_sql_rest_required_fields(request_type=service.ExecuteSqlRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_execute_sql_rest_unset_required_fields(): @@ -19748,7 +19720,7 @@ def test_list_backups_rest_required_fields(request_type=service.ListBackupsReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backups_rest_unset_required_fields(): @@ -19994,7 +19966,7 @@ def test_get_backup_rest_required_fields(request_type=service.GetBackupRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_rest_unset_required_fields(): @@ -20192,7 +20164,7 @@ def test_create_backup_rest_required_fields(request_type=service.CreateBackupReq ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_backup_rest_unset_required_fields(): @@ -20390,7 +20362,7 @@ def test_update_backup_rest_required_fields(request_type=service.UpdateBackupReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_backup_rest_unset_required_fields(): @@ -20587,7 +20559,7 @@ def test_delete_backup_rest_required_fields(request_type=service.DeleteBackupReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_backup_rest_unset_required_fields(): @@ -20784,7 +20756,7 @@ def test_list_supported_database_flags_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_supported_database_flags_rest_unset_required_fields(): @@ -21042,7 +21014,7 @@ def test_generate_client_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_generate_client_certificate_rest_unset_required_fields(): @@ -21228,7 +21200,7 @@ def test_get_connection_info_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_connection_info_rest_unset_required_fields(): @@ -21415,7 +21387,7 @@ def test_list_users_rest_required_fields(request_type=service.ListUsersRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_users_rest_unset_required_fields(): @@ -21666,7 +21638,7 @@ def test_get_user_rest_required_fields(request_type=service.GetUserRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_rest_unset_required_fields(): @@ -21866,7 +21838,7 @@ def test_create_user_rest_required_fields(request_type=service.CreateUserRequest ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_rest_unset_required_fields(): @@ -22068,7 +22040,7 @@ def test_update_user_rest_required_fields(request_type=service.UpdateUserRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_user_rest_unset_required_fields(): @@ -22264,7 +22236,7 @@ def test_delete_user_rest_required_fields(request_type=service.DeleteUserRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_rest_unset_required_fields(): @@ -22456,7 +22428,7 @@ def test_list_databases_rest_required_fields(request_type=service.ListDatabasesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_databases_rest_unset_required_fields(): diff --git a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_dbcsql_admin.py b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_dbcsql_admin.py index 029aa2390644..362253db109d 100644 --- a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_dbcsql_admin.py +++ b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1/test_alloy_dbcsql_admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1841,7 +1835,7 @@ def test_restore_from_cloud_sql_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_from_cloud_sql_rest_unset_required_fields(): diff --git a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_db_admin.py b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_db_admin.py index 3a9d18bf4c16..f76b8dcf853b 100644 --- a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_db_admin.py +++ b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_db_admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1831,11 +1825,7 @@ async def test_list_clusters_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_clusters(request={}) - ).pages: + async for page_ in (await client.list_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6158,11 +6148,7 @@ async def test_list_instances_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10091,11 +10077,7 @@ async def test_list_backups_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_backups(request={}) - ).pages: + async for page_ in (await client.list_backups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12028,9 +12010,7 @@ async def test_list_supported_database_flags_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_supported_database_flags(request={}) ).pages: pages.append(page_) @@ -13273,11 +13253,7 @@ async def test_list_users_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_users(request={}) - ).pages: + async for page_ in (await client.list_users(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15144,11 +15120,7 @@ async def test_list_databases_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_databases(request={}) - ).pages: + async for page_ in (await client.list_databases(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15634,7 +15606,7 @@ def test_list_clusters_rest_required_fields(request_type=service.ListClustersReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_clusters_rest_unset_required_fields(): @@ -15883,7 +15855,7 @@ def test_get_cluster_rest_required_fields(request_type=service.GetClusterRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_rest_unset_required_fields(): @@ -16082,7 +16054,7 @@ def test_create_cluster_rest_required_fields(request_type=service.CreateClusterR ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cluster_rest_unset_required_fields(): @@ -16285,7 +16257,7 @@ def test_update_cluster_rest_required_fields(request_type=service.UpdateClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_cluster_rest_unset_required_fields(): @@ -16483,7 +16455,7 @@ def test_export_cluster_rest_required_fields(request_type=service.ExportClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_cluster_rest_unset_required_fields(): @@ -16681,7 +16653,7 @@ def test_import_cluster_rest_required_fields(request_type=service.ImportClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_cluster_rest_unset_required_fields(): @@ -16873,7 +16845,7 @@ def test_upgrade_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_upgrade_cluster_rest_unset_required_fields(): @@ -17067,7 +17039,7 @@ def test_delete_cluster_rest_required_fields(request_type=service.DeleteClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cluster_rest_unset_required_fields(): @@ -17255,7 +17227,7 @@ def test_promote_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_promote_cluster_rest_unset_required_fields(): @@ -17437,7 +17409,7 @@ def test_switchover_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_switchover_cluster_rest_unset_required_fields(): @@ -17619,7 +17591,7 @@ def test_restore_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_cluster_rest_unset_required_fields(): @@ -17776,7 +17748,7 @@ def test_create_secondary_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_secondary_cluster_rest_unset_required_fields(): @@ -17982,7 +17954,7 @@ def test_list_instances_rest_required_fields(request_type=service.ListInstancesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -18235,7 +18207,7 @@ def test_get_instance_rest_required_fields(request_type=service.GetInstanceReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -18438,7 +18410,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -18663,7 +18635,7 @@ def test_create_secondary_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_secondary_instance_rest_unset_required_fields(): @@ -18869,7 +18841,7 @@ def test_batch_create_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_create_instances_rest_unset_required_fields(): @@ -19003,7 +18975,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -19204,7 +19176,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -19395,7 +19367,7 @@ def test_failover_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_failover_instance_rest_unset_required_fields(): @@ -19573,7 +19545,7 @@ def test_inject_fault_rest_required_fields(request_type=service.InjectFaultReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_inject_fault_rest_unset_required_fields(): @@ -19765,7 +19737,7 @@ def test_restart_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restart_instance_rest_unset_required_fields(): @@ -19954,7 +19926,7 @@ def test_execute_sql_rest_required_fields(request_type=service.ExecuteSqlRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_execute_sql_rest_unset_required_fields(): @@ -20158,7 +20130,7 @@ def test_list_backups_rest_required_fields(request_type=service.ListBackupsReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backups_rest_unset_required_fields(): @@ -20405,7 +20377,7 @@ def test_get_backup_rest_required_fields(request_type=service.GetBackupRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_rest_unset_required_fields(): @@ -20604,7 +20576,7 @@ def test_create_backup_rest_required_fields(request_type=service.CreateBackupReq ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_backup_rest_unset_required_fields(): @@ -20803,7 +20775,7 @@ def test_update_backup_rest_required_fields(request_type=service.UpdateBackupReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_backup_rest_unset_required_fields(): @@ -21000,7 +20972,7 @@ def test_delete_backup_rest_required_fields(request_type=service.DeleteBackupReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_backup_rest_unset_required_fields(): @@ -21198,7 +21170,7 @@ def test_list_supported_database_flags_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_supported_database_flags_rest_unset_required_fields(): @@ -21456,7 +21428,7 @@ def test_generate_client_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_generate_client_certificate_rest_unset_required_fields(): @@ -21642,7 +21614,7 @@ def test_get_connection_info_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_connection_info_rest_unset_required_fields(): @@ -21829,7 +21801,7 @@ def test_list_users_rest_required_fields(request_type=service.ListUsersRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_users_rest_unset_required_fields(): @@ -22080,7 +22052,7 @@ def test_get_user_rest_required_fields(request_type=service.GetUserRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_rest_unset_required_fields(): @@ -22280,7 +22252,7 @@ def test_create_user_rest_required_fields(request_type=service.CreateUserRequest ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_rest_unset_required_fields(): @@ -22482,7 +22454,7 @@ def test_update_user_rest_required_fields(request_type=service.UpdateUserRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_user_rest_unset_required_fields(): @@ -22678,7 +22650,7 @@ def test_delete_user_rest_required_fields(request_type=service.DeleteUserRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_rest_unset_required_fields(): @@ -22870,7 +22842,7 @@ def test_list_databases_rest_required_fields(request_type=service.ListDatabasesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_databases_rest_unset_required_fields(): @@ -23138,7 +23110,7 @@ def test_create_database_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_database_rest_unset_required_fields(): diff --git a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_dbcsql_admin.py b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_dbcsql_admin.py index 0d200194cc29..e01821526c62 100644 --- a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_dbcsql_admin.py +++ b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1alpha/test_alloy_dbcsql_admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1842,7 +1836,7 @@ def test_restore_from_cloud_sql_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_from_cloud_sql_rest_unset_required_fields(): diff --git a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_db_admin.py b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_db_admin.py index 83e7c5c75251..cc69a02e5004 100644 --- a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_db_admin.py +++ b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_db_admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1831,11 +1825,7 @@ async def test_list_clusters_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_clusters(request={}) - ).pages: + async for page_ in (await client.list_clusters(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6154,11 +6144,7 @@ async def test_list_instances_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10083,11 +10069,7 @@ async def test_list_backups_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_backups(request={}) - ).pages: + async for page_ in (await client.list_backups(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12016,9 +11998,7 @@ async def test_list_supported_database_flags_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_supported_database_flags(request={}) ).pages: pages.append(page_) @@ -13261,11 +13241,7 @@ async def test_list_users_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_users(request={}) - ).pages: + async for page_ in (await client.list_users(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15132,11 +15108,7 @@ async def test_list_databases_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_databases(request={}) - ).pages: + async for page_ in (await client.list_databases(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15622,7 +15594,7 @@ def test_list_clusters_rest_required_fields(request_type=service.ListClustersReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_clusters_rest_unset_required_fields(): @@ -15871,7 +15843,7 @@ def test_get_cluster_rest_required_fields(request_type=service.GetClusterRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_cluster_rest_unset_required_fields(): @@ -16070,7 +16042,7 @@ def test_create_cluster_rest_required_fields(request_type=service.CreateClusterR ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_cluster_rest_unset_required_fields(): @@ -16273,7 +16245,7 @@ def test_update_cluster_rest_required_fields(request_type=service.UpdateClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_cluster_rest_unset_required_fields(): @@ -16471,7 +16443,7 @@ def test_export_cluster_rest_required_fields(request_type=service.ExportClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_cluster_rest_unset_required_fields(): @@ -16669,7 +16641,7 @@ def test_import_cluster_rest_required_fields(request_type=service.ImportClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_cluster_rest_unset_required_fields(): @@ -16861,7 +16833,7 @@ def test_upgrade_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_upgrade_cluster_rest_unset_required_fields(): @@ -17055,7 +17027,7 @@ def test_delete_cluster_rest_required_fields(request_type=service.DeleteClusterR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_cluster_rest_unset_required_fields(): @@ -17243,7 +17215,7 @@ def test_promote_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_promote_cluster_rest_unset_required_fields(): @@ -17425,7 +17397,7 @@ def test_switchover_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_switchover_cluster_rest_unset_required_fields(): @@ -17607,7 +17579,7 @@ def test_restore_cluster_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_cluster_rest_unset_required_fields(): @@ -17764,7 +17736,7 @@ def test_create_secondary_cluster_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_secondary_cluster_rest_unset_required_fields(): @@ -17970,7 +17942,7 @@ def test_list_instances_rest_required_fields(request_type=service.ListInstancesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_instances_rest_unset_required_fields(): @@ -18223,7 +18195,7 @@ def test_get_instance_rest_required_fields(request_type=service.GetInstanceReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): @@ -18426,7 +18398,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -18651,7 +18623,7 @@ def test_create_secondary_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_secondary_instance_rest_unset_required_fields(): @@ -18857,7 +18829,7 @@ def test_batch_create_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_create_instances_rest_unset_required_fields(): @@ -18991,7 +18963,7 @@ def test_update_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_instance_rest_unset_required_fields(): @@ -19192,7 +19164,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -19383,7 +19355,7 @@ def test_failover_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_failover_instance_rest_unset_required_fields(): @@ -19561,7 +19533,7 @@ def test_inject_fault_rest_required_fields(request_type=service.InjectFaultReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_inject_fault_rest_unset_required_fields(): @@ -19753,7 +19725,7 @@ def test_restart_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restart_instance_rest_unset_required_fields(): @@ -19942,7 +19914,7 @@ def test_execute_sql_rest_required_fields(request_type=service.ExecuteSqlRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_execute_sql_rest_unset_required_fields(): @@ -20146,7 +20118,7 @@ def test_list_backups_rest_required_fields(request_type=service.ListBackupsReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_backups_rest_unset_required_fields(): @@ -20393,7 +20365,7 @@ def test_get_backup_rest_required_fields(request_type=service.GetBackupRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_backup_rest_unset_required_fields(): @@ -20592,7 +20564,7 @@ def test_create_backup_rest_required_fields(request_type=service.CreateBackupReq ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_backup_rest_unset_required_fields(): @@ -20791,7 +20763,7 @@ def test_update_backup_rest_required_fields(request_type=service.UpdateBackupReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_backup_rest_unset_required_fields(): @@ -20988,7 +20960,7 @@ def test_delete_backup_rest_required_fields(request_type=service.DeleteBackupReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_backup_rest_unset_required_fields(): @@ -21186,7 +21158,7 @@ def test_list_supported_database_flags_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_supported_database_flags_rest_unset_required_fields(): @@ -21444,7 +21416,7 @@ def test_generate_client_certificate_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_generate_client_certificate_rest_unset_required_fields(): @@ -21630,7 +21602,7 @@ def test_get_connection_info_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_connection_info_rest_unset_required_fields(): @@ -21817,7 +21789,7 @@ def test_list_users_rest_required_fields(request_type=service.ListUsersRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_users_rest_unset_required_fields(): @@ -22068,7 +22040,7 @@ def test_get_user_rest_required_fields(request_type=service.GetUserRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_user_rest_unset_required_fields(): @@ -22268,7 +22240,7 @@ def test_create_user_rest_required_fields(request_type=service.CreateUserRequest ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_user_rest_unset_required_fields(): @@ -22470,7 +22442,7 @@ def test_update_user_rest_required_fields(request_type=service.UpdateUserRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_user_rest_unset_required_fields(): @@ -22666,7 +22638,7 @@ def test_delete_user_rest_required_fields(request_type=service.DeleteUserRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_user_rest_unset_required_fields(): @@ -22858,7 +22830,7 @@ def test_list_databases_rest_required_fields(request_type=service.ListDatabasesR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_databases_rest_unset_required_fields(): @@ -23126,7 +23098,7 @@ def test_create_database_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_database_rest_unset_required_fields(): diff --git a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_dbcsql_admin.py b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_dbcsql_admin.py index adbf2cc62c34..d7bad496876e 100644 --- a/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_dbcsql_admin.py +++ b/packages/google-cloud-alloydb/tests/unit/gapic/alloydb_v1beta/test_alloy_dbcsql_admin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1842,7 +1836,7 @@ def test_restore_from_cloud_sql_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restore_from_cloud_sql_rest_unset_required_fields(): diff --git a/packages/google-cloud-api-gateway/docs/conf.py b/packages/google-cloud-api-gateway/docs/conf.py index ebe8e5a76ad0..b4b78825d4ea 100644 --- a/packages/google-cloud-api-gateway/docs/conf.py +++ b/packages/google-cloud-api-gateway/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-api-gateway" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/__init__.py b/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/__init__.py index acfe1c26ab5c..a7a79f57bb81 100644 --- a/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/__init__.py +++ b/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.api_gateway_service import ( ApiGatewayServiceAsyncClient, @@ -67,28 +61,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.apigateway_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py b/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py index da534126f432..fe1d5cf4df46 100644 --- a/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py +++ b/packages/google-cloud-api-gateway/google/cloud/apigateway_v1/services/api_gateway_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -600,11 +600,11 @@ async def sample_create_gateway(): ) # Make the request - operation = client.create_gateway(request=request) + operation = await client.create_gateway(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -748,11 +748,11 @@ async def sample_update_gateway(): ) # Make the request - operation = client.update_gateway(request=request) + operation = await client.update_gateway(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -888,11 +888,11 @@ async def sample_delete_gateway(): ) # Make the request - operation = client.delete_gateway(request=request) + operation = await client.delete_gateway(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1259,11 +1259,11 @@ async def sample_create_api(): ) # Make the request - operation = client.create_api(request=request) + operation = await client.create_api(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1402,11 +1402,11 @@ async def sample_update_api(): ) # Make the request - operation = client.update_api(request=request) + operation = await client.update_api(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1539,11 +1539,11 @@ async def sample_delete_api(): ) # Make the request - operation = client.delete_api(request=request) + operation = await client.delete_api(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1914,11 +1914,11 @@ async def sample_create_api_config(): ) # Make the request - operation = client.create_api_config(request=request) + operation = await client.create_api_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2056,11 +2056,11 @@ async def sample_update_api_config(): ) # Make the request - operation = client.update_api_config(request=request) + operation = await client.update_api_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2194,11 +2194,11 @@ async def sample_delete_api_config(): ) # Make the request - operation = client.delete_api_config(request=request) + operation = await client.delete_api_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/noxfile.py b/packages/google-cloud-api-gateway/noxfile.py index 35017f69a253..28f2056dcbac 100644 --- a/packages/google-cloud-api-gateway/noxfile.py +++ b/packages/google-cloud-api-gateway/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_async.py index cdde28ce32a8..4fb75c8cfe69 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_create_api(): ) # Make the request - operation = client.create_api(request=request) + operation = await client.create_api(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_config_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_config_async.py index c4dfbd0fa07c..8a1af0ab6110 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_config_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_api_config_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_create_api_config(): ) # Make the request - operation = client.create_api_config(request=request) + operation = await client.create_api_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_gateway_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_gateway_async.py index 2f1f2e8fe1a4..47378ac0a77d 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_gateway_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_create_gateway_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_gateway(): ) # Make the request - operation = client.create_gateway(request=request) + operation = await client.create_gateway(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_async.py index db4e4dbe0435..03c84e0a8446 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_api(): ) # Make the request - operation = client.delete_api(request=request) + operation = await client.delete_api(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_config_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_config_async.py index 21cd24367de8..08e61d6a5e99 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_config_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_api_config_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_api_config(): ) # Make the request - operation = client.delete_api_config(request=request) + operation = await client.delete_api_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_gateway_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_gateway_async.py index 5ef6e23700fc..0cfe5b6eb3a5 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_gateway_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_delete_gateway_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_gateway(): ) # Make the request - operation = client.delete_gateway(request=request) + operation = await client.delete_gateway(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_async.py index 3efd127c9d4f..b6003297a2b3 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_api(): request = apigateway_v1.UpdateApiRequest() # Make the request - operation = client.update_api(request=request) + operation = await client.update_api(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_config_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_config_async.py index af291cc12ada..1acaa31b2d17 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_config_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_api_config_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_api_config(): request = apigateway_v1.UpdateApiConfigRequest() # Make the request - operation = client.update_api_config(request=request) + operation = await client.update_api_config(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_gateway_async.py b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_gateway_async.py index 9858d61412a3..56595d9513ce 100644 --- a/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_gateway_async.py +++ b/packages/google-cloud-api-gateway/samples/generated_samples/apigateway_v1_generated_api_gateway_service_update_gateway_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_gateway(): ) # Make the request - operation = client.update_gateway(request=request) + operation = await client.update_gateway(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-gateway/setup.py b/packages/google-cloud-api-gateway/setup.py index c418d05d4bae..a806ea5a50b2 100644 --- a/packages/google-cloud-api-gateway/setup.py +++ b/packages/google-cloud-api-gateway/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -79,7 +79,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -90,7 +89,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-api-gateway/testing/constraints-3.10.txt b/packages/google-cloud-api-gateway/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-api-gateway/testing/constraints-3.10.txt +++ b/packages/google-cloud-api-gateway/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-api-gateway/testing/constraints-3.9.txt b/packages/google-cloud-api-gateway/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-api-gateway/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-api-gateway/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py b/packages/google-cloud-api-gateway/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py index 6ca44c7c73a3..8c303a703e35 100644 --- a/packages/google-cloud-api-gateway/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py +++ b/packages/google-cloud-api-gateway/tests/unit/gapic/apigateway_v1/test_api_gateway_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1876,11 +1870,7 @@ async def test_list_gateways_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_gateways(request={}) - ).pages: + async for page_ in (await client.list_gateways(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3745,11 +3735,7 @@ async def test_list_apis_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_apis(request={}) - ).pages: + async for page_ in (await client.list_apis(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5606,11 +5592,7 @@ async def test_list_api_configs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_api_configs(request={}) - ).pages: + async for page_ in (await client.list_api_configs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7129,7 +7111,7 @@ def test_list_gateways_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_gateways_rest_unset_required_fields(): @@ -7375,7 +7357,7 @@ def test_get_gateway_rest_required_fields(request_type=apigateway.GetGatewayRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_gateway_rest_unset_required_fields(): @@ -7569,7 +7551,7 @@ def test_create_gateway_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_gateway_rest_unset_required_fields(): @@ -7756,7 +7738,7 @@ def test_update_gateway_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_gateway_rest_unset_required_fields(): @@ -7937,7 +7919,7 @@ def test_delete_gateway_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_gateway_rest_unset_required_fields(): @@ -8119,7 +8101,7 @@ def test_list_apis_rest_required_fields(request_type=apigateway.ListApisRequest) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_apis_rest_unset_required_fields(): @@ -8365,7 +8347,7 @@ def test_get_api_rest_required_fields(request_type=apigateway.GetApiRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_rest_unset_required_fields(): @@ -8557,7 +8539,7 @@ def test_create_api_rest_required_fields(request_type=apigateway.CreateApiReques ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_rest_unset_required_fields(): @@ -8742,7 +8724,7 @@ def test_update_api_rest_required_fields(request_type=apigateway.UpdateApiReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_rest_unset_required_fields(): @@ -8920,7 +8902,7 @@ def test_delete_api_rest_required_fields(request_type=apigateway.DeleteApiReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_rest_unset_required_fields(): @@ -9106,7 +9088,7 @@ def test_list_api_configs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_configs_rest_unset_required_fields(): @@ -9357,7 +9339,7 @@ def test_get_api_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_config_rest_unset_required_fields(): @@ -9556,7 +9538,7 @@ def test_create_api_config_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_config_rest_unset_required_fields(): @@ -9746,7 +9728,7 @@ def test_update_api_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_config_rest_unset_required_fields(): @@ -9931,7 +9913,7 @@ def test_delete_api_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_config_rest_unset_required_fields(): diff --git a/packages/google-cloud-api-keys/docs/conf.py b/packages/google-cloud-api-keys/docs/conf.py index 0411ee0fdb13..f7130504a5ea 100644 --- a/packages/google-cloud-api-keys/docs/conf.py +++ b/packages/google-cloud-api-keys/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-api-keys" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-api-keys/google/cloud/api_keys_v2/__init__.py b/packages/google-cloud-api-keys/google/cloud/api_keys_v2/__init__.py index 25510b1ffc99..13b0a41f7116 100644 --- a/packages/google-cloud-api-keys/google/cloud/api_keys_v2/__init__.py +++ b/packages/google-cloud-api-keys/google/cloud/api_keys_v2/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.api_keys import ApiKeysAsyncClient, ApiKeysClient from .types.apikeys import ( @@ -63,28 +57,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.api_keys_v2" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-api-keys/google/cloud/api_keys_v2/services/api_keys/async_client.py b/packages/google-cloud-api-keys/google/cloud/api_keys_v2/services/api_keys/async_client.py index 5a0f37c02af5..22ddcbe94826 100644 --- a/packages/google-cloud-api-keys/google/cloud/api_keys_v2/services/api_keys/async_client.py +++ b/packages/google-cloud-api-keys/google/cloud/api_keys_v2/services/api_keys/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -329,11 +329,11 @@ async def sample_create_key(): ) # Make the request - operation = client.create_key(request=request) + operation = await client.create_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -836,11 +836,11 @@ async def sample_update_key(): ) # Make the request - operation = client.update_key(request=request) + operation = await client.update_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -982,11 +982,11 @@ async def sample_delete_key(): ) # Make the request - operation = client.delete_key(request=request) + operation = await client.delete_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1109,11 +1109,11 @@ async def sample_undelete_key(): ) # Make the request - operation = client.undelete_key(request=request) + operation = await client.undelete_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-keys/noxfile.py b/packages/google-cloud-api-keys/noxfile.py index da7909f1bdc0..bd2951e3995c 100644 --- a/packages/google-cloud-api-keys/noxfile.py +++ b/packages/google-cloud-api-keys/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_create_key_async.py b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_create_key_async.py index 6289202dbed3..aa5b82ecf8fd 100644 --- a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_create_key_async.py +++ b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_create_key_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_key(): ) # Make the request - operation = client.create_key(request=request) + operation = await client.create_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_delete_key_async.py b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_delete_key_async.py index 3df4927c2abf..9b510783fb67 100644 --- a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_delete_key_async.py +++ b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_delete_key_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_key(): ) # Make the request - operation = client.delete_key(request=request) + operation = await client.delete_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_undelete_key_async.py b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_undelete_key_async.py index f6b01605d6d2..d36e385b4d78 100644 --- a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_undelete_key_async.py +++ b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_undelete_key_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undelete_key(): ) # Make the request - operation = client.undelete_key(request=request) + operation = await client.undelete_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_update_key_async.py b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_update_key_async.py index b1f569077feb..5e4991a0fb71 100644 --- a/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_update_key_async.py +++ b/packages/google-cloud-api-keys/samples/generated_samples/apikeys_v2_generated_api_keys_update_key_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_key(): request = api_keys_v2.UpdateKeyRequest() # Make the request - operation = client.update_key(request=request) + operation = await client.update_key(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-api-keys/setup.py b/packages/google-cloud-api-keys/setup.py index 58e1258261f1..afeeae5fd23c 100644 --- a/packages/google-cloud-api-keys/setup.py +++ b/packages/google-cloud-api-keys/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -79,7 +79,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -90,7 +89,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-api-keys/testing/constraints-3.10.txt b/packages/google-cloud-api-keys/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-api-keys/testing/constraints-3.10.txt +++ b/packages/google-cloud-api-keys/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-api-keys/testing/constraints-3.9.txt b/packages/google-cloud-api-keys/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-api-keys/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-api-keys/tests/unit/gapic/api_keys_v2/test_api_keys.py b/packages/google-cloud-api-keys/tests/unit/gapic/api_keys_v2/test_api_keys.py index f0ab3dbed3c1..17ee4cdb9144 100644 --- a/packages/google-cloud-api-keys/tests/unit/gapic/api_keys_v2/test_api_keys.py +++ b/packages/google-cloud-api-keys/tests/unit/gapic/api_keys_v2/test_api_keys.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2110,11 +2104,7 @@ async def test_list_keys_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_keys(request={}) - ).pages: + async for page_ in (await client.list_keys(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3971,7 +3961,7 @@ def test_create_key_rest_required_fields(request_type=apikeys.CreateKeyRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_key_rest_unset_required_fields(): @@ -4164,7 +4154,7 @@ def test_list_keys_rest_required_fields(request_type=apikeys.ListKeysRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_keys_rest_unset_required_fields(): @@ -4409,7 +4399,7 @@ def test_get_key_rest_required_fields(request_type=apikeys.GetKeyRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_key_rest_unset_required_fields(): @@ -4584,7 +4574,7 @@ def test_get_key_string_rest_required_fields(request_type=apikeys.GetKeyStringRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_key_string_rest_unset_required_fields(): @@ -4759,7 +4749,7 @@ def test_update_key_rest_required_fields(request_type=apikeys.UpdateKeyRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_key_rest_unset_required_fields(): @@ -4939,7 +4929,7 @@ def test_delete_key_rest_required_fields(request_type=apikeys.DeleteKeyRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_key_rest_unset_required_fields(): @@ -5114,7 +5104,7 @@ def test_undelete_key_rest_required_fields(request_type=apikeys.UndeleteKeyReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undelete_key_rest_unset_required_fields(): @@ -5243,7 +5233,7 @@ def test_lookup_key_rest_required_fields(request_type=apikeys.LookupKeyRequest): ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lookup_key_rest_unset_required_fields(): diff --git a/packages/google-cloud-apigee-connect/docs/conf.py b/packages/google-cloud-apigee-connect/docs/conf.py index 2a1e63fcb997..344bb7fe20f7 100644 --- a/packages/google-cloud-apigee-connect/docs/conf.py +++ b/packages/google-cloud-apigee-connect/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-apigee-connect" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/__init__.py b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/__init__.py index 215bbef488d0..7dd770701659 100644 --- a/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/__init__.py +++ b/packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.connection_service import ( ConnectionServiceAsyncClient, @@ -63,28 +57,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.apigeeconnect_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-apigee-connect/noxfile.py b/packages/google-cloud-apigee-connect/noxfile.py index 6291c10fd893..4f25b6dff63a 100644 --- a/packages/google-cloud-apigee-connect/noxfile.py +++ b/packages/google-cloud-apigee-connect/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-apigee-connect/setup.py b/packages/google-cloud-apigee-connect/setup.py index 0282031ba647..5d15add159a0 100644 --- a/packages/google-cloud-apigee-connect/setup.py +++ b/packages/google-cloud-apigee-connect/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-apigee-connect/testing/constraints-3.10.txt b/packages/google-cloud-apigee-connect/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-apigee-connect/testing/constraints-3.10.txt +++ b/packages/google-cloud-apigee-connect/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-apigee-connect/testing/constraints-3.9.txt b/packages/google-cloud-apigee-connect/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-apigee-connect/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_connection_service.py b/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_connection_service.py index 928ecdc9cc79..f8b9d4bc5594 100644 --- a/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_connection_service.py +++ b/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_connection_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1827,11 +1821,7 @@ async def test_list_connections_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_connections(request={}) - ).pages: + async for page_ in (await client.list_connections(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_tether.py b/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_tether.py index 65d5e65c6f4d..5ce84fdd3ec9 100644 --- a/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_tether.py +++ b/packages/google-cloud-apigee-connect/tests/unit/gapic/apigeeconnect_v1/test_tether.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest diff --git a/packages/google-cloud-apigee-registry/docs/conf.py b/packages/google-cloud-apigee-registry/docs/conf.py index fbef1432f62b..4051a08c748a 100644 --- a/packages/google-cloud-apigee-registry/docs/conf.py +++ b/packages/google-cloud-apigee-registry/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-apigee-registry" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/__init__.py b/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/__init__.py index 8ee0c62fa77e..6ccbe4508678 100644 --- a/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/__init__.py +++ b/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.provisioning import ProvisioningAsyncClient, ProvisioningClient from .services.registry import RegistryAsyncClient, RegistryClient @@ -93,28 +87,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.apigee_registry_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/services/provisioning/async_client.py b/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/services/provisioning/async_client.py index 00ea125d1295..26962a8194ff 100644 --- a/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/services/provisioning/async_client.py +++ b/packages/google-cloud-apigee-registry/google/cloud/apigee_registry_v1/services/provisioning/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -342,11 +342,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -486,11 +486,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apigee-registry/noxfile.py b/packages/google-cloud-apigee-registry/noxfile.py index e63701651122..6491e49c3655 100644 --- a/packages/google-cloud-apigee-registry/noxfile.py +++ b/packages/google-cloud-apigee-registry/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_create_instance_async.py b/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_create_instance_async.py index 4f55ae4c9d16..08574faf085d 100644 --- a/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_create_instance_async.py +++ b/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_create_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_instance(): ) # Make the request - operation = client.create_instance(request=request) + operation = await client.create_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_delete_instance_async.py b/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_delete_instance_async.py index 15aa1ae8ab7b..9890d6151aae 100644 --- a/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_delete_instance_async.py +++ b/packages/google-cloud-apigee-registry/samples/generated_samples/apigeeregistry_v1_generated_provisioning_delete_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apigee-registry/setup.py b/packages/google-cloud-apigee-registry/setup.py index a90c4653c159..3a05eba3b9ad 100644 --- a/packages/google-cloud-apigee-registry/setup.py +++ b/packages/google-cloud-apigee-registry/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +74,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -82,7 +82,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -93,7 +92,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-apigee-registry/testing/constraints-3.10.txt b/packages/google-cloud-apigee-registry/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-apigee-registry/testing/constraints-3.10.txt +++ b/packages/google-cloud-apigee-registry/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 +grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-apigee-registry/testing/constraints-3.9.txt b/packages/google-cloud-apigee-registry/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-apigee-registry/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_provisioning.py b/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_provisioning.py index b4f2e301af79..7c2e1eaa08b3 100644 --- a/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_provisioning.py +++ b/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_provisioning.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2437,7 +2431,7 @@ def test_create_instance_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_instance_rest_unset_required_fields(): @@ -2626,7 +2620,7 @@ def test_delete_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_instance_rest_unset_required_fields(): @@ -2803,7 +2797,7 @@ def test_get_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_instance_rest_unset_required_fields(): diff --git a/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py b/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py index c4d086002489..f477ed7a2d1b 100644 --- a/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py +++ b/packages/google-cloud-apigee-registry/tests/unit/gapic/apigee_registry_v1/test_registry.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1774,11 +1768,7 @@ async def test_list_apis_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_apis(request={}) - ).pages: + async for page_ in (await client.list_apis(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3668,11 +3658,7 @@ async def test_list_api_versions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_api_versions(request={}) - ).pages: + async for page_ in (await client.list_api_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5590,11 +5576,7 @@ async def test_list_api_specs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_api_specs(request={}) - ).pages: + async for page_ in (await client.list_api_specs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8093,11 +8075,7 @@ async def test_list_api_spec_revisions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_api_spec_revisions(request={}) - ).pages: + async for page_ in (await client.list_api_spec_revisions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9304,11 +9282,7 @@ async def test_list_api_deployments_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_api_deployments(request={}) - ).pages: + async for page_ in (await client.list_api_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11541,9 +11515,7 @@ async def test_list_api_deployment_revisions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_api_deployment_revisions(request={}) ).pages: pages.append(page_) @@ -12728,11 +12700,7 @@ async def test_list_artifacts_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_artifacts(request={}) - ).pages: + async for page_ in (await client.list_artifacts(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -14548,7 +14516,7 @@ def test_list_apis_rest_required_fields(request_type=registry_service.ListApisRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_apis_rest_unset_required_fields(): @@ -14793,7 +14761,7 @@ def test_get_api_rest_required_fields(request_type=registry_service.GetApiReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_rest_unset_required_fields(): @@ -14986,7 +14954,7 @@ def test_create_api_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_rest_unset_required_fields(): @@ -15179,7 +15147,7 @@ def test_update_api_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_rest_unset_required_fields(): @@ -15367,7 +15335,7 @@ def test_delete_api_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_rest_unset_required_fields(): @@ -15552,7 +15520,7 @@ def test_list_api_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_versions_rest_unset_required_fields(): @@ -15802,7 +15770,7 @@ def test_get_api_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_version_rest_unset_required_fields(): @@ -16002,7 +15970,7 @@ def test_create_api_version_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_version_rest_unset_required_fields(): @@ -16200,7 +16168,7 @@ def test_update_api_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_version_rest_unset_required_fields(): @@ -16395,7 +16363,7 @@ def test_delete_api_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_version_rest_unset_required_fields(): @@ -16581,7 +16549,7 @@ def test_list_api_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_specs_rest_unset_required_fields(): @@ -16835,7 +16803,7 @@ def test_get_api_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_spec_rest_unset_required_fields(): @@ -17018,7 +16986,7 @@ def test_get_api_spec_contents_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_spec_contents_rest_unset_required_fields(): @@ -17212,7 +17180,7 @@ def test_create_api_spec_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_spec_rest_unset_required_fields(): @@ -17408,7 +17376,7 @@ def test_update_api_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_spec_rest_unset_required_fields(): @@ -17599,7 +17567,7 @@ def test_delete_api_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_spec_rest_unset_required_fields(): @@ -17787,7 +17755,7 @@ def test_tag_api_spec_revision_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_tag_api_spec_revision_rest_unset_required_fields(): @@ -17929,7 +17897,7 @@ def test_list_api_spec_revisions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_spec_revisions_rest_unset_required_fields(): @@ -18129,7 +18097,7 @@ def test_rollback_api_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_rollback_api_spec_rest_unset_required_fields(): @@ -18262,7 +18230,7 @@ def test_delete_api_spec_revision_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_spec_revision_rest_unset_required_fields(): @@ -18454,7 +18422,7 @@ def test_list_api_deployments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_deployments_rest_unset_required_fields(): @@ -18708,7 +18676,7 @@ def test_get_api_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_deployment_rest_unset_required_fields(): @@ -18909,7 +18877,7 @@ def test_create_api_deployment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_deployment_rest_unset_required_fields(): @@ -19108,7 +19076,7 @@ def test_update_api_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_deployment_rest_unset_required_fields(): @@ -19304,7 +19272,7 @@ def test_delete_api_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_deployment_rest_unset_required_fields(): @@ -19492,7 +19460,7 @@ def test_tag_api_deployment_revision_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_tag_api_deployment_revision_rest_unset_required_fields(): @@ -19634,7 +19602,7 @@ def test_list_api_deployment_revisions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_deployment_revisions_rest_unset_required_fields(): @@ -19840,7 +19808,7 @@ def test_rollback_api_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_rollback_api_deployment_rest_unset_required_fields(): @@ -19973,7 +19941,7 @@ def test_delete_api_deployment_revision_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_deployment_revision_rest_unset_required_fields(): @@ -20163,7 +20131,7 @@ def test_list_artifacts_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_artifacts_rest_unset_required_fields(): @@ -20412,7 +20380,7 @@ def test_get_artifact_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_artifact_rest_unset_required_fields(): @@ -20594,7 +20562,7 @@ def test_get_artifact_contents_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_artifact_contents_rest_unset_required_fields(): @@ -20788,7 +20756,7 @@ def test_create_artifact_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_artifact_rest_unset_required_fields(): @@ -20976,7 +20944,7 @@ def test_replace_artifact_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_replace_artifact_rest_unset_required_fields(): @@ -21153,7 +21121,7 @@ def test_delete_artifact_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_artifact_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/docs/conf.py b/packages/google-cloud-apihub/docs/conf.py index 0378bad2e67c..d86ee6dbe7d1 100644 --- a/packages/google-cloud-apihub/docs/conf.py +++ b/packages/google-cloud-apihub/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-apihub" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-apihub/google/cloud/apihub_v1/__init__.py b/packages/google-cloud-apihub/google/cloud/apihub_v1/__init__.py index b7454ea3d969..46f8f03fa5c0 100644 --- a/packages/google-cloud-apihub/google/cloud/apihub_v1/__init__.py +++ b/packages/google-cloud-apihub/google/cloud/apihub_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.api_hub import ApiHubAsyncClient, ApiHubClient from .services.api_hub_collect import ApiHubCollectAsyncClient, ApiHubCollectClient @@ -254,28 +248,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.apihub_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_collect/async_client.py b/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_collect/async_client.py index 01052211a88c..48a270f95116 100644 --- a/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_collect/async_client.py +++ b/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_collect/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -360,11 +360,11 @@ async def sample_collect_api_data(): ) # Make the request - operation = client.collect_api_data(request=request) + operation = await client.collect_api_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_plugin/async_client.py b/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_plugin/async_client.py index 8a3d5849f649..9db85093c316 100644 --- a/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_plugin/async_client.py +++ b/packages/google-cloud-apihub/google/cloud/apihub_v1/services/api_hub_plugin/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -948,11 +948,11 @@ async def sample_delete_plugin(): ) # Make the request - operation = client.delete_plugin(request=request) + operation = await client.delete_plugin(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1091,11 +1091,11 @@ async def sample_create_plugin_instance(): ) # Make the request - operation = client.create_plugin_instance(request=request) + operation = await client.create_plugin_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1254,11 +1254,11 @@ async def sample_execute_plugin_instance_action(): ) # Make the request - operation = client.execute_plugin_instance_action(request=request) + operation = await client.execute_plugin_instance_action(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1645,11 +1645,11 @@ async def sample_enable_plugin_instance_action(): ) # Make the request - operation = client.enable_plugin_instance_action(request=request) + operation = await client.enable_plugin_instance_action(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1784,11 +1784,11 @@ async def sample_disable_plugin_instance_action(): ) # Make the request - operation = client.disable_plugin_instance_action(request=request) + operation = await client.disable_plugin_instance_action(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2071,11 +2071,11 @@ async def sample_delete_plugin_instance(): ) # Make the request - operation = client.delete_plugin_instance(request=request) + operation = await client.delete_plugin_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/google/cloud/apihub_v1/services/provisioning/async_client.py b/packages/google-cloud-apihub/google/cloud/apihub_v1/services/provisioning/async_client.py index 996fefb00194..cb0706036733 100644 --- a/packages/google-cloud-apihub/google/cloud/apihub_v1/services/provisioning/async_client.py +++ b/packages/google-cloud-apihub/google/cloud/apihub_v1/services/provisioning/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -335,11 +335,11 @@ async def sample_create_api_hub_instance(): ) # Make the request - operation = client.create_api_hub_instance(request=request) + operation = await client.create_api_hub_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -486,11 +486,11 @@ async def sample_delete_api_hub_instance(): ) # Make the request - operation = client.delete_api_hub_instance(request=request) + operation = await client.delete_api_hub_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/noxfile.py b/packages/google-cloud-apihub/noxfile.py index 40a8f714ca3f..6d8a6f5f2ba3 100644 --- a/packages/google-cloud-apihub/noxfile.py +++ b/packages/google-cloud-apihub/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_collect_collect_api_data_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_collect_collect_api_data_async.py index 2bc2fb81ffd5..235b86cbac27 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_collect_collect_api_data_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_collect_collect_api_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,11 +51,11 @@ async def sample_collect_api_data(): ) # Make the request - operation = client.collect_api_data(request=request) + operation = await client.collect_api_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_create_plugin_instance_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_create_plugin_instance_async.py index 345196bae5d1..994e5b654a21 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_create_plugin_instance_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_create_plugin_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_plugin_instance(): ) # Make the request - operation = client.create_plugin_instance(request=request) + operation = await client.create_plugin_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_async.py index f41df8a89cc9..3e523b68af2a 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_plugin(): ) # Make the request - operation = client.delete_plugin(request=request) + operation = await client.delete_plugin(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_instance_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_instance_async.py index e725552d80c6..041b72f8d902 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_instance_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_delete_plugin_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_plugin_instance(): ) # Make the request - operation = client.delete_plugin_instance(request=request) + operation = await client.delete_plugin_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_disable_plugin_instance_action_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_disable_plugin_instance_action_async.py index 487e80813a33..b2a2428af72c 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_disable_plugin_instance_action_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_disable_plugin_instance_action_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_disable_plugin_instance_action(): ) # Make the request - operation = client.disable_plugin_instance_action(request=request) + operation = await client.disable_plugin_instance_action(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_enable_plugin_instance_action_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_enable_plugin_instance_action_async.py index 5c44bd233c76..6b51019331f4 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_enable_plugin_instance_action_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_enable_plugin_instance_action_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_enable_plugin_instance_action(): ) # Make the request - operation = client.enable_plugin_instance_action(request=request) + operation = await client.enable_plugin_instance_action(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_execute_plugin_instance_action_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_execute_plugin_instance_action_async.py index b11ba30f2e61..94ccd34d3225 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_execute_plugin_instance_action_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_api_hub_plugin_execute_plugin_instance_action_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_execute_plugin_instance_action(): ) # Make the request - operation = client.execute_plugin_instance_action(request=request) + operation = await client.execute_plugin_instance_action(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_create_api_hub_instance_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_create_api_hub_instance_async.py index ee6bfcfb7cd3..3613d1407957 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_create_api_hub_instance_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_create_api_hub_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_api_hub_instance(): ) # Make the request - operation = client.create_api_hub_instance(request=request) + operation = await client.create_api_hub_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_delete_api_hub_instance_async.py b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_delete_api_hub_instance_async.py index faa662c15918..01d5021d7e71 100644 --- a/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_delete_api_hub_instance_async.py +++ b/packages/google-cloud-apihub/samples/generated_samples/apihub_v1_generated_provisioning_delete_api_hub_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_api_hub_instance(): ) # Make the request - operation = client.delete_api_hub_instance(request=request) + operation = await client.delete_api_hub_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apihub/setup.py b/packages/google-cloud-apihub/setup.py index a3c81ae19b16..37171bb3bb87 100644 --- a/packages/google-cloud-apihub/setup.py +++ b/packages/google-cloud-apihub/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -71,7 +71,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -79,7 +79,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -90,7 +89,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-apihub/testing/constraints-3.10.txt b/packages/google-cloud-apihub/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-apihub/testing/constraints-3.10.txt +++ b/packages/google-cloud-apihub/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-apihub/testing/constraints-3.9.txt b/packages/google-cloud-apihub/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-apihub/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub.py index 2b5f8092b36e..23684fed5df4 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2451,11 +2445,7 @@ async def test_list_apis_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_apis(request={}) - ).pages: + async for page_ in (await client.list_apis(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4348,11 +4338,7 @@ async def test_list_versions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_versions(request={}) - ).pages: + async for page_ in (await client.list_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6560,11 +6546,7 @@ async def test_list_specs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_specs(request={}) - ).pages: + async for page_ in (await client.list_specs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8467,11 +8449,7 @@ async def test_list_api_operations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_api_operations(request={}) - ).pages: + async for page_ in (await client.list_api_operations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10743,11 +10721,7 @@ async def test_list_deployments_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_deployments(request={}) - ).pages: + async for page_ in (await client.list_deployments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13380,11 +13354,7 @@ async def test_list_attributes_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_attributes(request={}) - ).pages: + async for page_ in (await client.list_attributes(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -13915,11 +13885,7 @@ async def test_search_resources_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_resources(request={}) - ).pages: + async for page_ in (await client.search_resources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15875,11 +15841,7 @@ async def test_list_external_apis_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_external_apis(request={}) - ).pages: + async for page_ in (await client.list_external_apis(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -15994,7 +15956,7 @@ def test_create_api_rest_required_fields(request_type=apihub_service.CreateApiRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_rest_unset_required_fields(): @@ -16181,7 +16143,7 @@ def test_get_api_rest_required_fields(request_type=apihub_service.GetApiRequest) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_rest_unset_required_fields(): @@ -16364,7 +16326,7 @@ def test_list_apis_rest_required_fields(request_type=apihub_service.ListApisRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_apis_rest_unset_required_fields(): @@ -16607,7 +16569,7 @@ def test_update_api_rest_required_fields(request_type=apihub_service.UpdateApiRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_rest_unset_required_fields(): @@ -16793,7 +16755,7 @@ def test_delete_api_rest_required_fields(request_type=apihub_service.DeleteApiRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_rest_unset_required_fields(): @@ -16971,7 +16933,7 @@ def test_create_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_version_rest_unset_required_fields(): @@ -17161,7 +17123,7 @@ def test_get_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_version_rest_unset_required_fields(): @@ -17349,7 +17311,7 @@ def test_list_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_versions_rest_unset_required_fields(): @@ -17597,7 +17559,7 @@ def test_update_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_version_rest_unset_required_fields(): @@ -17788,7 +17750,7 @@ def test_delete_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_version_rest_unset_required_fields(): @@ -17969,7 +17931,7 @@ def test_create_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_spec_rest_unset_required_fields(): @@ -18159,7 +18121,7 @@ def test_get_spec_rest_required_fields(request_type=apihub_service.GetSpecReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_spec_rest_unset_required_fields(): @@ -18341,7 +18303,7 @@ def test_get_spec_contents_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_spec_contents_rest_unset_required_fields(): @@ -18527,7 +18489,7 @@ def test_list_specs_rest_required_fields(request_type=apihub_service.ListSpecsRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_specs_rest_unset_required_fields(): @@ -18777,7 +18739,7 @@ def test_update_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_spec_rest_unset_required_fields(): @@ -18966,7 +18928,7 @@ def test_delete_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_spec_rest_unset_required_fields(): @@ -19151,7 +19113,7 @@ def test_create_api_operation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_operation_rest_unset_required_fields(): @@ -19345,7 +19307,7 @@ def test_get_api_operation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_operation_rest_unset_required_fields(): @@ -19537,7 +19499,7 @@ def test_list_api_operations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_api_operations_rest_unset_required_fields(): @@ -19793,7 +19755,7 @@ def test_update_api_operation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_api_operation_rest_unset_required_fields(): @@ -19986,7 +19948,7 @@ def test_delete_api_operation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_operation_rest_unset_required_fields(): @@ -20164,7 +20126,7 @@ def test_get_definition_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_definition_rest_unset_required_fields(): @@ -20349,7 +20311,7 @@ def test_create_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_deployment_rest_unset_required_fields(): @@ -20539,7 +20501,7 @@ def test_get_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_deployment_rest_unset_required_fields(): @@ -20729,7 +20691,7 @@ def test_list_deployments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_deployments_rest_unset_required_fields(): @@ -20979,7 +20941,7 @@ def test_update_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_deployment_rest_unset_required_fields(): @@ -21170,7 +21132,7 @@ def test_delete_deployment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_deployment_rest_unset_required_fields(): @@ -21353,7 +21315,7 @@ def test_create_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_attribute_rest_unset_required_fields(): @@ -21542,7 +21504,7 @@ def test_get_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_attribute_rest_unset_required_fields(): @@ -21721,7 +21683,7 @@ def test_update_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_attribute_rest_unset_required_fields(): @@ -21912,7 +21874,7 @@ def test_delete_attribute_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_attribute_rest_unset_required_fields(): @@ -22097,7 +22059,7 @@ def test_list_attributes_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_attributes_rest_unset_required_fields(): @@ -22353,7 +22315,7 @@ def test_search_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_resources_rest_unset_required_fields(): @@ -22611,7 +22573,7 @@ def test_create_external_api_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_external_api_rest_unset_required_fields(): @@ -22803,7 +22765,7 @@ def test_get_external_api_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_external_api_rest_unset_required_fields(): @@ -22985,7 +22947,7 @@ def test_update_external_api_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_external_api_rest_unset_required_fields(): @@ -23178,7 +23140,7 @@ def test_delete_external_api_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_external_api_rest_unset_required_fields(): @@ -23367,7 +23329,7 @@ def test_list_external_apis_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_external_apis_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_collect.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_collect.py index aa24fd309da2..3bf7bdcec8a9 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_collect.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_collect.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1836,7 +1830,7 @@ def test_collect_api_data_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_collect_api_data_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_curate.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_curate.py index e08459396f0f..befebafd8e6b 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_curate.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_curate.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2537,11 +2531,7 @@ async def test_list_curations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_curations(request={}) - ).pages: + async for page_ in (await client.list_curations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3330,7 +3320,7 @@ def test_create_curation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_curation_rest_unset_required_fields(): @@ -3519,7 +3509,7 @@ def test_get_curation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_curation_rest_unset_required_fields(): @@ -3706,7 +3696,7 @@ def test_list_curations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_curations_rest_unset_required_fields(): @@ -3953,7 +3943,7 @@ def test_update_curation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_curation_rest_unset_required_fields(): @@ -4132,7 +4122,7 @@ def test_delete_curation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_curation_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_dependencies.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_dependencies.py index 8476c6e9d3cb..79aa33e4107d 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_dependencies.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_dependencies.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3286,11 +3280,7 @@ async def test_list_dependencies_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_dependencies(request={}) - ).pages: + async for page_ in (await client.list_dependencies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3409,7 +3399,7 @@ def test_create_dependency_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_dependency_rest_unset_required_fields(): @@ -3599,7 +3589,7 @@ def test_get_dependency_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_dependency_rest_unset_required_fields(): @@ -3779,7 +3769,7 @@ def test_update_dependency_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_dependency_rest_unset_required_fields(): @@ -3970,7 +3960,7 @@ def test_delete_dependency_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_dependency_rest_unset_required_fields(): @@ -4158,7 +4148,7 @@ def test_list_dependencies_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_dependencies_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_discovery.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_discovery.py index 0b72d46ad7c9..b34e1277e209 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_discovery.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_discovery.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1883,9 +1877,7 @@ async def test_list_discovered_api_observations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_discovered_api_observations(request={}) ).pages: pages.append(page_) @@ -2819,9 +2811,7 @@ async def test_list_discovered_api_operations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_discovered_api_operations(request={}) ).pages: pages.append(page_) @@ -3308,7 +3298,7 @@ def test_list_discovered_api_observations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_discovered_api_observations_rest_unset_required_fields(): @@ -3571,7 +3561,7 @@ def test_get_discovered_api_observation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_discovered_api_observation_rest_unset_required_fields(): @@ -3767,7 +3757,7 @@ def test_list_discovered_api_operations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_discovered_api_operations_rest_unset_required_fields(): @@ -4032,7 +4022,7 @@ def test_get_discovered_api_operation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_discovered_api_operation_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_plugin.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_plugin.py index 6009c9719dca..f7a661d6b085 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_plugin.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_api_hub_plugin.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3218,11 +3212,7 @@ async def test_list_plugins_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_plugins(request={}) - ).pages: + async for page_ in (await client.list_plugins(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5186,11 +5176,7 @@ async def test_list_plugin_instances_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_plugin_instances(request={}) - ).pages: + async for page_ in (await client.list_plugin_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6732,7 +6718,7 @@ def test_get_plugin_rest_required_fields(request_type=plugin_service.GetPluginRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_plugin_rest_unset_required_fields(): @@ -6910,7 +6896,7 @@ def test_enable_plugin_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_enable_plugin_rest_unset_required_fields(): @@ -7089,7 +7075,7 @@ def test_disable_plugin_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_disable_plugin_rest_unset_required_fields(): @@ -7270,7 +7256,7 @@ def test_create_plugin_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_plugin_rest_unset_required_fields(): @@ -7467,7 +7453,7 @@ def test_list_plugins_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_plugins_rest_unset_required_fields(): @@ -7717,7 +7703,7 @@ def test_delete_plugin_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_plugin_rest_unset_required_fields(): @@ -7901,7 +7887,7 @@ def test_create_plugin_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_plugin_instance_rest_unset_required_fields(): @@ -8098,7 +8084,7 @@ def test_execute_plugin_instance_action_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_execute_plugin_instance_action_rest_unset_required_fields(): @@ -8296,7 +8282,7 @@ def test_get_plugin_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_plugin_instance_rest_unset_required_fields(): @@ -8489,7 +8475,7 @@ def test_list_plugin_instances_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_plugin_instances_rest_unset_required_fields(): @@ -8754,7 +8740,7 @@ def test_enable_plugin_instance_action_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_enable_plugin_instance_action_rest_unset_required_fields(): @@ -8955,7 +8941,7 @@ def test_disable_plugin_instance_action_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_disable_plugin_instance_action_rest_unset_required_fields(): @@ -9148,7 +9134,7 @@ def test_update_plugin_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_plugin_instance_rest_unset_required_fields(): @@ -9338,7 +9324,7 @@ def test_delete_plugin_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_plugin_instance_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_host_project_registration_service.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_host_project_registration_service.py index d69c56ced3d6..06d73bc7bced 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_host_project_registration_service.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_host_project_registration_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2748,9 +2742,7 @@ async def test_list_host_project_registrations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_host_project_registrations(request={}) ).pages: pages.append(page_) @@ -2897,7 +2889,7 @@ def test_create_host_project_registration_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_host_project_registration_rest_unset_required_fields(): @@ -3103,7 +3095,7 @@ def test_get_host_project_registration_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_host_project_registration_rest_unset_required_fields(): @@ -3305,7 +3297,7 @@ def test_list_host_project_registrations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_host_project_registrations_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_linting_service.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_linting_service.py index 62aa6c52292e..bac2d08351ee 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_linting_service.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_linting_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2678,7 +2672,7 @@ def test_get_style_guide_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_style_guide_rest_unset_required_fields(): @@ -2860,7 +2854,7 @@ def test_update_style_guide_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_style_guide_rest_unset_required_fields(): @@ -3049,7 +3043,7 @@ def test_get_style_guide_contents_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_style_guide_contents_rest_unset_required_fields(): @@ -3225,7 +3219,7 @@ def test_lint_spec_rest_required_fields(request_type=linting_service.LintSpecReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lint_spec_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_provisioning.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_provisioning.py index 7847e19adc33..033d3700d379 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_provisioning.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_provisioning.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2821,7 +2815,7 @@ def test_create_api_hub_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_api_hub_instance_rest_unset_required_fields(): @@ -3015,7 +3009,7 @@ def test_delete_api_hub_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_api_hub_instance_rest_unset_required_fields(): @@ -3197,7 +3191,7 @@ def test_get_api_hub_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_api_hub_instance_rest_unset_required_fields(): @@ -3384,7 +3378,7 @@ def test_lookup_api_hub_instance_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lookup_api_hub_instance_rest_unset_required_fields(): diff --git a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_runtime_project_attachment_service.py b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_runtime_project_attachment_service.py index 439ac9d7802c..27800118a5f7 100644 --- a/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_runtime_project_attachment_service.py +++ b/packages/google-cloud-apihub/tests/unit/gapic/apihub_v1/test_runtime_project_attachment_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2773,9 +2767,7 @@ async def test_list_runtime_project_attachments_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_runtime_project_attachments(request={}) ).pages: pages.append(page_) @@ -3618,7 +3610,7 @@ def test_create_runtime_project_attachment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_runtime_project_attachment_rest_unset_required_fields(): @@ -3828,7 +3820,7 @@ def test_get_runtime_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_runtime_project_attachment_rest_unset_required_fields(): @@ -4030,7 +4022,7 @@ def test_list_runtime_project_attachments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_runtime_project_attachments_rest_unset_required_fields(): @@ -4299,7 +4291,7 @@ def test_delete_runtime_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_runtime_project_attachment_rest_unset_required_fields(): @@ -4490,7 +4482,7 @@ def test_lookup_runtime_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lookup_runtime_project_attachment_rest_unset_required_fields(): diff --git a/packages/google-cloud-apiregistry/docs/conf.py b/packages/google-cloud-apiregistry/docs/conf.py index b8a459784c8c..f540ed3c84b7 100644 --- a/packages/google-cloud-apiregistry/docs/conf.py +++ b/packages/google-cloud-apiregistry/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-apiregistry" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-apiregistry/google/cloud/apiregistry_v1beta/__init__.py b/packages/google-cloud-apiregistry/google/cloud/apiregistry_v1beta/__init__.py index bac4af4161e4..3501061a0239 100644 --- a/packages/google-cloud-apiregistry/google/cloud/apiregistry_v1beta/__init__.py +++ b/packages/google-cloud-apiregistry/google/cloud/apiregistry_v1beta/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.cloud_api_registry import ( CloudApiRegistryAsyncClient, @@ -53,28 +47,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.apiregistry_v1beta" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-apiregistry/noxfile.py b/packages/google-cloud-apiregistry/noxfile.py index d9fef843f682..9171fdae1926 100644 --- a/packages/google-cloud-apiregistry/noxfile.py +++ b/packages/google-cloud-apiregistry/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-apiregistry/setup.py b/packages/google-cloud-apiregistry/setup.py index 7be53b6b3b09..698c33282650 100644 --- a/packages/google-cloud-apiregistry/setup.py +++ b/packages/google-cloud-apiregistry/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-apiregistry/testing/constraints-3.10.txt b/packages/google-cloud-apiregistry/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-apiregistry/testing/constraints-3.10.txt +++ b/packages/google-cloud-apiregistry/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-apiregistry/testing/constraints-3.9.txt b/packages/google-cloud-apiregistry/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-apiregistry/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-apiregistry/tests/unit/gapic/apiregistry_v1beta/test_cloud_api_registry.py b/packages/google-cloud-apiregistry/tests/unit/gapic/apiregistry_v1beta/test_cloud_api_registry.py index ee7f56067b34..8a6c8a76ed75 100644 --- a/packages/google-cloud-apiregistry/tests/unit/gapic/apiregistry_v1beta/test_cloud_api_registry.py +++ b/packages/google-cloud-apiregistry/tests/unit/gapic/apiregistry_v1beta/test_cloud_api_registry.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2199,11 +2193,7 @@ async def test_list_mcp_servers_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_mcp_servers(request={}) - ).pages: + async for page_ in (await client.list_mcp_servers(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3057,11 +3047,7 @@ async def test_list_mcp_tools_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_mcp_tools(request={}) - ).pages: + async for page_ in (await client.list_mcp_tools(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3173,7 +3159,7 @@ def test_get_mcp_server_rest_required_fields(request_type=service.GetMcpServerRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_mcp_server_rest_unset_required_fields(): @@ -3364,7 +3350,7 @@ def test_list_mcp_servers_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_mcp_servers_rest_unset_required_fields(): @@ -3611,7 +3597,7 @@ def test_get_mcp_tool_rest_required_fields(request_type=service.GetMcpToolReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_mcp_tool_rest_unset_required_fields(): @@ -3798,7 +3784,7 @@ def test_list_mcp_tools_rest_required_fields(request_type=service.ListMcpToolsRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_mcp_tools_rest_unset_required_fields(): diff --git a/packages/google-cloud-appengine-admin/docs/conf.py b/packages/google-cloud-appengine-admin/docs/conf.py index ea33b484d208..dc5a5c2b3f78 100644 --- a/packages/google-cloud-appengine-admin/docs/conf.py +++ b/packages/google-cloud-appengine-admin/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-appengine-admin" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/__init__.py b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/__init__.py index 437020511a2d..9e31c27ba93c 100644 --- a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/__init__.py +++ b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.applications import ApplicationsAsyncClient, ApplicationsClient from .services.authorized_certificates import ( @@ -157,28 +151,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.appengine_admin_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/applications/async_client.py b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/applications/async_client.py index 03897c64d51b..d0e03d382068 100644 --- a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/applications/async_client.py +++ b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/applications/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -441,11 +441,11 @@ async def sample_create_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -540,11 +540,11 @@ async def sample_update_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -648,11 +648,11 @@ async def sample_repair_application(): ) # Make the request - operation = client.repair_application(request=request) + operation = await client.repair_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py index cd82e09d1d09..807a48dad659 100644 --- a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py +++ b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -512,11 +512,11 @@ async def sample_create_domain_mapping(): ) # Make the request - operation = client.create_domain_mapping(request=request) + operation = await client.create_domain_mapping(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -616,11 +616,11 @@ async def sample_update_domain_mapping(): ) # Make the request - operation = client.update_domain_mapping(request=request) + operation = await client.update_domain_mapping(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -718,11 +718,11 @@ async def sample_delete_domain_mapping(): ) # Make the request - operation = client.delete_domain_mapping(request=request) + operation = await client.delete_domain_mapping(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/instances/async_client.py b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/instances/async_client.py index c1408bd4af94..b1310d8d1a84 100644 --- a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/instances/async_client.py +++ b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/instances/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -524,11 +524,11 @@ async def sample_delete_instance(): ) # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -639,11 +639,11 @@ async def sample_debug_instance(): ) # Make the request - operation = client.debug_instance(request=request) + operation = await client.debug_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/services/async_client.py b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/services/async_client.py index 4dc052b77cb9..507ff570d677 100644 --- a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/services/async_client.py +++ b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/services/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -511,11 +511,11 @@ async def sample_update_service(): ) # Make the request - operation = client.update_service(request=request) + operation = await client.update_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -617,11 +617,11 @@ async def sample_delete_service(): ) # Make the request - operation = client.delete_service(request=request) + operation = await client.delete_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/versions/async_client.py b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/versions/async_client.py index e510a479e80b..b4f005ce46db 100644 --- a/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/versions/async_client.py +++ b/packages/google-cloud-appengine-admin/google/cloud/appengine_admin_v1/services/versions/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -505,11 +505,11 @@ async def sample_create_version(): ) # Make the request - operation = client.create_version(request=request) + operation = await client.create_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -638,11 +638,11 @@ async def sample_update_version(): ) # Make the request - operation = client.update_version(request=request) + operation = await client.update_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -736,11 +736,11 @@ async def sample_delete_version(): ) # Make the request - operation = client.delete_version(request=request) + operation = await client.delete_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/noxfile.py b/packages/google-cloud-appengine-admin/noxfile.py index fd198a77da53..88692976938d 100644 --- a/packages/google-cloud-appengine-admin/noxfile.py +++ b/packages/google-cloud-appengine-admin/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_create_application_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_create_application_async.py index 8d45d2547e29..aa82192627e3 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_create_application_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_create_application_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_create_application(): request = appengine_admin_v1.CreateApplicationRequest() # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_repair_application_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_repair_application_async.py index f4fdeaec6a83..1216bea41d40 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_repair_application_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_repair_application_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_repair_application(): request = appengine_admin_v1.RepairApplicationRequest() # Make the request - operation = client.repair_application(request=request) + operation = await client.repair_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_update_application_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_update_application_async.py index 0e7641e5e930..afcb64be3a5a 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_update_application_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_applications_update_application_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_application(): request = appengine_admin_v1.UpdateApplicationRequest() # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_create_domain_mapping_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_create_domain_mapping_async.py index 898c5dfe0f0b..8a02eebf47fd 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_create_domain_mapping_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_create_domain_mapping_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_create_domain_mapping(): request = appengine_admin_v1.CreateDomainMappingRequest() # Make the request - operation = client.create_domain_mapping(request=request) + operation = await client.create_domain_mapping(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_delete_domain_mapping_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_delete_domain_mapping_async.py index f8e27246281f..c8310ed77f3f 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_delete_domain_mapping_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_delete_domain_mapping_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_domain_mapping(): request = appengine_admin_v1.DeleteDomainMappingRequest() # Make the request - operation = client.delete_domain_mapping(request=request) + operation = await client.delete_domain_mapping(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_update_domain_mapping_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_update_domain_mapping_async.py index 32ab32d67f34..52d81acdecd6 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_update_domain_mapping_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_domain_mappings_update_domain_mapping_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_domain_mapping(): request = appengine_admin_v1.UpdateDomainMappingRequest() # Make the request - operation = client.update_domain_mapping(request=request) + operation = await client.update_domain_mapping(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_debug_instance_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_debug_instance_async.py index da90f0fc6e30..759dfadfdb62 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_debug_instance_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_debug_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_debug_instance(): request = appengine_admin_v1.DebugInstanceRequest() # Make the request - operation = client.debug_instance(request=request) + operation = await client.debug_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_delete_instance_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_delete_instance_async.py index e626d19e1b9f..90d469365836 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_delete_instance_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_instances_delete_instance_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_instance(): request = appengine_admin_v1.DeleteInstanceRequest() # Make the request - operation = client.delete_instance(request=request) + operation = await client.delete_instance(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_delete_service_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_delete_service_async.py index f438c11db0c1..0c7f71ad9ffb 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_delete_service_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_delete_service_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_service(): request = appengine_admin_v1.DeleteServiceRequest() # Make the request - operation = client.delete_service(request=request) + operation = await client.delete_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_update_service_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_update_service_async.py index 7db842092f10..e1fdfd081cb3 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_update_service_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_services_update_service_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_service(): request = appengine_admin_v1.UpdateServiceRequest() # Make the request - operation = client.update_service(request=request) + operation = await client.update_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_create_version_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_create_version_async.py index 7153e32c655d..2a9e156157cf 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_create_version_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_create_version_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_create_version(): request = appengine_admin_v1.CreateVersionRequest() # Make the request - operation = client.create_version(request=request) + operation = await client.create_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_delete_version_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_delete_version_async.py index 18388775406f..735873b134d7 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_delete_version_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_delete_version_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_version(): request = appengine_admin_v1.DeleteVersionRequest() # Make the request - operation = client.delete_version(request=request) + operation = await client.delete_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_update_version_async.py b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_update_version_async.py index 97509551318d..b113389e5d86 100644 --- a/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_update_version_async.py +++ b/packages/google-cloud-appengine-admin/samples/generated_samples/appengine_v1_generated_versions_update_version_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_update_version(): request = appengine_admin_v1.UpdateVersionRequest() # Make the request - operation = client.update_version(request=request) + operation = await client.update_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appengine-admin/setup.py b/packages/google-cloud-appengine-admin/setup.py index abe4466b15a3..455628185fb1 100644 --- a/packages/google-cloud-appengine-admin/setup.py +++ b/packages/google-cloud-appengine-admin/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-appengine-admin/testing/constraints-3.10.txt b/packages/google-cloud-appengine-admin/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-appengine-admin/testing/constraints-3.10.txt +++ b/packages/google-cloud-appengine-admin/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-appengine-admin/testing/constraints-3.9.txt b/packages/google-cloud-appengine-admin/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-appengine-admin/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_applications.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_applications.py index 2f15206cbc0b..c96b1cc148f6 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_applications.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_applications.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py index 2b74bd6c38df..3f6d88add1c5 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1836,9 +1830,7 @@ async def test_list_authorized_certificates_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_authorized_certificates(request={}) ).pages: pages.append(page_) diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py index b81019fd88da..6d62c0d0d472 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1805,11 +1799,7 @@ async def test_list_authorized_domains_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_authorized_domains(request={}) - ).pages: + async for page_ in (await client.list_authorized_domains(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py index 84750f0fdb62..eebcd77d0f73 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1774,11 +1768,7 @@ async def test_list_domain_mappings_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_domain_mappings(request={}) - ).pages: + async for page_ in (await client.list_domain_mappings(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_firewall.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_firewall.py index 11f04e55981c..41aef708b941 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_firewall.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_firewall.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1710,11 +1704,7 @@ async def test_list_ingress_rules_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_ingress_rules(request={}) - ).pages: + async for page_ in (await client.list_ingress_rules(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_instances.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_instances.py index 8fa5ddcf6b9e..eaadaafe70e7 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_instances.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_instances.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1706,11 +1700,7 @@ async def test_list_instances_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_instances(request={}) - ).pages: + async for page_ in (await client.list_instances(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_services.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_services.py index ff93fef99012..b95183ee311d 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_services.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_services.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1693,11 +1687,7 @@ async def test_list_services_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_services(request={}) - ).pages: + async for page_ in (await client.list_services(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_versions.py b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_versions.py index c03e23c812a2..2fdb97d96808 100644 --- a/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_versions.py +++ b/packages/google-cloud-appengine-admin/tests/unit/gapic/appengine_admin_v1/test_versions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1695,11 +1689,7 @@ async def test_list_versions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_versions(request={}) - ).pages: + async for page_ in (await client.list_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/packages/google-cloud-appengine-logging/docs/conf.py b/packages/google-cloud-appengine-logging/docs/conf.py index e127e27a06b8..cb1283265a92 100644 --- a/packages/google-cloud-appengine-logging/docs/conf.py +++ b/packages/google-cloud-appengine-logging/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-appengine-logging" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-appengine-logging/google/cloud/appengine_logging_v1/__init__.py b/packages/google-cloud-appengine-logging/google/cloud/appengine_logging_v1/__init__.py index dfb8b1975712..c46ad467ef94 100644 --- a/packages/google-cloud-appengine-logging/google/cloud/appengine_logging_v1/__init__.py +++ b/packages/google-cloud-appengine-logging/google/cloud/appengine_logging_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .types.request_log import LogLine, RequestLog, SourceLocation, SourceReference @@ -40,28 +34,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.appengine_logging_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-appengine-logging/noxfile.py b/packages/google-cloud-appengine-logging/noxfile.py index 1fcdae83b641..723e9b2f7a6e 100644 --- a/packages/google-cloud-appengine-logging/noxfile.py +++ b/packages/google-cloud-appengine-logging/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-appengine-logging/setup.py b/packages/google-cloud-appengine-logging/setup.py index 158bec81f8d9..c52319addd88 100644 --- a/packages/google-cloud-appengine-logging/setup.py +++ b/packages/google-cloud-appengine-logging/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-appengine-logging/testing/constraints-3.10.txt b/packages/google-cloud-appengine-logging/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-appengine-logging/testing/constraints-3.10.txt +++ b/packages/google-cloud-appengine-logging/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-appengine-logging/testing/constraints-3.9.txt b/packages/google-cloud-appengine-logging/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-appengine-logging/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-apphub/docs/conf.py b/packages/google-cloud-apphub/docs/conf.py index af70ce8b2560..ad44483c92e9 100644 --- a/packages/google-cloud-apphub/docs/conf.py +++ b/packages/google-cloud-apphub/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-apphub" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-apphub/google/cloud/apphub_v1/__init__.py b/packages/google-cloud-apphub/google/cloud/apphub_v1/__init__.py index ad9bc019a640..08aa2bba560d 100644 --- a/packages/google-cloud-apphub/google/cloud/apphub_v1/__init__.py +++ b/packages/google-cloud-apphub/google/cloud/apphub_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.app_hub import AppHubAsyncClient, AppHubClient from .types.apphub_service import ( @@ -95,28 +89,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.apphub_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-apphub/google/cloud/apphub_v1/services/app_hub/async_client.py b/packages/google-cloud-apphub/google/cloud/apphub_v1/services/app_hub/async_client.py index b33c24f31eca..bfb04c1622c9 100644 --- a/packages/google-cloud-apphub/google/cloud/apphub_v1/services/app_hub/async_client.py +++ b/packages/google-cloud-apphub/google/cloud/apphub_v1/services/app_hub/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -618,11 +618,11 @@ async def sample_create_service_project_attachment(): ) # Make the request - operation = client.create_service_project_attachment(request=request) + operation = await client.create_service_project_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -897,11 +897,11 @@ async def sample_delete_service_project_attachment(): ) # Make the request - operation = client.delete_service_project_attachment(request=request) + operation = await client.delete_service_project_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1657,11 +1657,11 @@ async def sample_create_service(): ) # Make the request - operation = client.create_service(request=request) + operation = await client.create_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1922,11 +1922,11 @@ async def sample_update_service(): ) # Make the request - operation = client.update_service(request=request) + operation = await client.update_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2065,11 +2065,11 @@ async def sample_delete_service(): ) # Make the request - operation = client.delete_service(request=request) + operation = await client.delete_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2706,11 +2706,11 @@ async def sample_create_workload(): ) # Make the request - operation = client.create_workload(request=request) + operation = await client.create_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2973,11 +2973,11 @@ async def sample_update_workload(): ) # Make the request - operation = client.update_workload(request=request) + operation = await client.update_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3117,11 +3117,11 @@ async def sample_delete_workload(): ) # Make the request - operation = client.delete_workload(request=request) + operation = await client.delete_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3384,11 +3384,11 @@ async def sample_create_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3650,11 +3650,11 @@ async def sample_update_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3794,11 +3794,11 @@ async def sample_delete_application(): ) # Make the request - operation = client.delete_application(request=request) + operation = await client.delete_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/noxfile.py b/packages/google-cloud-apphub/noxfile.py index 7e38a6a4e554..46894fa2c92c 100644 --- a/packages/google-cloud-apphub/noxfile.py +++ b/packages/google-cloud-apphub/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_application_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_application_async.py index 0357950b3001..8ff3139036a1 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_application_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_application_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_application(): ) # Make the request - operation = client.create_application(request=request) + operation = await client.create_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_async.py index 2ef6de8d66b6..74a200cef55a 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_service(): ) # Make the request - operation = client.create_service(request=request) + operation = await client.create_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_project_attachment_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_project_attachment_async.py index 0e3f85a3dc6a..51caf9c75174 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_project_attachment_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_service_project_attachment_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_service_project_attachment(): ) # Make the request - operation = client.create_service_project_attachment(request=request) + operation = await client.create_service_project_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_workload_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_workload_async.py index f76556e6f4f7..763367d1efe2 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_workload_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_create_workload_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_workload(): ) # Make the request - operation = client.create_workload(request=request) + operation = await client.create_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_application_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_application_async.py index 151a6a412dc9..e89157da2767 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_application_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_application_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_application(): ) # Make the request - operation = client.delete_application(request=request) + operation = await client.delete_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_async.py index dc3b35f0eab3..cd6b44fa768d 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_service(): ) # Make the request - operation = client.delete_service(request=request) + operation = await client.delete_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_project_attachment_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_project_attachment_async.py index 1ba1f0d29445..39e61f8da32e 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_project_attachment_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_service_project_attachment_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_service_project_attachment(): ) # Make the request - operation = client.delete_service_project_attachment(request=request) + operation = await client.delete_service_project_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_workload_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_workload_async.py index e5259b55a90d..638967a6d32f 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_workload_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_delete_workload_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_workload(): ) # Make the request - operation = client.delete_workload(request=request) + operation = await client.delete_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_application_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_application_async.py index 820005ab8788..b98506a3cc7a 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_application_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_application_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_application(): ) # Make the request - operation = client.update_application(request=request) + operation = await client.update_application(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_service_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_service_async.py index 830f69175a8b..64db06f2e162 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_service_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_service_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_service(): ) # Make the request - operation = client.update_service(request=request) + operation = await client.update_service(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_workload_async.py b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_workload_async.py index 6c8146f07de4..9aa031514dd0 100644 --- a/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_workload_async.py +++ b/packages/google-cloud-apphub/samples/generated_samples/apphub_v1_generated_app_hub_update_workload_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,11 @@ async def sample_update_workload(): ) # Make the request - operation = client.update_workload(request=request) + operation = await client.update_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-apphub/setup.py b/packages/google-cloud-apphub/setup.py index f214db3886b0..4ab798c48799 100644 --- a/packages/google-cloud-apphub/setup.py +++ b/packages/google-cloud-apphub/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -72,7 +72,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -80,7 +80,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -91,7 +90,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-apphub/testing/constraints-3.10.txt b/packages/google-cloud-apphub/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-apphub/testing/constraints-3.10.txt +++ b/packages/google-cloud-apphub/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 +grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-apphub/testing/constraints-3.9.txt b/packages/google-cloud-apphub/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-apphub/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-apphub/tests/unit/gapic/apphub_v1/test_app_hub.py b/packages/google-cloud-apphub/tests/unit/gapic/apphub_v1/test_app_hub.py index fcaf5f5ac9d9..036941ab0cae 100644 --- a/packages/google-cloud-apphub/tests/unit/gapic/apphub_v1/test_app_hub.py +++ b/packages/google-cloud-apphub/tests/unit/gapic/apphub_v1/test_app_hub.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2159,9 +2153,7 @@ async def test_list_service_project_attachments_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_service_project_attachments(request={}) ).pages: pages.append(page_) @@ -4146,11 +4138,7 @@ async def test_list_discovered_services_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_discovered_services(request={}) - ).pages: + async for page_ in (await client.list_discovered_services(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5365,11 +5353,7 @@ async def test_list_services_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_services(request={}) - ).pages: + async for page_ in (await client.list_services(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7278,11 +7262,7 @@ async def test_list_discovered_workloads_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_discovered_workloads(request={}) - ).pages: + async for page_ in (await client.list_discovered_workloads(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8497,11 +8477,7 @@ async def test_list_workloads_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_workloads(request={}) - ).pages: + async for page_ in (await client.list_workloads(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10404,11 +10380,7 @@ async def test_list_applications_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_applications(request={}) - ).pages: + async for page_ in (await client.list_applications(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11942,7 +11914,7 @@ def test_lookup_service_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lookup_service_project_attachment_rest_unset_required_fields(): @@ -12142,7 +12114,7 @@ def test_list_service_project_attachments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_service_project_attachments_rest_unset_required_fields(): @@ -12438,7 +12410,7 @@ def test_create_service_project_attachment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_service_project_attachment_rest_unset_required_fields(): @@ -12647,7 +12619,7 @@ def test_get_service_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_service_project_attachment_rest_unset_required_fields(): @@ -12839,7 +12811,7 @@ def test_delete_service_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_service_project_attachment_rest_unset_required_fields(): @@ -13029,7 +13001,7 @@ def test_detach_service_project_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_detach_service_project_attachment_rest_unset_required_fields(): @@ -13229,7 +13201,7 @@ def test_list_discovered_services_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_discovered_services_rest_unset_required_fields(): @@ -13485,7 +13457,7 @@ def test_get_discovered_service_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_discovered_service_rest_unset_required_fields(): @@ -13687,7 +13659,7 @@ def test_lookup_discovered_service_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lookup_discovered_service_rest_unset_required_fields(): @@ -13884,7 +13856,7 @@ def test_list_services_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_services_rest_unset_required_fields(): @@ -14161,7 +14133,7 @@ def test_create_service_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_service_rest_unset_required_fields(): @@ -14357,7 +14329,7 @@ def test_get_service_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_service_rest_unset_required_fields(): @@ -14541,7 +14513,7 @@ def test_update_service_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_service_rest_unset_required_fields(): @@ -14739,7 +14711,7 @@ def test_delete_service_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_service_rest_unset_required_fields(): @@ -14933,7 +14905,7 @@ def test_list_discovered_workloads_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_discovered_workloads_rest_unset_required_fields(): @@ -15189,7 +15161,7 @@ def test_get_discovered_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_discovered_workload_rest_unset_required_fields(): @@ -15391,7 +15363,7 @@ def test_lookup_discovered_workload_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_lookup_discovered_workload_rest_unset_required_fields(): @@ -15588,7 +15560,7 @@ def test_list_workloads_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_workloads_rest_unset_required_fields(): @@ -15865,7 +15837,7 @@ def test_create_workload_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_workload_rest_unset_required_fields(): @@ -16061,7 +16033,7 @@ def test_get_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_workload_rest_unset_required_fields(): @@ -16245,7 +16217,7 @@ def test_update_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_workload_rest_unset_required_fields(): @@ -16443,7 +16415,7 @@ def test_delete_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_workload_rest_unset_required_fields(): @@ -16632,7 +16604,7 @@ def test_list_applications_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_applications_rest_unset_required_fields(): @@ -16909,7 +16881,7 @@ def test_create_application_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_application_rest_unset_required_fields(): @@ -17103,7 +17075,7 @@ def test_get_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_application_rest_unset_required_fields(): @@ -17291,7 +17263,7 @@ def test_update_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_application_rest_unset_required_fields(): @@ -17493,7 +17465,7 @@ def test_delete_application_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_application_rest_unset_required_fields(): diff --git a/packages/google-cloud-appoptimize/docs/conf.py b/packages/google-cloud-appoptimize/docs/conf.py index 081e694d5f13..5373a26ef19a 100644 --- a/packages/google-cloud-appoptimize/docs/conf.py +++ b/packages/google-cloud-appoptimize/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-appoptimize" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/__init__.py b/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/__init__.py index 5335d4600680..19657159864e 100644 --- a/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/__init__.py +++ b/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.app_optimize import AppOptimizeAsyncClient, AppOptimizeClient from .types.app_optimize import ( @@ -53,28 +47,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.appoptimize_v1beta" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/services/app_optimize/async_client.py b/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/services/app_optimize/async_client.py index 7d231c6b7a3b..0cc63779411f 100644 --- a/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/services/app_optimize/async_client.py +++ b/packages/google-cloud-appoptimize/google/cloud/appoptimize_v1beta/services/app_optimize/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -342,11 +342,11 @@ async def sample_create_report(): ) # Make the request - operation = client.create_report(request=request) + operation = await client.create_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appoptimize/noxfile.py b/packages/google-cloud-appoptimize/noxfile.py index c48652694aee..95147a53be4a 100644 --- a/packages/google-cloud-appoptimize/noxfile.py +++ b/packages/google-cloud-appoptimize/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-appoptimize/samples/generated_samples/appoptimize_v1beta_generated_app_optimize_create_report_async.py b/packages/google-cloud-appoptimize/samples/generated_samples/appoptimize_v1beta_generated_app_optimize_create_report_async.py index 1d0624deef3e..ba8c9ee71570 100644 --- a/packages/google-cloud-appoptimize/samples/generated_samples/appoptimize_v1beta_generated_app_optimize_create_report_async.py +++ b/packages/google-cloud-appoptimize/samples/generated_samples/appoptimize_v1beta_generated_app_optimize_create_report_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_report(): ) # Make the request - operation = client.create_report(request=request) + operation = await client.create_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-appoptimize/setup.py b/packages/google-cloud-appoptimize/setup.py index a74e7663e6e2..dbade304ecba 100644 --- a/packages/google-cloud-appoptimize/setup.py +++ b/packages/google-cloud-appoptimize/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-appoptimize/testing/constraints-3.10.txt b/packages/google-cloud-appoptimize/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-appoptimize/testing/constraints-3.10.txt +++ b/packages/google-cloud-appoptimize/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-appoptimize/testing/constraints-3.9.txt b/packages/google-cloud-appoptimize/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-appoptimize/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-appoptimize/tests/unit/gapic/appoptimize_v1beta/test_app_optimize.py b/packages/google-cloud-appoptimize/tests/unit/gapic/appoptimize_v1beta/test_app_optimize.py index 6daf17e22830..c4ea67dccf08 100644 --- a/packages/google-cloud-appoptimize/tests/unit/gapic/appoptimize_v1beta/test_app_optimize.py +++ b/packages/google-cloud-appoptimize/tests/unit/gapic/appoptimize_v1beta/test_app_optimize.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2478,11 +2472,7 @@ async def test_list_reports_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_reports(request={}) - ).pages: + async for page_ in (await client.list_reports(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3308,11 +3298,7 @@ async def test_read_report_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.read_report(request={}) - ).pages: + async for page_ in (await client.read_report(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3443,7 +3429,7 @@ def test_create_report_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_report_rest_unset_required_fields(): @@ -3634,7 +3620,7 @@ def test_get_report_rest_required_fields(request_type=app_optimize.GetReportRequ expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_report_rest_unset_required_fields(): @@ -3819,7 +3805,7 @@ def test_list_reports_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_reports_rest_unset_required_fields(): @@ -4065,7 +4051,7 @@ def test_delete_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_report_rest_unset_required_fields(): @@ -4240,7 +4226,7 @@ def test_read_report_rest_required_fields(request_type=app_optimize.ReadReportRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_read_report_rest_unset_required_fields(): diff --git a/packages/google-cloud-artifact-registry/docs/conf.py b/packages/google-cloud-artifact-registry/docs/conf.py index a90f20c27c3e..2ad019669f9f 100644 --- a/packages/google-cloud-artifact-registry/docs/conf.py +++ b/packages/google-cloud-artifact-registry/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-artifact-registry" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/__init__.py b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/__init__.py index 5f8f0726919a..016b58fb7874 100644 --- a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/__init__.py +++ b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.artifact_registry import ( ArtifactRegistryAsyncClient, @@ -166,28 +160,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.artifactregistry_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py index 1a35daf7159a..615535d85bd3 100644 --- a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py +++ b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1/services/artifact_registry/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1370,11 +1370,11 @@ async def sample_import_apt_artifacts(): ) # Make the request - operation = client.import_apt_artifacts(request=request) + operation = await client.import_apt_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1474,11 +1474,11 @@ async def sample_import_yum_artifacts(): ) # Make the request - operation = client.import_yum_artifacts(request=request) + operation = await client.import_yum_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1817,11 +1817,11 @@ async def sample_create_repository(): ) # Make the request - operation = client.create_repository(request=request) + operation = await client.create_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2088,11 +2088,11 @@ async def sample_delete_repository(): ) # Make the request - operation = client.delete_repository(request=request) + operation = await client.delete_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2457,11 +2457,11 @@ async def sample_delete_package(): ) # Make the request - operation = client.delete_package(request=request) + operation = await client.delete_package(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2824,11 +2824,11 @@ async def sample_delete_version(): ) # Make the request - operation = client.delete_version(request=request) + operation = await client.delete_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2957,11 +2957,11 @@ async def sample_batch_delete_versions(): ) # Make the request - operation = client.batch_delete_versions(request=request) + operation = await client.batch_delete_versions(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3464,11 +3464,11 @@ async def sample_delete_file(): ) # Make the request - operation = client.delete_file(request=request) + operation = await client.delete_file(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6042,11 +6042,11 @@ async def sample_create_attachment(): ) # Make the request - operation = client.create_attachment(request=request) + operation = await client.create_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6189,11 +6189,11 @@ async def sample_delete_attachment(): ) # Make the request - operation = client.delete_attachment(request=request) + operation = await client.delete_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -6322,11 +6322,11 @@ async def sample_export_artifact(): ) # Make the request - operation = client.export_artifact(request=request) + operation = await client.export_artifact(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/__init__.py b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/__init__.py index fb16f489aa29..1c908cb04de7 100644 --- a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/__init__.py +++ b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.artifact_registry import ( ArtifactRegistryAsyncClient, @@ -99,28 +93,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.artifactregistry_v1beta2" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py index a26c332a43eb..b37a434a458a 100644 --- a/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py +++ b/packages/google-cloud-artifact-registry/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -382,11 +382,11 @@ async def sample_import_apt_artifacts(): ) # Make the request - operation = client.import_apt_artifacts(request=request) + operation = await client.import_apt_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -486,11 +486,11 @@ async def sample_import_yum_artifacts(): ) # Make the request - operation = client.import_yum_artifacts(request=request) + operation = await client.import_yum_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -828,11 +828,11 @@ async def sample_create_repository(): ) # Make the request - operation = client.create_repository(request=request) + operation = await client.create_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1097,11 +1097,11 @@ async def sample_delete_repository(): ) # Make the request - operation = client.delete_repository(request=request) + operation = await client.delete_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1461,11 +1461,11 @@ async def sample_delete_package(): ) # Make the request - operation = client.delete_package(request=request) + operation = await client.delete_package(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1826,11 +1826,11 @@ async def sample_delete_version(): ) # Make the request - operation = client.delete_version(request=request) + operation = await client.delete_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/noxfile.py b/packages/google-cloud-artifact-registry/noxfile.py index 870b58cc9ce7..90095d9dbe58 100644 --- a/packages/google-cloud-artifact-registry/noxfile.py +++ b/packages/google-cloud-artifact-registry/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_batch_delete_versions_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_batch_delete_versions_async.py index b68869e97674..974e20d645c7 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_batch_delete_versions_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_batch_delete_versions_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_batch_delete_versions(): ) # Make the request - operation = client.batch_delete_versions(request=request) + operation = await client.batch_delete_versions(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_attachment_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_attachment_async.py index 865a9cbdb7e1..7d78a3542d96 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_attachment_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_attachment_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,11 +50,11 @@ async def sample_create_attachment(): ) # Make the request - operation = client.create_attachment(request=request) + operation = await client.create_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_repository_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_repository_async.py index e4fb51d041e8..679e7662c01e 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_repository_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_create_repository_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,11 +45,11 @@ async def sample_create_repository(): ) # Make the request - operation = client.create_repository(request=request) + operation = await client.create_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_attachment_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_attachment_async.py index 8c905301583f..71df8fa4536a 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_attachment_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_attachment_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_attachment(): ) # Make the request - operation = client.delete_attachment(request=request) + operation = await client.delete_attachment(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_file_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_file_async.py index 880e95372e6d..c17c65429fe0 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_file_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_file_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_file(): ) # Make the request - operation = client.delete_file(request=request) + operation = await client.delete_file(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_package_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_package_async.py index fedf0b9de332..313a3cb3a9ab 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_package_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_package_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_package(): ) # Make the request - operation = client.delete_package(request=request) + operation = await client.delete_package(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_repository_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_repository_async.py index 54ad8906c571..e9d8768480b3 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_repository_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_repository_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_repository(): ) # Make the request - operation = client.delete_repository(request=request) + operation = await client.delete_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_version_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_version_async.py index 55f2eca6ba4f..8769b988b0d1 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_version_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_delete_version_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_version(): request = artifactregistry_v1.DeleteVersionRequest() # Make the request - operation = client.delete_version(request=request) + operation = await client.delete_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_export_artifact_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_export_artifact_async.py index f344ee55ad3f..a958d197e77e 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_export_artifact_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_export_artifact_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -46,11 +46,11 @@ async def sample_export_artifact(): ) # Make the request - operation = client.export_artifact(request=request) + operation = await client.export_artifact(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_apt_artifacts_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_apt_artifacts_async.py index a9e2f499e027..7c0b86b0c683 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_apt_artifacts_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_apt_artifacts_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_import_apt_artifacts(): request = artifactregistry_v1.ImportAptArtifactsRequest() # Make the request - operation = client.import_apt_artifacts(request=request) + operation = await client.import_apt_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_yum_artifacts_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_yum_artifacts_async.py index 0ffeb20cc3df..af12b421900d 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_yum_artifacts_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1_generated_artifact_registry_import_yum_artifacts_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_import_yum_artifacts(): request = artifactregistry_v1.ImportYumArtifactsRequest() # Make the request - operation = client.import_yum_artifacts(request=request) + operation = await client.import_yum_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_create_repository_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_create_repository_async.py index 4e9f3dbf77fa..c9809492e099 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_create_repository_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_create_repository_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_repository(): ) # Make the request - operation = client.create_repository(request=request) + operation = await client.create_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_package_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_package_async.py index f38d1d495d03..f6be355d6a0b 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_package_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_package_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_package(): request = artifactregistry_v1beta2.DeletePackageRequest() # Make the request - operation = client.delete_package(request=request) + operation = await client.delete_package(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_repository_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_repository_async.py index 242ebf5a655a..9b2c0f3dae72 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_repository_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_repository_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_repository(): ) # Make the request - operation = client.delete_repository(request=request) + operation = await client.delete_repository(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_version_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_version_async.py index a2c880efb89c..8bc4052c0016 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_version_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_delete_version_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_delete_version(): request = artifactregistry_v1beta2.DeleteVersionRequest() # Make the request - operation = client.delete_version(request=request) + operation = await client.delete_version(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_apt_artifacts_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_apt_artifacts_async.py index e8c2cfa8f53e..a263c0fc55a0 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_apt_artifacts_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_apt_artifacts_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_import_apt_artifacts(): request = artifactregistry_v1beta2.ImportAptArtifactsRequest() # Make the request - operation = client.import_apt_artifacts(request=request) + operation = await client.import_apt_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_yum_artifacts_async.py b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_yum_artifacts_async.py index baebabfea5ba..311b75b53c82 100644 --- a/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_yum_artifacts_async.py +++ b/packages/google-cloud-artifact-registry/samples/generated_samples/artifactregistry_v1beta2_generated_artifact_registry_import_yum_artifacts_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,11 +42,11 @@ async def sample_import_yum_artifacts(): request = artifactregistry_v1beta2.ImportYumArtifactsRequest() # Make the request - operation = client.import_yum_artifacts(request=request) + operation = await client.import_yum_artifacts(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-artifact-registry/setup.py b/packages/google-cloud-artifact-registry/setup.py index 3325d17e403c..113101468e94 100644 --- a/packages/google-cloud-artifact-registry/setup.py +++ b/packages/google-cloud-artifact-registry/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +74,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -82,7 +82,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -93,7 +92,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-artifact-registry/testing/constraints-3.10.txt b/packages/google-cloud-artifact-registry/testing/constraints-3.10.txt index 1cd0c5a2c3d4..a92801e1c8e2 100644 --- a/packages/google-cloud-artifact-registry/testing/constraints-3.10.txt +++ b/packages/google-cloud-artifact-registry/testing/constraints-3.10.txt @@ -1,11 +1,12 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -grpc-google-iam-v1 +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 +grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-artifact-registry/testing/constraints-3.9.txt b/packages/google-cloud-artifact-registry/testing/constraints-3.9.txt deleted file mode 100644 index dcb9a9b3d8ed..000000000000 --- a/packages/google-cloud-artifact-registry/testing/constraints-3.9.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py b/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py index 1eb6b82871ed..ce9e5da76de5 100644 --- a/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py +++ b/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1/test_artifact_registry.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1921,11 +1915,7 @@ async def test_list_docker_images_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_docker_images(request={}) - ).pages: + async for page_ in (await client.list_docker_images(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2811,11 +2801,7 @@ async def test_list_maven_artifacts_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_maven_artifacts(request={}) - ).pages: + async for page_ in (await client.list_maven_artifacts(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3711,11 +3697,7 @@ async def test_list_npm_packages_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_npm_packages(request={}) - ).pages: + async for page_ in (await client.list_npm_packages(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4587,11 +4569,7 @@ async def test_list_python_packages_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_python_packages(request={}) - ).pages: + async for page_ in (await client.list_python_packages(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6005,11 +5983,7 @@ async def test_list_repositories_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_repositories(request={}) - ).pages: + async for page_ in (await client.list_repositories(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8032,11 +8006,7 @@ async def test_list_packages_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_packages(request={}) - ).pages: + async for page_ in (await client.list_packages(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9205,11 +9175,7 @@ async def test_list_versions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_versions(request={}) - ).pages: + async for page_ in (await client.list_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -11061,11 +11027,7 @@ async def test_list_files_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_files(request={}) - ).pages: + async for page_ in (await client.list_files(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -12565,11 +12527,7 @@ async def test_list_tags_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_tags(request={}) - ).pages: + async for page_ in (await client.list_tags(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -14735,11 +14693,7 @@ async def test_list_rules_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_rules(request={}) - ).pages: + async for page_ in (await client.list_rules(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -18758,11 +18712,7 @@ async def test_list_attachments_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_attachments(request={}) - ).pages: + async for page_ in (await client.list_attachments(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -20190,7 +20140,7 @@ def test_list_docker_images_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_docker_images_rest_unset_required_fields(): @@ -20444,7 +20394,7 @@ def test_get_docker_image_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_docker_image_rest_unset_required_fields(): @@ -20635,7 +20585,7 @@ def test_list_maven_artifacts_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_maven_artifacts_rest_unset_required_fields(): @@ -20892,7 +20842,7 @@ def test_get_maven_artifact_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_maven_artifact_rest_unset_required_fields(): @@ -21081,7 +21031,7 @@ def test_list_npm_packages_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_npm_packages_rest_unset_required_fields(): @@ -21332,7 +21282,7 @@ def test_get_npm_package_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_npm_package_rest_unset_required_fields(): @@ -21523,7 +21473,7 @@ def test_list_python_packages_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_python_packages_rest_unset_required_fields(): @@ -21780,7 +21730,7 @@ def test_get_python_package_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_python_package_rest_unset_required_fields(): @@ -22059,7 +22009,7 @@ def test_list_repositories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_repositories_rest_unset_required_fields(): @@ -22310,7 +22260,7 @@ def test_get_repository_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_repository_rest_unset_required_fields(): @@ -22509,7 +22459,7 @@ def test_create_repository_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_repository_rest_unset_required_fields(): @@ -22819,7 +22769,7 @@ def test_delete_repository_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_repository_rest_unset_required_fields(): @@ -23004,7 +22954,7 @@ def test_list_packages_rest_required_fields(request_type=package.ListPackagesReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_packages_rest_unset_required_fields(): @@ -23255,7 +23205,7 @@ def test_get_package_rest_required_fields(request_type=package.GetPackageRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_package_rest_unset_required_fields(): @@ -23434,7 +23384,7 @@ def test_delete_package_rest_required_fields(request_type=package.DeletePackageR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_package_rest_unset_required_fields(): @@ -23972,7 +23922,7 @@ def test_batch_delete_versions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_delete_versions_rest_unset_required_fields(): @@ -24150,7 +24100,7 @@ def test_update_version_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_version_rest_unset_required_fields(): @@ -24341,7 +24291,7 @@ def test_list_files_rest_required_fields(request_type=file.ListFilesRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_files_rest_unset_required_fields(): @@ -24592,7 +24542,7 @@ def test_get_file_rest_required_fields(request_type=file.GetFileRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_file_rest_unset_required_fields(): @@ -24771,7 +24721,7 @@ def test_delete_file_rest_required_fields(request_type=file.DeleteFileRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_file_rest_unset_required_fields(): @@ -24945,7 +24895,7 @@ def test_update_file_rest_required_fields(request_type=gda_file.UpdateFileReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_file_rest_unset_required_fields(): @@ -25687,7 +25637,7 @@ def test_create_rule_rest_required_fields(request_type=gda_rule.CreateRuleReques expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_rule_rest_unset_required_fields(): @@ -25876,7 +25826,7 @@ def test_list_rules_rest_required_fields(request_type=rule.ListRulesRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_rules_rest_unset_required_fields(): @@ -26125,7 +26075,7 @@ def test_get_rule_rest_required_fields(request_type=rule.GetRuleRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_rule_rest_unset_required_fields(): @@ -26400,7 +26350,7 @@ def test_delete_rule_rest_required_fields(request_type=rule.DeleteRuleRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_rule_rest_unset_required_fields(): @@ -26577,7 +26527,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -26705,7 +26655,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -26832,7 +26782,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): @@ -26964,7 +26914,7 @@ def test_get_project_settings_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_project_settings_rest_unset_required_fields(): @@ -27245,7 +27195,7 @@ def test_get_vpcsc_config_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_vpcsc_config_rest_unset_required_fields(): @@ -27634,7 +27584,7 @@ def test_list_attachments_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_attachments_rest_unset_required_fields(): @@ -27888,7 +27838,7 @@ def test_get_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_attachment_rest_unset_required_fields(): @@ -28087,7 +28037,7 @@ def test_create_attachment_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_attachment_rest_unset_required_fields(): @@ -28281,7 +28231,7 @@ def test_delete_attachment_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_attachment_rest_unset_required_fields(): @@ -28461,7 +28411,7 @@ def test_export_artifact_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_artifact_rest_unset_required_fields(): diff --git a/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py b/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py index 986d4fd9c69c..72c8d5b9deaf 100644 --- a/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py +++ b/packages/google-cloud-artifact-registry/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2423,11 +2417,7 @@ async def test_list_repositories_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_repositories(request={}) - ).pages: + async for page_ in (await client.list_repositories(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4390,11 +4380,7 @@ async def test_list_packages_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_packages(request={}) - ).pages: + async for page_ in (await client.list_packages(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5561,11 +5547,7 @@ async def test_list_versions_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_versions(request={}) - ).pages: + async for page_ in (await client.list_versions(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6730,11 +6712,7 @@ async def test_list_files_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_files(request={}) - ).pages: + async for page_ in (await client.list_files(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7574,11 +7552,7 @@ async def test_list_tags_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_tags(request={}) - ).pages: + async for page_ in (await client.list_tags(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10594,7 +10568,7 @@ def test_list_repositories_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_repositories_rest_unset_required_fields(): @@ -10843,7 +10817,7 @@ def test_get_repository_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_repository_rest_unset_required_fields(): @@ -11029,7 +11003,7 @@ def test_create_repository_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_repository_rest_unset_required_fields(): @@ -11330,7 +11304,7 @@ def test_delete_repository_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_repository_rest_unset_required_fields(): @@ -13017,7 +12991,7 @@ def test_set_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_set_iam_policy_rest_unset_required_fields(): @@ -13145,7 +13119,7 @@ def test_get_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_iam_policy_rest_unset_required_fields(): @@ -13272,7 +13246,7 @@ def test_test_iam_permissions_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_test_iam_permissions_rest_unset_required_fields(): @@ -13404,7 +13378,7 @@ def test_get_project_settings_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_project_settings_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/docs/conf.py b/packages/google-cloud-asset/docs/conf.py index c71b29074de6..503fa88d531e 100644 --- a/packages/google-cloud-asset/docs/conf.py +++ b/packages/google-cloud-asset/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-asset" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py index b3d2b7bb144c..9d80550b47d0 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_enrichment_resourceowners import ResourceOwners @@ -125,28 +119,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py index c0fa1b310438..f62ea2258cd3 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -358,11 +358,11 @@ async def sample_export_assets(): ) # Make the request - operation = client.export_assets(request=request) + operation = await client.export_assets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1849,11 +1849,11 @@ async def sample_analyze_iam_policy_longrunning(): ) # Make the request - operation = client.analyze_iam_policy_longrunning(request=request) + operation = await client.analyze_iam_policy_longrunning(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py index ebce73f7e3cc..d3091091d399 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_service import ( @@ -47,28 +41,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1p1beta1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py index a80a31de72b9..d1ce85f9cf46 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_service import ( @@ -57,28 +51,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1p2beta1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py index 07ae62e4452e..1769e4ec28d0 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_service import ContentType, ListAssetsRequest, ListAssetsResponse @@ -42,28 +36,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1p5beta1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/noxfile.py b/packages/google-cloud-asset/noxfile.py index 49b300da7f17..c722b562a341 100644 --- a/packages/google-cloud-asset/noxfile.py +++ b/packages/google-cloud-asset/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py index 05ba0fdb2424..82fd501ea819 100644 --- a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,11 +51,11 @@ async def sample_analyze_iam_policy_longrunning(): ) # Make the request - operation = client.analyze_iam_policy_longrunning(request=request) + operation = await client.analyze_iam_policy_longrunning(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py index 69eb824d4f58..628d9c50000a 100644 --- a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_assets(): ) # Make the request - operation = client.export_assets(request=request) + operation = await client.export_assets(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-asset/setup.py b/packages/google-cloud-asset/setup.py index a3b454d7e383..68814f2ad096 100644 --- a/packages/google-cloud-asset/setup.py +++ b/packages/google-cloud-asset/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,12 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "google-cloud-org-policy >= 1.11.1, <2.0.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -75,7 +74,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -83,7 +82,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -94,7 +92,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-asset/testing/constraints-3.10.txt b/packages/google-cloud-asset/testing/constraints-3.10.txt index c5602c5029bf..88ca48cac49d 100644 --- a/packages/google-cloud-asset/testing/constraints-3.10.txt +++ b/packages/google-cloud-asset/testing/constraints-3.10.txt @@ -1,13 +1,14 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography -google-cloud-access-context-manager -google-cloud-os-config -grpc-google-iam-v1 +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 +google-cloud-access-context-manager==0.2.0 +google-cloud-os-config==1.13.0 +grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-asset/testing/constraints-3.9.txt b/packages/google-cloud-asset/testing/constraints-3.9.txt deleted file mode 100644 index d27d02e77dae..000000000000 --- a/packages/google-cloud-asset/testing/constraints-3.9.txt +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-cloud-org-policy==1.11.1 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 -google-cloud-access-context-manager==0.2.0 -google-cloud-os-config==1.13.0 -grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py index add96e33c80a..2e516c73227d 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2054,11 +2048,7 @@ async def test_list_assets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_assets(request={}) - ).pages: + async for page_ in (await client.list_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4502,11 +4492,7 @@ async def test_search_all_resources_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_all_resources(request={}) - ).pages: + async for page_ in (await client.search_all_resources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5063,11 +5049,7 @@ async def test_search_all_iam_policies_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_all_iam_policies(request={}) - ).pages: + async for page_ in (await client.search_all_iam_policies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7324,11 +7306,7 @@ async def test_list_saved_queries_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_saved_queries(request={}) - ).pages: + async for page_ in (await client.list_saved_queries(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8839,11 +8817,7 @@ async def test_analyze_org_policies_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.analyze_org_policies(request={}) - ).pages: + async for page_ in (await client.analyze_org_policies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9424,9 +9398,7 @@ async def test_analyze_org_policy_governed_containers_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.analyze_org_policy_governed_containers(request={}) ).pages: pages.append(page_) @@ -10007,9 +9979,7 @@ async def test_analyze_org_policy_governed_assets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.analyze_org_policy_governed_assets(request={}) ).pages: pages.append(page_) @@ -10127,7 +10097,7 @@ def test_export_assets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_assets_rest_unset_required_fields(): @@ -10264,7 +10234,7 @@ def test_list_assets_rest_required_fields(request_type=asset_service.ListAssetsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_assets_rest_unset_required_fields(): @@ -10527,7 +10497,7 @@ def test_batch_get_assets_history_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_get_assets_history_rest_unset_required_fields(): @@ -10660,7 +10630,7 @@ def test_create_feed_rest_required_fields(request_type=asset_service.CreateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_feed_rest_unset_required_fields(): @@ -10843,7 +10813,7 @@ def test_get_feed_rest_required_fields(request_type=asset_service.GetFeedRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_feed_rest_unset_required_fields(): @@ -11017,7 +10987,7 @@ def test_list_feeds_rest_required_fields(request_type=asset_service.ListFeedsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_feeds_rest_unset_required_fields(): @@ -11187,7 +11157,7 @@ def test_update_feed_rest_required_fields(request_type=asset_service.UpdateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_feed_rest_unset_required_fields(): @@ -11366,7 +11336,7 @@ def test_delete_feed_rest_required_fields(request_type=asset_service.DeleteFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_feed_rest_unset_required_fields(): @@ -11555,7 +11525,7 @@ def test_search_all_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_all_resources_rest_unset_required_fields(): @@ -11825,7 +11795,7 @@ def test_search_all_iam_policies_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_all_iam_policies_rest_unset_required_fields(): @@ -12084,7 +12054,7 @@ def test_analyze_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_iam_policy_rest_unset_required_fields(): @@ -12215,7 +12185,7 @@ def test_analyze_iam_policy_longrunning_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_iam_policy_longrunning_rest_unset_required_fields(): @@ -12365,7 +12335,7 @@ def test_analyze_move_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_move_rest_unset_required_fields(): @@ -12499,7 +12469,7 @@ def test_query_assets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_query_assets_rest_unset_required_fields(): @@ -12639,7 +12609,7 @@ def test_create_saved_query_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_saved_query_rest_unset_required_fields(): @@ -12828,7 +12798,7 @@ def test_get_saved_query_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_saved_query_rest_unset_required_fields(): @@ -13016,7 +12986,7 @@ def test_list_saved_queries_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_saved_queries_rest_unset_required_fields(): @@ -13266,7 +13236,7 @@ def test_update_saved_query_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_saved_query_rest_unset_required_fields(): @@ -13456,7 +13426,7 @@ def test_delete_saved_query_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_saved_query_rest_unset_required_fields(): @@ -13652,7 +13622,7 @@ def test_batch_get_effective_iam_policies_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_get_effective_iam_policies_rest_unset_required_fields(): @@ -13808,7 +13778,7 @@ def test_analyze_org_policies_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_org_policies_rest_unset_required_fields(): @@ -14102,7 +14072,7 @@ def test_analyze_org_policy_governed_containers_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_org_policy_governed_containers_rest_unset_required_fields(): @@ -14406,7 +14376,7 @@ def test_analyze_org_policy_governed_assets_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_analyze_org_policy_governed_assets_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py index b2427cfef025..0c9158568eee 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1851,11 +1845,7 @@ async def test_search_all_resources_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_all_resources(request={}) - ).pages: + async for page_ in (await client.search_all_resources(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2410,11 +2400,7 @@ async def test_search_all_iam_policies_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.search_all_iam_policies(request={}) - ).pages: + async for page_ in (await client.search_all_iam_policies(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2542,7 +2528,7 @@ def test_search_all_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_all_resources_rest_unset_required_fields(): @@ -2810,7 +2796,7 @@ def test_search_all_iam_policies_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_search_all_iam_policies_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py index e11fc60b0f25..2d5176fb8e92 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3017,7 +3011,7 @@ def test_create_feed_rest_required_fields(request_type=asset_service.CreateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_feed_rest_unset_required_fields(): @@ -3200,7 +3194,7 @@ def test_get_feed_rest_required_fields(request_type=asset_service.GetFeedRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_feed_rest_unset_required_fields(): @@ -3374,7 +3368,7 @@ def test_list_feeds_rest_required_fields(request_type=asset_service.ListFeedsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_feeds_rest_unset_required_fields(): @@ -3544,7 +3538,7 @@ def test_update_feed_rest_required_fields(request_type=asset_service.UpdateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_feed_rest_unset_required_fields(): @@ -3723,7 +3717,7 @@ def test_delete_feed_rest_required_fields(request_type=asset_service.DeleteFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_feed_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py index ba3040327f6d..c7ade516bbc5 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -1801,11 +1795,7 @@ async def test_list_assets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_assets(request={}) - ).pages: + async for page_ in (await client.list_assets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1927,7 +1917,7 @@ def test_list_assets_rest_required_fields(request_type=asset_service.ListAssetsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_assets_rest_unset_required_fields(): diff --git a/packages/google-cloud-assured-workloads/docs/conf.py b/packages/google-cloud-assured-workloads/docs/conf.py index fd6e04a91440..4c591f45c944 100644 --- a/packages/google-cloud-assured-workloads/docs/conf.py +++ b/packages/google-cloud-assured-workloads/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-assured-workloads" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/__init__.py b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/__init__.py index 05121265f1d7..e64f9d9e2750 100644 --- a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/__init__.py +++ b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.assured_workloads_service import ( AssuredWorkloadsServiceAsyncClient, @@ -62,28 +56,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.assuredworkloads_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/services/assured_workloads_service/async_client.py b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/services/assured_workloads_service/async_client.py index 95c0fdd27b9d..947264a51cdf 100644 --- a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/services/assured_workloads_service/async_client.py +++ b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1/services/assured_workloads_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -357,11 +357,11 @@ async def sample_create_workload(): ) # Make the request - operation = client.create_workload(request=request) + operation = await client.create_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/__init__.py b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/__init__.py index 2ef0eff62acf..8d348ad3bc8b 100644 --- a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/__init__.py +++ b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.assured_workloads_service import ( AssuredWorkloadsServiceAsyncClient, @@ -57,28 +51,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.assuredworkloads_v1beta1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/services/assured_workloads_service/async_client.py b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/services/assured_workloads_service/async_client.py index f9fc41ea5f4a..6c24b07012b4 100644 --- a/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/services/assured_workloads_service/async_client.py +++ b/packages/google-cloud-assured-workloads/google/cloud/assuredworkloads_v1beta1/services/assured_workloads_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -355,11 +355,11 @@ async def sample_create_workload(): ) # Make the request - operation = client.create_workload(request=request) + operation = await client.create_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-assured-workloads/noxfile.py b/packages/google-cloud-assured-workloads/noxfile.py index f9dd911ac1ea..f640666f0b91 100644 --- a/packages/google-cloud-assured-workloads/noxfile.py +++ b/packages/google-cloud-assured-workloads/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_create_workload_async.py b/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_create_workload_async.py index 5d10a510e8d3..a56803dcb22d 100644 --- a/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_create_workload_async.py +++ b/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1_generated_assured_workloads_service_create_workload_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_workload(): ) # Make the request - operation = client.create_workload(request=request) + operation = await client.create_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1beta1_generated_assured_workloads_service_create_workload_async.py b/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1beta1_generated_assured_workloads_service_create_workload_async.py index 930f84656bae..b543a7c0fc00 100644 --- a/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1beta1_generated_assured_workloads_service_create_workload_async.py +++ b/packages/google-cloud-assured-workloads/samples/generated_samples/assuredworkloads_v1beta1_generated_assured_workloads_service_create_workload_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,11 +49,11 @@ async def sample_create_workload(): ) # Make the request - operation = client.create_workload(request=request) + operation = await client.create_workload(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-assured-workloads/setup.py b/packages/google-cloud-assured-workloads/setup.py index 56df4f4a300b..9a18ee7fa52f 100644 --- a/packages/google-cloud-assured-workloads/setup.py +++ b/packages/google-cloud-assured-workloads/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-assured-workloads/testing/constraints-3.10.txt b/packages/google-cloud-assured-workloads/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-assured-workloads/testing/constraints-3.10.txt +++ b/packages/google-cloud-assured-workloads/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-assured-workloads/testing/constraints-3.9.txt b/packages/google-cloud-assured-workloads/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-assured-workloads/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1/test_assured_workloads_service.py b/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1/test_assured_workloads_service.py index efcd8b1869cd..ecadca5b1226 100644 --- a/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1/test_assured_workloads_service.py +++ b/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1/test_assured_workloads_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3553,11 +3547,7 @@ async def test_list_workloads_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_workloads(request={}) - ).pages: + async for page_ in (await client.list_workloads(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4010,11 +4000,7 @@ async def test_list_violations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_violations(request={}) - ).pages: + async for page_ in (await client.list_violations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4616,7 +4602,7 @@ def test_create_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_workload_rest_unset_required_fields(): @@ -4800,7 +4786,7 @@ def test_update_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_workload_rest_unset_required_fields(): @@ -5000,7 +4986,7 @@ def test_restrict_allowed_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restrict_allowed_resources_rest_unset_required_fields(): @@ -5127,7 +5113,7 @@ def test_delete_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_workload_rest_unset_required_fields(): @@ -5305,7 +5291,7 @@ def test_get_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_workload_rest_unset_required_fields(): @@ -5493,7 +5479,7 @@ def test_list_workloads_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_workloads_rest_unset_required_fields(): diff --git a/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1beta1/test_assured_workloads_service.py b/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1beta1/test_assured_workloads_service.py index 9e00c4a87a1b..03c650c68eaa 100644 --- a/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1beta1/test_assured_workloads_service.py +++ b/packages/google-cloud-assured-workloads/tests/unit/gapic/assuredworkloads_v1beta1/test_assured_workloads_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -3647,11 +3641,7 @@ async def test_list_workloads_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_workloads(request={}) - ).pages: + async for page_ in (await client.list_workloads(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3769,7 +3759,7 @@ def test_create_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_workload_rest_unset_required_fields(): @@ -3973,7 +3963,7 @@ def test_restrict_allowed_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_restrict_allowed_resources_rest_unset_required_fields(): @@ -4100,7 +4090,7 @@ def test_delete_workload_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_workload_rest_unset_required_fields(): diff --git a/packages/google-cloud-auditmanager/docs/conf.py b/packages/google-cloud-auditmanager/docs/conf.py index 3b2027bc9ecb..941e547be82f 100644 --- a/packages/google-cloud-auditmanager/docs/conf.py +++ b/packages/google-cloud-auditmanager/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-auditmanager" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/__init__.py b/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/__init__.py index bf3a2054199d..666540e33d2d 100644 --- a/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/__init__.py +++ b/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.audit_manager import AuditManagerAsyncClient, AuditManagerClient from .types.auditmanager import ( @@ -66,28 +60,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.auditmanager_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/services/audit_manager/async_client.py b/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/services/audit_manager/async_client.py index edad540a3b99..3e416046b871 100644 --- a/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/services/audit_manager/async_client.py +++ b/packages/google-cloud-auditmanager/google/cloud/auditmanager_v1/services/audit_manager/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -647,11 +647,11 @@ async def sample_generate_audit_report(): ) # Make the request - operation = client.generate_audit_report(request=request) + operation = await client.generate_audit_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-auditmanager/noxfile.py b/packages/google-cloud-auditmanager/noxfile.py index dbcbe3a1c915..6e97afe84580 100644 --- a/packages/google-cloud-auditmanager/noxfile.py +++ b/packages/google-cloud-auditmanager/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -390,7 +389,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-auditmanager/samples/generated_samples/auditmanager_v1_generated_audit_manager_generate_audit_report_async.py b/packages/google-cloud-auditmanager/samples/generated_samples/auditmanager_v1_generated_audit_manager_generate_audit_report_async.py index c3660ec8320d..f21e7478d3ac 100644 --- a/packages/google-cloud-auditmanager/samples/generated_samples/auditmanager_v1_generated_audit_manager_generate_audit_report_async.py +++ b/packages/google-cloud-auditmanager/samples/generated_samples/auditmanager_v1_generated_audit_manager_generate_audit_report_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_generate_audit_report(): ) # Make the request - operation = client.generate_audit_report(request=request) + operation = await client.generate_audit_report(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-auditmanager/setup.py b/packages/google-cloud-auditmanager/setup.py index 0051664dbbbc..d9be6022d2e6 100644 --- a/packages/google-cloud-auditmanager/setup.py +++ b/packages/google-cloud-auditmanager/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -73,7 +73,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -81,7 +81,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +91,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-auditmanager/testing/constraints-3.10.txt b/packages/google-cloud-auditmanager/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-auditmanager/testing/constraints-3.10.txt +++ b/packages/google-cloud-auditmanager/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-auditmanager/testing/constraints-3.9.txt b/packages/google-cloud-auditmanager/testing/constraints-3.9.txt deleted file mode 100644 index ac3833d41b9a..000000000000 --- a/packages/google-cloud-auditmanager/testing/constraints-3.9.txt +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-auditmanager/tests/unit/gapic/auditmanager_v1/test_audit_manager.py b/packages/google-cloud-auditmanager/tests/unit/gapic/auditmanager_v1/test_audit_manager.py index e40119dca113..0518ab508410 100644 --- a/packages/google-cloud-auditmanager/tests/unit/gapic/auditmanager_v1/test_audit_manager.py +++ b/packages/google-cloud-auditmanager/tests/unit/gapic/auditmanager_v1/test_audit_manager.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2936,11 +2930,7 @@ async def test_list_audit_reports_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_audit_reports(request={}) - ).pages: + async for page_ in (await client.list_audit_reports(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4205,9 +4195,7 @@ async def test_list_resource_enrollment_statuses_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch + async for page_ in ( await client.list_resource_enrollment_statuses(request={}) ).pages: pages.append(page_) @@ -4724,11 +4712,7 @@ async def test_list_controls_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_controls(request={}) - ).pages: + async for page_ in (await client.list_controls(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4843,7 +4827,7 @@ def test_enroll_resource_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_enroll_resource_rest_unset_required_fields(): @@ -5053,7 +5037,7 @@ def test_generate_audit_scope_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_generate_audit_scope_report_rest_unset_required_fields(): @@ -5260,7 +5244,7 @@ def test_generate_audit_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_generate_audit_report_rest_unset_required_fields(): @@ -5462,7 +5446,7 @@ def test_list_audit_reports_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_audit_reports_rest_unset_required_fields(): @@ -5713,7 +5697,7 @@ def test_get_audit_report_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_audit_report_rest_unset_required_fields(): @@ -5898,7 +5882,7 @@ def test_get_resource_enrollment_status_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_resource_enrollment_status_rest_unset_required_fields(): @@ -6094,7 +6078,7 @@ def test_list_resource_enrollment_statuses_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_resource_enrollment_statuses_rest_unset_required_fields(): @@ -6361,7 +6345,7 @@ def test_list_controls_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_controls_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/docs/conf.py b/packages/google-cloud-automl/docs/conf.py index e6d0f2d68e42..05a107396697 100644 --- a/packages/google-cloud-automl/docs/conf.py +++ b/packages/google-cloud-automl/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-automl" -copyright = "2025, Google, LLC" +copyright = "2026, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py b/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py index 2968bc863430..60d64076048b 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.auto_ml import AutoMlAsyncClient, AutoMlClient from .services.prediction_service import ( @@ -149,28 +143,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.automl_v1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py index a1e1e4366cce..a223d25a04a4 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -365,11 +365,11 @@ async def sample_create_dataset(): ) # Make the request - operation = client.create_dataset(request=request) + operation = await client.create_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -869,11 +869,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1016,11 +1016,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1168,11 +1168,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1424,11 +1424,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1796,11 +1796,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2064,11 +2064,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2205,11 +2205,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2350,11 +2350,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py index 565550a1576d..881cdbaf08f2 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -570,11 +570,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py b/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py index 26ec3699d57b..41262d1beb31 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,9 +55,11 @@ class InputConfig(proto.Message): with non-terminal symbols defined near the end of this comment. The formats are: - AutoML Vision: + AutoML Vision + ^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' See `Preparing your training data `__ for @@ -98,7 +100,8 @@ class InputConfig(proto.Message): UNASSIGNED,gs://folder/image3.jpg,daisy UNASSIGNED,gs://folder/image4.jpg - Object Detection: + Object Detection + '''''''''''''''' See `Preparing your training data `__ @@ -148,9 +151,11 @@ class InputConfig(proto.Message): - AutoML Video Intelligence: + AutoML Video Intelligence + ^^^^^^^^^^^^^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' See `Preparing your training data `__ @@ -200,7 +205,8 @@ class InputConfig(proto.Message): gs://folder/vid2.avi,car,0,60.5 gs://folder/vid3.avi,,, - Object Tracking: + Object Tracking + ''''''''''''''' See `Preparing your training data `__ @@ -263,9 +269,11 @@ class InputConfig(proto.Message): gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, gs://folder/video2.avi,,,,,,,,,,, - AutoML Natural Language: + AutoML Natural Language + ^^^^^^^^^^^^^^^^^^^^^^^ - Entity Extraction: + Entity Extraction + ''''''''''''''''' See `Preparing your training data `__ for @@ -459,7 +467,8 @@ class InputConfig(proto.Message): }, ], - Classification: + Classification + '''''''''''''' See `Preparing your training data `__ @@ -511,7 +520,8 @@ class InputConfig(proto.Message): TEST,gs://folder/document.pdf VALIDATE,gs://folder/text_files.zip,BadFood - Sentiment Analysis: + Sentiment Analysis + '''''''''''''''''' See `Preparing your training data `__ @@ -574,7 +584,8 @@ class InputConfig(proto.Message): TEST,gs://folder/document.pdf VALIDATE,gs://folder/text_files.zip,2 - AutoML Tables: + AutoML Tables + ^^^^^^^^^^^^^ See `Preparing your training data `__ for @@ -691,7 +702,8 @@ class InputConfig(proto.Message): semantic of the imported data, any string must be up to 25000 characters long. - AutoML Tables: + AutoML Tables + ^^^^^^^^^^^^^ ``schema_inference_version`` : (integer) This value must be supplied. The version of the algorithm to use for the @@ -724,9 +736,11 @@ class BatchPredictInputConfig(proto.Message): with non-terminal symbols defined near the end of this comment. The formats are: - AutoML Vision: + AutoML Vision + ^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' One or more CSV files where each line is a single column: @@ -746,7 +760,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/image2.gif gs://folder/image3.png - Object Detection: + Object Detection + '''''''''''''''' One or more CSV files where each line is a single column: @@ -766,9 +781,11 @@ class BatchPredictInputConfig(proto.Message): gs://folder/image2.gif gs://folder/image3.png - AutoML Video Intelligence: + AutoML Video Intelligence + ^^^^^^^^^^^^^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' One or more CSV files where each line is a single column: @@ -791,7 +808,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/video1.mp4,20,60 gs://folder/vid2.mov,0,inf - Object Tracking: + Object Tracking + ''''''''''''''' One or more CSV files where each line is a single column: @@ -814,9 +832,11 @@ class BatchPredictInputConfig(proto.Message): gs://folder/video1.mp4,20,60 gs://folder/vid2.mov,0,inf - AutoML Natural Language: + AutoML Natural Language + ^^^^^^^^^^^^^^^^^^^^^^^ - Classification: + Classification + '''''''''''''' One or more CSV files where each line is a single column: @@ -837,7 +857,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/text2.pdf gs://folder/text3.tif - Sentiment Analysis: + Sentiment Analysis + '''''''''''''''''' One or more CSV files where each line is a single column: @@ -858,7 +879,8 @@ class BatchPredictInputConfig(proto.Message): gs://folder/text2.pdf gs://folder/text3.tif - Entity Extraction: + Entity Extraction + ''''''''''''''''' One or more JSONL (JSON Lines) files that either provide inline text or documents. You can only use one format, either inline text or @@ -933,7 +955,8 @@ class BatchPredictInputConfig(proto.Message): } } - AutoML Tables: + AutoML Tables + ^^^^^^^^^^^^^ See `Preparing your training data `__ diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py index 310edefc5778..07baf5afcb7c 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,13 +21,7 @@ __version__ = package_version.__version__ -if sys.version_info >= (3, 8): # pragma: NO COVER - from importlib import metadata -else: # pragma: NO COVER - # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove - # this code path once we drop support for Python 3.7 - import importlib_metadata as metadata - +from importlib import metadata from .services.auto_ml import AutoMlAsyncClient, AutoMlClient from .services.prediction_service import ( @@ -195,28 +189,17 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: - import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.automl_v1beta1" - if sys.version_info < (3, 9): + if sys.version_info < (3, 10): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.9, and then update {_package_label}.", - FutureWarning, - ) - if sys.version_info[:2] == (3, 9): - warnings.warn( - f"You are using a Python version ({_py_version_str}) " - + f"which Google will stop supporting in {_package_label} in " - + "January 2026. Please " - + "upgrade to the latest Python version, or at " - + "least to Python 3.10, before then, and " - + f"then update {_package_label}.", + + f"least to Python 3.10, and then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py index bbc60a196714..340116618550 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -859,11 +859,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1002,11 +1002,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -1150,11 +1150,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2120,11 +2120,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2492,11 +2492,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2639,11 +2639,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2780,11 +2780,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -2922,11 +2922,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) @@ -3081,11 +3081,11 @@ async def sample_export_evaluated_examples(): ) # Make the request - operation = client.export_evaluated_examples(request=request) + operation = await client.export_evaluated_examples(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py index 1b7f0dc86888..48806d2da5aa 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -536,11 +536,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/noxfile.py b/packages/google-cloud-automl/noxfile.py index 4e126e3abe91..aa307e6f99c4 100644 --- a/packages/google-cloud-automl/noxfile.py +++ b/packages/google-cloud-automl/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ - "3.9", "3.10", "3.11", "3.12", @@ -391,7 +390,6 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", - "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py index ebdce3d3ca7e..e39d2a112f0a 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +53,11 @@ async def sample_create_dataset(): ) # Make the request - operation = client.create_dataset(request=request) + operation = await client.create_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py index 3f05c7b83e4d..7f3576f0ca4f 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py index 4f79dbb43392..bf73628b9b51 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py index 994476f3e411..6ec9f3a4a899 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py index 2b6aa5e36da0..70df9ca4f525 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py index eda683a06cd8..823afa076c57 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py index babad52490b0..96c993fe4da2 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py index 0df6eba7ab30..ab0f9b6ffd0c 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py index 91b9a168f270..1e11c6ac8086 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py index 5f19c4226683..7d85d80ed7ab 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -52,11 +52,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py index 76b87740d080..b4be09c5429a 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_model(): ) # Make the request - operation = client.create_model(request=request) + operation = await client.create_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py index a4c6e1d7ec82..91aec7607d10 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = client.delete_dataset(request=request) + operation = await client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py index c98857b95be5..bec81527b747 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_model(): ) # Make the request - operation = client.delete_model(request=request) + operation = await client.delete_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py index f4de388af10e..aa5c2f3ef761 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_deploy_model(): ) # Make the request - operation = client.deploy_model(request=request) + operation = await client.deploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py index a30f6af27324..2c98e3d4e1d4 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_data(): ) # Make the request - operation = client.export_data(request=request) + operation = await client.export_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py index b970f50ac5be..7ed13eb71741 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_evaluated_examples(): ) # Make the request - operation = client.export_evaluated_examples(request=request) + operation = await client.export_evaluated_examples(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py index 65ee458d4dd8..d95878ad49ec 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_model(): ) # Make the request - operation = client.export_model(request=request) + operation = await client.export_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py index e28851a3899e..23c576be2c00 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_import_data(): ) # Make the request - operation = client.import_data(request=request) + operation = await client.import_data(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py index 131f7e327dcf..df2160110cfe 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = client.undeploy_model(request=request) + operation = await client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py index 18600baf725f..b7af37fbd6e3 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_batch_predict(): ) # Make the request - operation = client.batch_predict(request=request) + operation = await client.batch_predict(request=request) print("Waiting for operation to complete...") - response = (await operation).result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/setup.py b/packages/google-cloud-automl/setup.py index d92d1981fe09..2ad42826fa4f 100644 --- a/packages/google-cloud-automl/setup.py +++ b/packages/google-cloud-automl/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.11.0, <3.0.0", + "google-api-core[grpc] >= 2.17.1, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.33.2, < 2.0.0", + "grpcio >= 1.44.0, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -76,7 +76,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache 2.0", + license="Apache-2.0", url=url, classifiers=[ release_status, @@ -84,7 +84,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -95,7 +94,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.9", + python_requires=">=3.10", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-automl/testing/constraints-3.10.txt b/packages/google-cloud-automl/testing/constraints-3.10.txt index 7599dea499ed..bac7ba85b4ee 100644 --- a/packages/google-cloud-automl/testing/constraints-3.10.txt +++ b/packages/google-cloud-automl/testing/constraints-3.10.txt @@ -1,10 +1,11 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -google-auth -grpcio -proto-plus -protobuf -# cryptography is a direct dependency of google-auth -cryptography +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.17.1 +google-auth==2.14.1 +grpcio==1.44.0 +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-automl/testing/constraints-3.9.txt b/packages/google-cloud-automl/testing/constraints-3.9.txt deleted file mode 100644 index 60e67851a5fa..000000000000 --- a/packages/google-cloud-automl/testing/constraints-3.9.txt +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.21.0 -google-cloud-storage==2.14.0 -libcst==0.2.5 -pandas==1.1.3 -# numpy is a dependency of pandas -numpy==1.19.3 -google-auth==2.35.0 -# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) -# Add the minimum supported version of grpcio to constraints files -proto-plus==1.22.3 -protobuf==4.25.8 diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py index 85020d51d6c8..879cab860a75 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2474,11 +2468,7 @@ async def test_list_datasets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_datasets(request={}) - ).pages: + async for page_ in (await client.list_datasets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5440,11 +5430,7 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8058,11 +8044,7 @@ async def test_list_model_evaluations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_model_evaluations(request={}) - ).pages: + async for page_ in (await client.list_model_evaluations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8176,7 +8158,7 @@ def test_create_dataset_rest_required_fields(request_type=service.CreateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_dataset_rest_unset_required_fields(): @@ -8367,7 +8349,7 @@ def test_get_dataset_rest_required_fields(request_type=service.GetDatasetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_dataset_rest_unset_required_fields(): @@ -8550,7 +8532,7 @@ def test_list_datasets_rest_required_fields(request_type=service.ListDatasetsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_datasets_rest_unset_required_fields(): @@ -8793,7 +8775,7 @@ def test_update_dataset_rest_required_fields(request_type=service.UpdateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_dataset_rest_unset_required_fields(): @@ -8990,7 +8972,7 @@ def test_delete_dataset_rest_required_fields(request_type=service.DeleteDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_dataset_rest_unset_required_fields(): @@ -9165,7 +9147,7 @@ def test_import_data_rest_required_fields(request_type=service.ImportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_data_rest_unset_required_fields(): @@ -9355,7 +9337,7 @@ def test_export_data_rest_required_fields(request_type=service.ExportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_data_rest_unset_required_fields(): @@ -9553,7 +9535,7 @@ def test_get_annotation_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_annotation_spec_rest_unset_required_fields(): @@ -9733,7 +9715,7 @@ def test_create_model_rest_required_fields(request_type=service.CreateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -9924,7 +9906,7 @@ def test_get_model_rest_required_fields(request_type=service.GetModelRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -10107,7 +10089,7 @@ def test_list_models_rest_required_fields(request_type=service.ListModelsRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -10353,7 +10335,7 @@ def test_delete_model_rest_required_fields(request_type=service.DeleteModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -10524,7 +10506,7 @@ def test_update_model_rest_required_fields(request_type=service.UpdateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_model_rest_unset_required_fields(): @@ -10722,7 +10704,7 @@ def test_deploy_model_rest_required_fields(request_type=service.DeployModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_model_rest_unset_required_fields(): @@ -10898,7 +10880,7 @@ def test_undeploy_model_rest_required_fields(request_type=service.UndeployModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_model_rest_unset_required_fields(): @@ -11074,7 +11056,7 @@ def test_export_model_rest_required_fields(request_type=service.ExportModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_model_rest_unset_required_fields(): @@ -11272,7 +11254,7 @@ def test_get_model_evaluation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_evaluation_rest_unset_required_fields(): @@ -11478,7 +11460,7 @@ def test_list_model_evaluations_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_model_evaluations_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py index 604b4a7e6d94..150a650704b4 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2210,7 +2204,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): @@ -2406,7 +2400,7 @@ def test_batch_predict_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py index 17adbaf502f2..bfdfcb0279fc 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2491,11 +2485,7 @@ async def test_list_datasets_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_datasets(request={}) - ).pages: + async for page_ in (await client.list_datasets(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5098,11 +5088,7 @@ async def test_list_table_specs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_table_specs(request={}) - ).pages: + async for page_ in (await client.list_table_specs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6329,11 +6315,7 @@ async def test_list_column_specs_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_column_specs(request={}) - ).pages: + async for page_ in (await client.list_column_specs(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7885,11 +7867,7 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_models(request={}) - ).pages: + async for page_ in (await client.list_models(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10504,11 +10482,7 @@ async def test_list_model_evaluations_async_pages(): RuntimeError, ) pages = [] - # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` - # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 - async for page_ in ( # pragma: no branch - await client.list_model_evaluations(request={}) - ).pages: + async for page_ in (await client.list_model_evaluations(request={})).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10621,7 +10595,7 @@ def test_create_dataset_rest_required_fields(request_type=service.CreateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_dataset_rest_unset_required_fields(): @@ -10815,7 +10789,7 @@ def test_get_dataset_rest_required_fields(request_type=service.GetDatasetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_dataset_rest_unset_required_fields(): @@ -10999,7 +10973,7 @@ def test_list_datasets_rest_required_fields(request_type=service.ListDatasetsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_datasets_rest_unset_required_fields(): @@ -11243,7 +11217,7 @@ def test_update_dataset_rest_required_fields(request_type=service.UpdateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_dataset_rest_unset_required_fields(): @@ -11430,7 +11404,7 @@ def test_delete_dataset_rest_required_fields(request_type=service.DeleteDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_dataset_rest_unset_required_fields(): @@ -11606,7 +11580,7 @@ def test_import_data_rest_required_fields(request_type=service.ImportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_import_data_rest_unset_required_fields(): @@ -11796,7 +11770,7 @@ def test_export_data_rest_required_fields(request_type=service.ExportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_data_rest_unset_required_fields(): @@ -11994,7 +11968,7 @@ def test_get_annotation_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_annotation_spec_rest_unset_required_fields(): @@ -12174,7 +12148,7 @@ def test_get_table_spec_rest_required_fields(request_type=service.GetTableSpecRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_table_spec_rest_unset_required_fields(): @@ -12365,7 +12339,7 @@ def test_list_table_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_table_specs_rest_unset_required_fields(): @@ -12618,7 +12592,7 @@ def test_update_table_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_table_spec_rest_unset_required_fields(): @@ -12802,7 +12776,7 @@ def test_get_column_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_column_spec_rest_unset_required_fields(): @@ -12993,7 +12967,7 @@ def test_list_column_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_column_specs_rest_unset_required_fields(): @@ -13248,7 +13222,7 @@ def test_update_column_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_update_column_spec_rest_unset_required_fields(): @@ -13430,7 +13404,7 @@ def test_create_model_rest_required_fields(request_type=service.CreateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_create_model_rest_unset_required_fields(): @@ -13622,7 +13596,7 @@ def test_get_model_rest_required_fields(request_type=service.GetModelRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_rest_unset_required_fields(): @@ -13806,7 +13780,7 @@ def test_list_models_rest_required_fields(request_type=service.ListModelsRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_models_rest_unset_required_fields(): @@ -14053,7 +14027,7 @@ def test_delete_model_rest_required_fields(request_type=service.DeleteModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_delete_model_rest_unset_required_fields(): @@ -14229,7 +14203,7 @@ def test_deploy_model_rest_required_fields(request_type=service.DeployModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_deploy_model_rest_unset_required_fields(): @@ -14405,7 +14379,7 @@ def test_undeploy_model_rest_required_fields(request_type=service.UndeployModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_undeploy_model_rest_unset_required_fields(): @@ -14581,7 +14555,7 @@ def test_export_model_rest_required_fields(request_type=service.ExportModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_model_rest_unset_required_fields(): @@ -14782,7 +14756,7 @@ def test_export_evaluated_examples_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_export_evaluated_examples_rest_unset_required_fields(): @@ -14980,7 +14954,7 @@ def test_get_model_evaluation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_get_model_evaluation_rest_unset_required_fields(): @@ -15173,7 +15147,7 @@ def test_list_model_evaluations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_list_model_evaluations_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py index 5761dae4fe1f..82e3197ef322 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2025 Google LLC +# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,18 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os - -# try/except added for compatibility with python < 3.8 -try: - from unittest import mock - from unittest.mock import AsyncMock # pragma: NO COVER -except ImportError: # pragma: NO COVER - import mock - import json import math +import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence +from unittest import mock +from unittest.mock import AsyncMock import grpc import pytest @@ -2211,7 +2205,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_predict_rest_unset_required_fields(): @@ -2407,7 +2401,7 @@ def test_batch_predict_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert expected_params == actual_params + assert sorted(expected_params) == sorted(actual_params) def test_batch_predict_rest_unset_required_fields(): From b360431d2bd4513c840b3946de36e651f2bfa002 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 14 May 2026 06:45:37 +0000 Subject: [PATCH 2/2] chore: revert asset and automl changes We will fix these separately. --- packages/google-cloud-asset/docs/conf.py | 4 +- .../google/cloud/asset_v1/__init__.py | 25 ++++- .../services/asset_service/async_client.py | 10 +- .../google/cloud/asset_v1p1beta1/__init__.py | 25 ++++- .../google/cloud/asset_v1p2beta1/__init__.py | 25 ++++- .../google/cloud/asset_v1p5beta1/__init__.py | 25 ++++- packages/google-cloud-asset/noxfile.py | 4 +- ...ce_analyze_iam_policy_longrunning_async.py | 6 +- ...rated_asset_service_export_assets_async.py | 6 +- packages/google-cloud-asset/setup.py | 12 ++- .../testing/constraints-3.10.txt | 27 +++-- .../testing/constraints-3.9.txt | 17 ++++ .../unit/gapic/asset_v1/test_asset_service.py | 98 ++++++++++++------- .../asset_v1p1beta1/test_asset_service.py | 30 ++++-- .../asset_v1p2beta1/test_asset_service.py | 24 +++-- .../asset_v1p5beta1/test_asset_service.py | 22 +++-- packages/google-cloud-automl/docs/conf.py | 4 +- .../google/cloud/automl_v1/__init__.py | 25 ++++- .../services/auto_ml/async_client.py | 38 +++---- .../prediction_service/async_client.py | 6 +- .../google/cloud/automl_v1/types/io.py | 71 +++++--------- .../google/cloud/automl_v1beta1/__init__.py | 25 ++++- .../services/auto_ml/async_client.py | 38 +++---- .../prediction_service/async_client.py | 6 +- packages/google-cloud-automl/noxfile.py | 4 +- ..._generated_auto_ml_create_dataset_async.py | 6 +- ...v1_generated_auto_ml_create_model_async.py | 6 +- ..._generated_auto_ml_delete_dataset_async.py | 6 +- ...v1_generated_auto_ml_delete_model_async.py | 6 +- ...v1_generated_auto_ml_deploy_model_async.py | 6 +- ..._v1_generated_auto_ml_export_data_async.py | 6 +- ...v1_generated_auto_ml_export_model_async.py | 6 +- ..._v1_generated_auto_ml_import_data_async.py | 6 +- ..._generated_auto_ml_undeploy_model_async.py | 6 +- ..._prediction_service_batch_predict_async.py | 6 +- ...a1_generated_auto_ml_create_model_async.py | 6 +- ..._generated_auto_ml_delete_dataset_async.py | 6 +- ...a1_generated_auto_ml_delete_model_async.py | 6 +- ...a1_generated_auto_ml_deploy_model_async.py | 6 +- ...ta1_generated_auto_ml_export_data_async.py | 6 +- ...auto_ml_export_evaluated_examples_async.py | 6 +- ...a1_generated_auto_ml_export_model_async.py | 6 +- ...ta1_generated_auto_ml_import_data_async.py | 6 +- ..._generated_auto_ml_undeploy_model_async.py | 6 +- ..._prediction_service_batch_predict_async.py | 6 +- packages/google-cloud-automl/setup.py | 11 ++- .../testing/constraints-3.10.txt | 21 ++-- .../testing/constraints-3.9.txt | 18 ++++ .../unit/gapic/automl_v1/test_auto_ml.py | 68 ++++++++----- .../automl_v1/test_prediction_service.py | 18 ++-- .../unit/gapic/automl_v1beta1/test_auto_ml.py | 92 ++++++++++------- .../automl_v1beta1/test_prediction_service.py | 18 ++-- 52 files changed, 589 insertions(+), 354 deletions(-) create mode 100644 packages/google-cloud-asset/testing/constraints-3.9.txt create mode 100644 packages/google-cloud-automl/testing/constraints-3.9.txt diff --git a/packages/google-cloud-asset/docs/conf.py b/packages/google-cloud-asset/docs/conf.py index 503fa88d531e..c71b29074de6 100644 --- a/packages/google-cloud-asset/docs/conf.py +++ b/packages/google-cloud-asset/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-asset" -copyright = "2026, Google, LLC" +copyright = "2025, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py index 9d80550b47d0..b3d2b7bb144c 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,13 @@ __version__ = package_version.__version__ -from importlib import metadata +if sys.version_info >= (3, 8): # pragma: NO COVER + from importlib import metadata +else: # pragma: NO COVER + # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove + # this code path once we drop support for Python 3.7 + import importlib_metadata as metadata + from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_enrichment_resourceowners import ResourceOwners @@ -119,17 +125,28 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: + import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1" - if sys.version_info < (3, 10): + if sys.version_info < (3, 9): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.10, and then update {_package_label}.", + + f"least to Python 3.9, and then update {_package_label}.", + FutureWarning, + ) + if sys.version_info[:2] == (3, 9): + warnings.warn( + f"You are using a Python version ({_py_version_str}) " + + f"which Google will stop supporting in {_package_label} in " + + "January 2026. Please " + + "upgrade to the latest Python version, or at " + + "least to Python 3.10, before then, and " + + f"then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py index f62ea2258cd3..c0fa1b310438 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1/services/asset_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -358,11 +358,11 @@ async def sample_export_assets(): ) # Make the request - operation = await client.export_assets(request=request) + operation = client.export_assets(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1849,11 +1849,11 @@ async def sample_analyze_iam_policy_longrunning(): ) # Make the request - operation = await client.analyze_iam_policy_longrunning(request=request) + operation = client.analyze_iam_policy_longrunning(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py index d3091091d399..ebce73f7e3cc 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,13 @@ __version__ = package_version.__version__ -from importlib import metadata +if sys.version_info >= (3, 8): # pragma: NO COVER + from importlib import metadata +else: # pragma: NO COVER + # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove + # this code path once we drop support for Python 3.7 + import importlib_metadata as metadata + from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_service import ( @@ -41,17 +47,28 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: + import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1p1beta1" - if sys.version_info < (3, 10): + if sys.version_info < (3, 9): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.10, and then update {_package_label}.", + + f"least to Python 3.9, and then update {_package_label}.", + FutureWarning, + ) + if sys.version_info[:2] == (3, 9): + warnings.warn( + f"You are using a Python version ({_py_version_str}) " + + f"which Google will stop supporting in {_package_label} in " + + "January 2026. Please " + + "upgrade to the latest Python version, or at " + + "least to Python 3.10, before then, and " + + f"then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py index d1ce85f9cf46..a80a31de72b9 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p2beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,13 @@ __version__ = package_version.__version__ -from importlib import metadata +if sys.version_info >= (3, 8): # pragma: NO COVER + from importlib import metadata +else: # pragma: NO COVER + # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove + # this code path once we drop support for Python 3.7 + import importlib_metadata as metadata + from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_service import ( @@ -51,17 +57,28 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: + import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1p2beta1" - if sys.version_info < (3, 10): + if sys.version_info < (3, 9): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.10, and then update {_package_label}.", + + f"least to Python 3.9, and then update {_package_label}.", + FutureWarning, + ) + if sys.version_info[:2] == (3, 9): + warnings.warn( + f"You are using a Python version ({_py_version_str}) " + + f"which Google will stop supporting in {_package_label} in " + + "January 2026. Please " + + "upgrade to the latest Python version, or at " + + "least to Python 3.10, before then, and " + + f"then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py index 1769e4ec28d0..07ae62e4452e 100644 --- a/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py +++ b/packages/google-cloud-asset/google/cloud/asset_v1p5beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,13 @@ __version__ = package_version.__version__ -from importlib import metadata +if sys.version_info >= (3, 8): # pragma: NO COVER + from importlib import metadata +else: # pragma: NO COVER + # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove + # this code path once we drop support for Python 3.7 + import importlib_metadata as metadata + from .services.asset_service import AssetServiceAsyncClient, AssetServiceClient from .types.asset_service import ContentType, ListAssetsRequest, ListAssetsResponse @@ -36,17 +42,28 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: + import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.asset_v1p5beta1" - if sys.version_info < (3, 10): + if sys.version_info < (3, 9): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.10, and then update {_package_label}.", + + f"least to Python 3.9, and then update {_package_label}.", + FutureWarning, + ) + if sys.version_info[:2] == (3, 9): + warnings.warn( + f"You are using a Python version ({_py_version_str}) " + + f"which Google will stop supporting in {_package_label} in " + + "January 2026. Please " + + "upgrade to the latest Python version, or at " + + "least to Python 3.10, before then, and " + + f"then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-asset/noxfile.py b/packages/google-cloud-asset/noxfile.py index c722b562a341..49b300da7f17 100644 --- a/packages/google-cloud-asset/noxfile.py +++ b/packages/google-cloud-asset/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ + "3.9", "3.10", "3.11", "3.12", @@ -389,6 +390,7 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", + "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py index 82fd501ea819..05ba0fdb2424 100644 --- a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,11 +51,11 @@ async def sample_analyze_iam_policy_longrunning(): ) # Make the request - operation = await client.analyze_iam_policy_longrunning(request=request) + operation = client.analyze_iam_policy_longrunning(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py index 628d9c50000a..69eb824d4f58 100644 --- a/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py +++ b/packages/google-cloud-asset/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_assets(): ) # Make the request - operation = await client.export_assets(request=request) + operation = client.export_assets(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-asset/setup.py b/packages/google-cloud-asset/setup.py index 68814f2ad096..a3b454d7e383 100644 --- a/packages/google-cloud-asset/setup.py +++ b/packages/google-cloud-asset/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,12 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.17.1, <3.0.0", + "google-api-core[grpc] >= 2.11.0, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.44.0, < 2.0.0", + "google-cloud-org-policy >= 1.11.1, <2.0.0", + "grpcio >= 1.33.2, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -74,7 +75,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache-2.0", + license="Apache 2.0", url=url, classifiers=[ release_status, @@ -82,6 +83,7 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -92,7 +94,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.10", + python_requires=">=3.9", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-asset/testing/constraints-3.10.txt b/packages/google-cloud-asset/testing/constraints-3.10.txt index 88ca48cac49d..c5602c5029bf 100644 --- a/packages/google-cloud-asset/testing/constraints-3.10.txt +++ b/packages/google-cloud-asset/testing/constraints-3.10.txt @@ -1,14 +1,13 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.17.1 -google-auth==2.14.1 -grpcio==1.44.0 -proto-plus==1.22.3 -protobuf==4.25.8 -google-cloud-access-context-manager==0.2.0 -google-cloud-os-config==1.13.0 -grpc-google-iam-v1==0.14.0 +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +google-auth +grpcio +proto-plus +protobuf +# cryptography is a direct dependency of google-auth +cryptography +google-cloud-access-context-manager +google-cloud-os-config +grpc-google-iam-v1 diff --git a/packages/google-cloud-asset/testing/constraints-3.9.txt b/packages/google-cloud-asset/testing/constraints-3.9.txt new file mode 100644 index 000000000000..d27d02e77dae --- /dev/null +++ b/packages/google-cloud-asset/testing/constraints-3.9.txt @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.21.0 +google-cloud-org-policy==1.11.1 +google-auth==2.35.0 +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) +# Add the minimum supported version of grpcio to constraints files +proto-plus==1.22.3 +protobuf==4.25.8 +google-cloud-access-context-manager==0.2.0 +google-cloud-os-config==1.13.0 +grpc-google-iam-v1==0.14.0 diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py index 2e516c73227d..add96e33c80a 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -2048,7 +2054,11 @@ async def test_list_assets_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_assets(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_assets(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4492,7 +4502,11 @@ async def test_search_all_resources_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_all_resources(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.search_all_resources(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5049,7 +5063,11 @@ async def test_search_all_iam_policies_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_all_iam_policies(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.search_all_iam_policies(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7306,7 +7324,11 @@ async def test_list_saved_queries_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_saved_queries(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_saved_queries(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8817,7 +8839,11 @@ async def test_analyze_org_policies_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.analyze_org_policies(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.analyze_org_policies(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -9398,7 +9424,9 @@ async def test_analyze_org_policy_governed_containers_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.analyze_org_policy_governed_containers(request={}) ).pages: pages.append(page_) @@ -9979,7 +10007,9 @@ async def test_analyze_org_policy_governed_assets_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.analyze_org_policy_governed_assets(request={}) ).pages: pages.append(page_) @@ -10097,7 +10127,7 @@ def test_export_assets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_export_assets_rest_unset_required_fields(): @@ -10234,7 +10264,7 @@ def test_list_assets_rest_required_fields(request_type=asset_service.ListAssetsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_assets_rest_unset_required_fields(): @@ -10497,7 +10527,7 @@ def test_batch_get_assets_history_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_batch_get_assets_history_rest_unset_required_fields(): @@ -10630,7 +10660,7 @@ def test_create_feed_rest_required_fields(request_type=asset_service.CreateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_feed_rest_unset_required_fields(): @@ -10813,7 +10843,7 @@ def test_get_feed_rest_required_fields(request_type=asset_service.GetFeedRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_feed_rest_unset_required_fields(): @@ -10987,7 +11017,7 @@ def test_list_feeds_rest_required_fields(request_type=asset_service.ListFeedsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_feeds_rest_unset_required_fields(): @@ -11157,7 +11187,7 @@ def test_update_feed_rest_required_fields(request_type=asset_service.UpdateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_feed_rest_unset_required_fields(): @@ -11336,7 +11366,7 @@ def test_delete_feed_rest_required_fields(request_type=asset_service.DeleteFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_feed_rest_unset_required_fields(): @@ -11525,7 +11555,7 @@ def test_search_all_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_search_all_resources_rest_unset_required_fields(): @@ -11795,7 +11825,7 @@ def test_search_all_iam_policies_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_search_all_iam_policies_rest_unset_required_fields(): @@ -12054,7 +12084,7 @@ def test_analyze_iam_policy_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_analyze_iam_policy_rest_unset_required_fields(): @@ -12185,7 +12215,7 @@ def test_analyze_iam_policy_longrunning_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_analyze_iam_policy_longrunning_rest_unset_required_fields(): @@ -12335,7 +12365,7 @@ def test_analyze_move_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_analyze_move_rest_unset_required_fields(): @@ -12469,7 +12499,7 @@ def test_query_assets_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_query_assets_rest_unset_required_fields(): @@ -12609,7 +12639,7 @@ def test_create_saved_query_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_saved_query_rest_unset_required_fields(): @@ -12798,7 +12828,7 @@ def test_get_saved_query_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_saved_query_rest_unset_required_fields(): @@ -12986,7 +13016,7 @@ def test_list_saved_queries_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_saved_queries_rest_unset_required_fields(): @@ -13236,7 +13266,7 @@ def test_update_saved_query_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_saved_query_rest_unset_required_fields(): @@ -13426,7 +13456,7 @@ def test_delete_saved_query_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_saved_query_rest_unset_required_fields(): @@ -13622,7 +13652,7 @@ def test_batch_get_effective_iam_policies_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_batch_get_effective_iam_policies_rest_unset_required_fields(): @@ -13778,7 +13808,7 @@ def test_analyze_org_policies_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_analyze_org_policies_rest_unset_required_fields(): @@ -14072,7 +14102,7 @@ def test_analyze_org_policy_governed_containers_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_analyze_org_policy_governed_containers_rest_unset_required_fields(): @@ -14376,7 +14406,7 @@ def test_analyze_org_policy_governed_assets_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_analyze_org_policy_governed_assets_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py index 0c9158568eee..b2427cfef025 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -1845,7 +1851,11 @@ async def test_search_all_resources_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_all_resources(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.search_all_resources(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2400,7 +2410,11 @@ async def test_search_all_iam_policies_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.search_all_iam_policies(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.search_all_iam_policies(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2528,7 +2542,7 @@ def test_search_all_resources_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_search_all_resources_rest_unset_required_fields(): @@ -2796,7 +2810,7 @@ def test_search_all_iam_policies_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_search_all_iam_policies_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py index 2d5176fb8e92..e11fc60b0f25 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -3011,7 +3017,7 @@ def test_create_feed_rest_required_fields(request_type=asset_service.CreateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_feed_rest_unset_required_fields(): @@ -3194,7 +3200,7 @@ def test_get_feed_rest_required_fields(request_type=asset_service.GetFeedRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_feed_rest_unset_required_fields(): @@ -3368,7 +3374,7 @@ def test_list_feeds_rest_required_fields(request_type=asset_service.ListFeedsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_feeds_rest_unset_required_fields(): @@ -3538,7 +3544,7 @@ def test_update_feed_rest_required_fields(request_type=asset_service.UpdateFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_feed_rest_unset_required_fields(): @@ -3717,7 +3723,7 @@ def test_delete_feed_rest_required_fields(request_type=asset_service.DeleteFeedR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_feed_rest_unset_required_fields(): diff --git a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py index c7ade516bbc5..ba3040327f6d 100644 --- a/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py +++ b/packages/google-cloud-asset/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -1795,7 +1801,11 @@ async def test_list_assets_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_assets(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_assets(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1917,7 +1927,7 @@ def test_list_assets_rest_required_fields(request_type=asset_service.ListAssetsR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_assets_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/docs/conf.py b/packages/google-cloud-automl/docs/conf.py index 05a107396697..e6d0f2d68e42 100644 --- a/packages/google-cloud-automl/docs/conf.py +++ b/packages/google-cloud-automl/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,7 +83,7 @@ # General information about the project. project = "google-cloud-automl" -copyright = "2026, Google, LLC" +copyright = "2025, Google, LLC" author = "Google APIs" # The version info for the project you're documenting, acts as replacement for diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py b/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py index 60d64076048b..2968bc863430 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,13 @@ __version__ = package_version.__version__ -from importlib import metadata +if sys.version_info >= (3, 8): # pragma: NO COVER + from importlib import metadata +else: # pragma: NO COVER + # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove + # this code path once we drop support for Python 3.7 + import importlib_metadata as metadata + from .services.auto_ml import AutoMlAsyncClient, AutoMlClient from .services.prediction_service import ( @@ -143,17 +149,28 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: + import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.automl_v1" - if sys.version_info < (3, 10): + if sys.version_info < (3, 9): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.10, and then update {_package_label}.", + + f"least to Python 3.9, and then update {_package_label}.", + FutureWarning, + ) + if sys.version_info[:2] == (3, 9): + warnings.warn( + f"You are using a Python version ({_py_version_str}) " + + f"which Google will stop supporting in {_package_label} in " + + "January 2026. Please " + + "upgrade to the latest Python version, or at " + + "least to Python 3.10, before then, and " + + f"then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py index a223d25a04a4..a1e1e4366cce 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/services/auto_ml/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -365,11 +365,11 @@ async def sample_create_dataset(): ) # Make the request - operation = await client.create_dataset(request=request) + operation = client.create_dataset(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -869,11 +869,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = await client.delete_dataset(request=request) + operation = client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1016,11 +1016,11 @@ async def sample_import_data(): ) # Make the request - operation = await client.import_data(request=request) + operation = client.import_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1168,11 +1168,11 @@ async def sample_export_data(): ) # Make the request - operation = await client.export_data(request=request) + operation = client.export_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1424,11 +1424,11 @@ async def sample_create_model(): ) # Make the request - operation = await client.create_model(request=request) + operation = client.create_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1796,11 +1796,11 @@ async def sample_delete_model(): ) # Make the request - operation = await client.delete_model(request=request) + operation = client.delete_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2064,11 +2064,11 @@ async def sample_deploy_model(): ) # Make the request - operation = await client.deploy_model(request=request) + operation = client.deploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2205,11 +2205,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = await client.undeploy_model(request=request) + operation = client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2350,11 +2350,11 @@ async def sample_export_model(): ) # Make the request - operation = await client.export_model(request=request) + operation = client.export_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py index 881cdbaf08f2..565550a1576d 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/services/prediction_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -570,11 +570,11 @@ async def sample_batch_predict(): ) # Make the request - operation = await client.batch_predict(request=request) + operation = client.batch_predict(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py b/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py index 41262d1beb31..26ec3699d57b 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1/types/io.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,11 +55,9 @@ class InputConfig(proto.Message): with non-terminal symbols defined near the end of this comment. The formats are: - AutoML Vision - ^^^^^^^^^^^^^ + AutoML Vision: - Classification - '''''''''''''' + Classification: See `Preparing your training data `__ for @@ -100,8 +98,7 @@ class InputConfig(proto.Message): UNASSIGNED,gs://folder/image3.jpg,daisy UNASSIGNED,gs://folder/image4.jpg - Object Detection - '''''''''''''''' + Object Detection: See `Preparing your training data `__ @@ -151,11 +148,9 @@ class InputConfig(proto.Message): - AutoML Video Intelligence - ^^^^^^^^^^^^^^^^^^^^^^^^^ + AutoML Video Intelligence: - Classification - '''''''''''''' + Classification: See `Preparing your training data `__ @@ -205,8 +200,7 @@ class InputConfig(proto.Message): gs://folder/vid2.avi,car,0,60.5 gs://folder/vid3.avi,,, - Object Tracking - ''''''''''''''' + Object Tracking: See `Preparing your training data `__ @@ -269,11 +263,9 @@ class InputConfig(proto.Message): gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,, gs://folder/video2.avi,,,,,,,,,,, - AutoML Natural Language - ^^^^^^^^^^^^^^^^^^^^^^^ + AutoML Natural Language: - Entity Extraction - ''''''''''''''''' + Entity Extraction: See `Preparing your training data `__ for @@ -467,8 +459,7 @@ class InputConfig(proto.Message): }, ], - Classification - '''''''''''''' + Classification: See `Preparing your training data `__ @@ -520,8 +511,7 @@ class InputConfig(proto.Message): TEST,gs://folder/document.pdf VALIDATE,gs://folder/text_files.zip,BadFood - Sentiment Analysis - '''''''''''''''''' + Sentiment Analysis: See `Preparing your training data `__ @@ -584,8 +574,7 @@ class InputConfig(proto.Message): TEST,gs://folder/document.pdf VALIDATE,gs://folder/text_files.zip,2 - AutoML Tables - ^^^^^^^^^^^^^ + AutoML Tables: See `Preparing your training data `__ for @@ -702,8 +691,7 @@ class InputConfig(proto.Message): semantic of the imported data, any string must be up to 25000 characters long. - AutoML Tables - ^^^^^^^^^^^^^ + AutoML Tables: ``schema_inference_version`` : (integer) This value must be supplied. The version of the algorithm to use for the @@ -736,11 +724,9 @@ class BatchPredictInputConfig(proto.Message): with non-terminal symbols defined near the end of this comment. The formats are: - AutoML Vision - ^^^^^^^^^^^^^ + AutoML Vision: - Classification - '''''''''''''' + Classification: One or more CSV files where each line is a single column: @@ -760,8 +746,7 @@ class BatchPredictInputConfig(proto.Message): gs://folder/image2.gif gs://folder/image3.png - Object Detection - '''''''''''''''' + Object Detection: One or more CSV files where each line is a single column: @@ -781,11 +766,9 @@ class BatchPredictInputConfig(proto.Message): gs://folder/image2.gif gs://folder/image3.png - AutoML Video Intelligence - ^^^^^^^^^^^^^^^^^^^^^^^^^ + AutoML Video Intelligence: - Classification - '''''''''''''' + Classification: One or more CSV files where each line is a single column: @@ -808,8 +791,7 @@ class BatchPredictInputConfig(proto.Message): gs://folder/video1.mp4,20,60 gs://folder/vid2.mov,0,inf - Object Tracking - ''''''''''''''' + Object Tracking: One or more CSV files where each line is a single column: @@ -832,11 +814,9 @@ class BatchPredictInputConfig(proto.Message): gs://folder/video1.mp4,20,60 gs://folder/vid2.mov,0,inf - AutoML Natural Language - ^^^^^^^^^^^^^^^^^^^^^^^ + AutoML Natural Language: - Classification - '''''''''''''' + Classification: One or more CSV files where each line is a single column: @@ -857,8 +837,7 @@ class BatchPredictInputConfig(proto.Message): gs://folder/text2.pdf gs://folder/text3.tif - Sentiment Analysis - '''''''''''''''''' + Sentiment Analysis: One or more CSV files where each line is a single column: @@ -879,8 +858,7 @@ class BatchPredictInputConfig(proto.Message): gs://folder/text2.pdf gs://folder/text3.tif - Entity Extraction - ''''''''''''''''' + Entity Extraction: One or more JSONL (JSON Lines) files that either provide inline text or documents. You can only use one format, either inline text or @@ -955,8 +933,7 @@ class BatchPredictInputConfig(proto.Message): } } - AutoML Tables - ^^^^^^^^^^^^^ + AutoML Tables: See `Preparing your training data `__ diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py index 07baf5afcb7c..310edefc5778 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +21,13 @@ __version__ = package_version.__version__ -from importlib import metadata +if sys.version_info >= (3, 8): # pragma: NO COVER + from importlib import metadata +else: # pragma: NO COVER + # TODO(https://github.com/googleapis/python-api-core/issues/835): Remove + # this code path once we drop support for Python 3.7 + import importlib_metadata as metadata + from .services.auto_ml import AutoMlAsyncClient, AutoMlClient from .services.prediction_service import ( @@ -189,17 +195,28 @@ # An older version of api_core is installed which does not define the # functions above. We do equivalent checks manually. try: + import sys import warnings _py_version_str = sys.version.split()[0] _package_label = "google.cloud.automl_v1beta1" - if sys.version_info < (3, 10): + if sys.version_info < (3, 9): warnings.warn( "You are using a non-supported Python version " + f"({_py_version_str}). Google will not post any further " + f"updates to {_package_label} supporting this Python version. " + "Please upgrade to the latest Python version, or at " - + f"least to Python 3.10, and then update {_package_label}.", + + f"least to Python 3.9, and then update {_package_label}.", + FutureWarning, + ) + if sys.version_info[:2] == (3, 9): + warnings.warn( + f"You are using a Python version ({_py_version_str}) " + + f"which Google will stop supporting in {_package_label} in " + + "January 2026. Please " + + "upgrade to the latest Python version, or at " + + "least to Python 3.10, before then, and " + + f"then update {_package_label}.", FutureWarning, ) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py index 340116618550..bbc60a196714 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/auto_ml/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -859,11 +859,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = await client.delete_dataset(request=request) + operation = client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1002,11 +1002,11 @@ async def sample_import_data(): ) # Make the request - operation = await client.import_data(request=request) + operation = client.import_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -1150,11 +1150,11 @@ async def sample_export_data(): ) # Make the request - operation = await client.export_data(request=request) + operation = client.export_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2120,11 +2120,11 @@ async def sample_create_model(): ) # Make the request - operation = await client.create_model(request=request) + operation = client.create_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2492,11 +2492,11 @@ async def sample_delete_model(): ) # Make the request - operation = await client.delete_model(request=request) + operation = client.delete_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2639,11 +2639,11 @@ async def sample_deploy_model(): ) # Make the request - operation = await client.deploy_model(request=request) + operation = client.deploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2780,11 +2780,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = await client.undeploy_model(request=request) + operation = client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -2922,11 +2922,11 @@ async def sample_export_model(): ) # Make the request - operation = await client.export_model(request=request) + operation = client.export_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) @@ -3081,11 +3081,11 @@ async def sample_export_evaluated_examples(): ) # Make the request - operation = await client.export_evaluated_examples(request=request) + operation = client.export_evaluated_examples(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py index 48806d2da5aa..1b7f0dc86888 100644 --- a/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py +++ b/packages/google-cloud-automl/google/cloud/automl_v1beta1/services/prediction_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -536,11 +536,11 @@ async def sample_batch_predict(): ) # Make the request - operation = await client.batch_predict(request=request) + operation = client.batch_predict(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/noxfile.py b/packages/google-cloud-automl/noxfile.py index aa307e6f99c4..4e126e3abe91 100644 --- a/packages/google-cloud-automl/noxfile.py +++ b/packages/google-cloud-automl/noxfile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ LINT_PATHS.append("samples") ALL_PYTHON = [ + "3.9", "3.10", "3.11", "3.12", @@ -390,6 +391,7 @@ def docs(session): shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( "sphinx-build", + "-W", # warnings as errors "-T", # show full traceback on exception "-N", # no colors "-b", diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py index e39d2a112f0a..ebdce3d3ca7e 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +53,11 @@ async def sample_create_dataset(): ) # Make the request - operation = await client.create_dataset(request=request) + operation = client.create_dataset(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py index 7f3576f0ca4f..3f05c7b83e4d 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_create_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_model(): ) # Make the request - operation = await client.create_model(request=request) + operation = client.create_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py index bf73628b9b51..4f79dbb43392 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = await client.delete_dataset(request=request) + operation = client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py index 6ec9f3a4a899..994476f3e411 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_delete_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_model(): ) # Make the request - operation = await client.delete_model(request=request) + operation = client.delete_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py index 70df9ca4f525..2b6aa5e36da0 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_deploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_deploy_model(): ) # Make the request - operation = await client.deploy_model(request=request) + operation = client.deploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py index 823afa076c57..eda683a06cd8 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_data(): ) # Make the request - operation = await client.export_data(request=request) + operation = client.export_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py index 96c993fe4da2..babad52490b0 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_export_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_export_model(): ) # Make the request - operation = await client.export_model(request=request) + operation = client.export_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py index ab0f9b6ffd0c..0df6eba7ab30 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_import_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,11 +48,11 @@ async def sample_import_data(): ) # Make the request - operation = await client.import_data(request=request) + operation = client.import_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py index 1e11c6ac8086..91b9a168f270 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_auto_ml_undeploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = await client.undeploy_model(request=request) + operation = client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py index 7d85d80ed7ab..5f19c4226683 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1_generated_prediction_service_batch_predict_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -52,11 +52,11 @@ async def sample_batch_predict(): ) # Make the request - operation = await client.batch_predict(request=request) + operation = client.batch_predict(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py index b4be09c5429a..76b87740d080 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_create_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_create_model(): ) # Make the request - operation = await client.create_model(request=request) + operation = client.create_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py index 91aec7607d10..a4c6e1d7ec82 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_dataset_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_dataset(): ) # Make the request - operation = await client.delete_dataset(request=request) + operation = client.delete_dataset(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py index bec81527b747..c98857b95be5 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_delete_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_delete_model(): ) # Make the request - operation = await client.delete_model(request=request) + operation = client.delete_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py index aa5c2f3ef761..f4de388af10e 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_deploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_deploy_model(): ) # Make the request - operation = await client.deploy_model(request=request) + operation = client.deploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py index 2c98e3d4e1d4..a30f6af27324 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_data(): ) # Make the request - operation = await client.export_data(request=request) + operation = client.export_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py index 7ed13eb71741..b970f50ac5be 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_evaluated_examples_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_evaluated_examples(): ) # Make the request - operation = await client.export_evaluated_examples(request=request) + operation = client.export_evaluated_examples(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py index d95878ad49ec..65ee458d4dd8 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_export_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_export_model(): ) # Make the request - operation = await client.export_model(request=request) + operation = client.export_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py index 23c576be2c00..e28851a3899e 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_import_data_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_import_data(): ) # Make the request - operation = await client.import_data(request=request) + operation = client.import_data(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py index df2160110cfe..131f7e327dcf 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_auto_ml_undeploy_model_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_undeploy_model(): ) # Make the request - operation = await client.undeploy_model(request=request) + operation = client.undeploy_model(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py index b7af37fbd6e3..18600baf725f 100644 --- a/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py +++ b/packages/google-cloud-automl/samples/generated_samples/automl_v1beta1_generated_prediction_service_batch_predict_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,11 +44,11 @@ async def sample_batch_predict(): ) # Make the request - operation = await client.batch_predict(request=request) + operation = client.batch_predict(request=request) print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/packages/google-cloud-automl/setup.py b/packages/google-cloud-automl/setup.py index 2ad42826fa4f..d92d1981fe09 100644 --- a/packages/google-cloud-automl/setup.py +++ b/packages/google-cloud-automl/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 2.17.1, <3.0.0", + "google-api-core[grpc] >= 2.11.0, <3.0.0", # Exclude incompatible versions of `google-auth` # See https://github.com/googleapis/google-cloud-python/issues/12364 "google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0", - "grpcio >= 1.44.0, < 2.0.0", + "grpcio >= 1.33.2, < 2.0.0", "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'", "proto-plus >= 1.22.3, <2.0.0", "proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'", @@ -76,7 +76,7 @@ long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", - license="Apache-2.0", + license="Apache 2.0", url=url, classifiers=[ release_status, @@ -84,6 +84,7 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -94,7 +95,7 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, - python_requires=">=3.10", + python_requires=">=3.9", install_requires=dependencies, extras_require=extras, include_package_data=True, diff --git a/packages/google-cloud-automl/testing/constraints-3.10.txt b/packages/google-cloud-automl/testing/constraints-3.10.txt index bac7ba85b4ee..7599dea499ed 100644 --- a/packages/google-cloud-automl/testing/constraints-3.10.txt +++ b/packages/google-cloud-automl/testing/constraints-3.10.txt @@ -1,11 +1,10 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file, -# pinning their versions to their lower bounds. -# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", -# then this file should have google-cloud-foo==1.14.0 -google-api-core==2.17.1 -google-auth==2.14.1 -grpcio==1.44.0 -proto-plus==1.22.3 -protobuf==4.25.8 +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +google-auth +grpcio +proto-plus +protobuf +# cryptography is a direct dependency of google-auth +cryptography diff --git a/packages/google-cloud-automl/testing/constraints-3.9.txt b/packages/google-cloud-automl/testing/constraints-3.9.txt new file mode 100644 index 000000000000..60e67851a5fa --- /dev/null +++ b/packages/google-cloud-automl/testing/constraints-3.9.txt @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file, +# pinning their versions to their lower bounds. +# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", +# then this file should have google-cloud-foo==1.14.0 +google-api-core==2.21.0 +google-cloud-storage==2.14.0 +libcst==0.2.5 +pandas==1.1.3 +# numpy is a dependency of pandas +numpy==1.19.3 +google-auth==2.35.0 +# TODO(https://github.com/googleapis/gapic-generator-python/issues/2453) +# Add the minimum supported version of grpcio to constraints files +proto-plus==1.22.3 +protobuf==4.25.8 diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py index 879cab860a75..85020d51d6c8 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_auto_ml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -2468,7 +2474,11 @@ async def test_list_datasets_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_datasets(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_datasets(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5430,7 +5440,11 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_models(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_models(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8044,7 +8058,11 @@ async def test_list_model_evaluations_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_model_evaluations(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_model_evaluations(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -8158,7 +8176,7 @@ def test_create_dataset_rest_required_fields(request_type=service.CreateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_dataset_rest_unset_required_fields(): @@ -8349,7 +8367,7 @@ def test_get_dataset_rest_required_fields(request_type=service.GetDatasetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_dataset_rest_unset_required_fields(): @@ -8532,7 +8550,7 @@ def test_list_datasets_rest_required_fields(request_type=service.ListDatasetsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_datasets_rest_unset_required_fields(): @@ -8775,7 +8793,7 @@ def test_update_dataset_rest_required_fields(request_type=service.UpdateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_dataset_rest_unset_required_fields(): @@ -8972,7 +8990,7 @@ def test_delete_dataset_rest_required_fields(request_type=service.DeleteDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_dataset_rest_unset_required_fields(): @@ -9147,7 +9165,7 @@ def test_import_data_rest_required_fields(request_type=service.ImportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_import_data_rest_unset_required_fields(): @@ -9337,7 +9355,7 @@ def test_export_data_rest_required_fields(request_type=service.ExportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_export_data_rest_unset_required_fields(): @@ -9535,7 +9553,7 @@ def test_get_annotation_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_annotation_spec_rest_unset_required_fields(): @@ -9715,7 +9733,7 @@ def test_create_model_rest_required_fields(request_type=service.CreateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_model_rest_unset_required_fields(): @@ -9906,7 +9924,7 @@ def test_get_model_rest_required_fields(request_type=service.GetModelRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_model_rest_unset_required_fields(): @@ -10089,7 +10107,7 @@ def test_list_models_rest_required_fields(request_type=service.ListModelsRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_models_rest_unset_required_fields(): @@ -10335,7 +10353,7 @@ def test_delete_model_rest_required_fields(request_type=service.DeleteModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_model_rest_unset_required_fields(): @@ -10506,7 +10524,7 @@ def test_update_model_rest_required_fields(request_type=service.UpdateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_model_rest_unset_required_fields(): @@ -10704,7 +10722,7 @@ def test_deploy_model_rest_required_fields(request_type=service.DeployModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_deploy_model_rest_unset_required_fields(): @@ -10880,7 +10898,7 @@ def test_undeploy_model_rest_required_fields(request_type=service.UndeployModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_undeploy_model_rest_unset_required_fields(): @@ -11056,7 +11074,7 @@ def test_export_model_rest_required_fields(request_type=service.ExportModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_export_model_rest_unset_required_fields(): @@ -11254,7 +11272,7 @@ def test_get_model_evaluation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_model_evaluation_rest_unset_required_fields(): @@ -11460,7 +11478,7 @@ def test_list_model_evaluations_rest_required_fields( ("$alt", "json;enum-encoding=int"), ] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_model_evaluations_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py index 150a650704b4..604b4a7e6d94 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1/test_prediction_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -2204,7 +2210,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_predict_rest_unset_required_fields(): @@ -2400,7 +2406,7 @@ def test_batch_predict_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_batch_predict_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py index bfdfcb0279fc..17adbaf502f2 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_auto_ml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -2485,7 +2491,11 @@ async def test_list_datasets_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_datasets(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_datasets(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5088,7 +5098,11 @@ async def test_list_table_specs_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_table_specs(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_table_specs(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6315,7 +6329,11 @@ async def test_list_column_specs_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_column_specs(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_column_specs(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7867,7 +7885,11 @@ async def test_list_models_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_models(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_models(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10482,7 +10504,11 @@ async def test_list_model_evaluations_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_model_evaluations(request={})).pages: + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_model_evaluations(request={}) + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -10595,7 +10621,7 @@ def test_create_dataset_rest_required_fields(request_type=service.CreateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_dataset_rest_unset_required_fields(): @@ -10789,7 +10815,7 @@ def test_get_dataset_rest_required_fields(request_type=service.GetDatasetRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_dataset_rest_unset_required_fields(): @@ -10973,7 +10999,7 @@ def test_list_datasets_rest_required_fields(request_type=service.ListDatasetsReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_datasets_rest_unset_required_fields(): @@ -11217,7 +11243,7 @@ def test_update_dataset_rest_required_fields(request_type=service.UpdateDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_dataset_rest_unset_required_fields(): @@ -11404,7 +11430,7 @@ def test_delete_dataset_rest_required_fields(request_type=service.DeleteDatasetR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_dataset_rest_unset_required_fields(): @@ -11580,7 +11606,7 @@ def test_import_data_rest_required_fields(request_type=service.ImportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_import_data_rest_unset_required_fields(): @@ -11770,7 +11796,7 @@ def test_export_data_rest_required_fields(request_type=service.ExportDataRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_export_data_rest_unset_required_fields(): @@ -11968,7 +11994,7 @@ def test_get_annotation_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_annotation_spec_rest_unset_required_fields(): @@ -12148,7 +12174,7 @@ def test_get_table_spec_rest_required_fields(request_type=service.GetTableSpecRe expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_table_spec_rest_unset_required_fields(): @@ -12339,7 +12365,7 @@ def test_list_table_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_table_specs_rest_unset_required_fields(): @@ -12592,7 +12618,7 @@ def test_update_table_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_table_spec_rest_unset_required_fields(): @@ -12776,7 +12802,7 @@ def test_get_column_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_column_spec_rest_unset_required_fields(): @@ -12967,7 +12993,7 @@ def test_list_column_specs_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_column_specs_rest_unset_required_fields(): @@ -13222,7 +13248,7 @@ def test_update_column_spec_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_update_column_spec_rest_unset_required_fields(): @@ -13404,7 +13430,7 @@ def test_create_model_rest_required_fields(request_type=service.CreateModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_create_model_rest_unset_required_fields(): @@ -13596,7 +13622,7 @@ def test_get_model_rest_required_fields(request_type=service.GetModelRequest): expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_model_rest_unset_required_fields(): @@ -13780,7 +13806,7 @@ def test_list_models_rest_required_fields(request_type=service.ListModelsRequest expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_models_rest_unset_required_fields(): @@ -14027,7 +14053,7 @@ def test_delete_model_rest_required_fields(request_type=service.DeleteModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_delete_model_rest_unset_required_fields(): @@ -14203,7 +14229,7 @@ def test_deploy_model_rest_required_fields(request_type=service.DeployModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_deploy_model_rest_unset_required_fields(): @@ -14379,7 +14405,7 @@ def test_undeploy_model_rest_required_fields(request_type=service.UndeployModelR expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_undeploy_model_rest_unset_required_fields(): @@ -14555,7 +14581,7 @@ def test_export_model_rest_required_fields(request_type=service.ExportModelReque expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_export_model_rest_unset_required_fields(): @@ -14756,7 +14782,7 @@ def test_export_evaluated_examples_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_export_evaluated_examples_rest_unset_required_fields(): @@ -14954,7 +14980,7 @@ def test_get_model_evaluation_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_get_model_evaluation_rest_unset_required_fields(): @@ -15147,7 +15173,7 @@ def test_list_model_evaluations_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_list_model_evaluations_rest_unset_required_fields(): diff --git a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py index 82e3197ef322..5761dae4fe1f 100644 --- a/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py +++ b/packages/google-cloud-automl/tests/unit/gapic/automl_v1beta1/test_prediction_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2026 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + import json import math -import os from collections.abc import AsyncIterable, Iterable, Mapping, Sequence -from unittest import mock -from unittest.mock import AsyncMock import grpc import pytest @@ -2205,7 +2211,7 @@ def test_predict_rest_required_fields(request_type=prediction_service.PredictReq expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_predict_rest_unset_required_fields(): @@ -2401,7 +2407,7 @@ def test_batch_predict_rest_required_fields( expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] - assert sorted(expected_params) == sorted(actual_params) + assert expected_params == actual_params def test_batch_predict_rest_unset_required_fields():