anyscale 0.24.86__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anyscale/__init__.py +181 -0
- anyscale/_private/anyscale_client/README.md +16 -0
- anyscale/_private/anyscale_client/__init__.py +8 -0
- anyscale/_private/anyscale_client/anyscale_client.py +1847 -0
- anyscale/_private/anyscale_client/common.py +593 -0
- anyscale/_private/anyscale_client/fake_anyscale_client.py +1080 -0
- anyscale/_private/docgen/README.md +15 -0
- anyscale/_private/docgen/__main__.py +700 -0
- anyscale/_private/docgen/api.md +1106 -0
- anyscale/_private/docgen/generator.py +559 -0
- anyscale/_private/docgen/generator_legacy.py +104 -0
- anyscale/_private/docgen/models.md +2261 -0
- anyscale/_private/models/__init__.py +2 -0
- anyscale/_private/models/image_uri.py +116 -0
- anyscale/_private/models/model_base.py +251 -0
- anyscale/_private/sdk/__init__.py +102 -0
- anyscale/_private/sdk/base_sdk.py +35 -0
- anyscale/_private/sdk/timer.py +46 -0
- anyscale/_private/utils/__init__.py +0 -0
- anyscale/_private/utils/progress_util.py +85 -0
- anyscale/_private/workload/__init__.py +2 -0
- anyscale/_private/workload/workload_config.py +195 -0
- anyscale/_private/workload/workload_sdk.py +324 -0
- anyscale/aggregated_instance_usage/__init__.py +36 -0
- anyscale/aggregated_instance_usage/_private/aggregated_instance_usage_sdk.py +30 -0
- anyscale/aggregated_instance_usage/commands.py +42 -0
- anyscale/aggregated_instance_usage/models.py +85 -0
- anyscale/anyscale-cloud-setup-gcp-oa.yaml +88 -0
- anyscale/anyscale-cloud-setup-gcp.yaml +113 -0
- anyscale/anyscale-cloud-setup-oa.yaml +121 -0
- anyscale/anyscale-cloud-setup.yaml +327 -0
- anyscale/anyscale_pydantic/HISTORY.md +1254 -0
- anyscale/anyscale_pydantic/LICENSE +21 -0
- anyscale/anyscale_pydantic/PKG-INFO +1351 -0
- anyscale/anyscale_pydantic/README.md +7 -0
- anyscale/anyscale_pydantic/__init__.py +131 -0
- anyscale/anyscale_pydantic/_hypothesis_plugin.py +391 -0
- anyscale/anyscale_pydantic/annotated_types.py +72 -0
- anyscale/anyscale_pydantic/class_validators.py +361 -0
- anyscale/anyscale_pydantic/color.py +494 -0
- anyscale/anyscale_pydantic/config.py +191 -0
- anyscale/anyscale_pydantic/dataclasses.py +478 -0
- anyscale/anyscale_pydantic/datetime_parse.py +248 -0
- anyscale/anyscale_pydantic/decorator.py +264 -0
- anyscale/anyscale_pydantic/env_settings.py +350 -0
- anyscale/anyscale_pydantic/error_wrappers.py +162 -0
- anyscale/anyscale_pydantic/errors.py +646 -0
- anyscale/anyscale_pydantic/fields.py +1256 -0
- anyscale/anyscale_pydantic/generics.py +400 -0
- anyscale/anyscale_pydantic/json.py +112 -0
- anyscale/anyscale_pydantic/main.py +1109 -0
- anyscale/anyscale_pydantic/mypy.py +943 -0
- anyscale/anyscale_pydantic/networks.py +739 -0
- anyscale/anyscale_pydantic/parse.py +66 -0
- anyscale/anyscale_pydantic/py.typed +0 -0
- anyscale/anyscale_pydantic/schema.py +1164 -0
- anyscale/anyscale_pydantic/tools.py +92 -0
- anyscale/anyscale_pydantic/types.py +1206 -0
- anyscale/anyscale_pydantic/typing.py +603 -0
- anyscale/anyscale_pydantic/utils.py +803 -0
- anyscale/anyscale_pydantic/validators.py +765 -0
- anyscale/anyscale_pydantic/version.py +38 -0
- anyscale/anyscale_schema.json +9 -0
- anyscale/api.py +215 -0
- anyscale/api_utils/README.md +2 -0
- anyscale/api_utils/__init__.py +0 -0
- anyscale/api_utils/common_utils.py +81 -0
- anyscale/api_utils/exceptions/__init__.py +0 -0
- anyscale/api_utils/exceptions/job_errors.py +2 -0
- anyscale/api_utils/job_logs_util.py +116 -0
- anyscale/api_utils/job_util.py +22 -0
- anyscale/api_utils/logs_util.py +61 -0
- anyscale/authenticate.py +298 -0
- anyscale/aws_iam_policies.py +465 -0
- anyscale/background/__init__.py +0 -0
- anyscale/background/job_runner.py +64 -0
- anyscale/cli_logger.py +378 -0
- anyscale/client/.gitignore +66 -0
- anyscale/client/.openapi-generator/VERSION +1 -0
- anyscale/client/.openapi-generator-ignore +23 -0
- anyscale/client/README.md +1070 -0
- anyscale/client/git_push.sh +58 -0
- anyscale/client/openapi_client/__init__.py +667 -0
- anyscale/client/openapi_client/api/__init__.py +6 -0
- anyscale/client/openapi_client/api/default_api.py +40922 -0
- anyscale/client/openapi_client/api_client.py +647 -0
- anyscale/client/openapi_client/configuration.py +373 -0
- anyscale/client/openapi_client/exceptions.py +120 -0
- anyscale/client/openapi_client/models/__init__.py +652 -0
- anyscale/client/openapi_client/models/access_config.py +122 -0
- anyscale/client/openapi_client/models/aggregated_instance_usage_with_cost_model.py +733 -0
- anyscale/client/openapi_client/models/aggregatedinstanceusagewithcostmodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/aica_endpoint.py +527 -0
- anyscale/client/openapi_client/models/aica_endpoint_event.py +433 -0
- anyscale/client/openapi_client/models/aica_endpoint_event_level.py +103 -0
- anyscale/client/openapi_client/models/aica_endpoint_event_type.py +120 -0
- anyscale/client/openapi_client/models/aica_endpoint_scope.py +102 -0
- anyscale/client/openapi_client/models/aica_model.py +398 -0
- anyscale/client/openapi_client/models/aica_model_accelerator_map.py +123 -0
- anyscale/client/openapi_client/models/aica_model_configuration.py +209 -0
- anyscale/client/openapi_client/models/aica_observability_urls.py +178 -0
- anyscale/client/openapi_client/models/aicaendpoint_list_response.py +147 -0
- anyscale/client/openapi_client/models/aicaendpoint_response.py +121 -0
- anyscale/client/openapi_client/models/aicaendpointevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/aicamodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/aicamodel_response.py +121 -0
- anyscale/client/openapi_client/models/aioa_cloud_waitlist_record.py +254 -0
- anyscale/client/openapi_client/models/aioacloudwaitlistrecord_response.py +121 -0
- anyscale/client/openapi_client/models/alert_type.py +103 -0
- anyscale/client/openapi_client/models/anyscale_aws_account.py +121 -0
- anyscale/client/openapi_client/models/anyscale_service_account.py +256 -0
- anyscale/client/openapi_client/models/anyscale_version_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaleawsaccount_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaled_credential_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaledcredentialresponse_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaleserviceaccount_response.py +121 -0
- anyscale/client/openapi_client/models/anyscaleversionresponse_response.py +121 -0
- anyscale/client/openapi_client/models/api_key_parameters.py +147 -0
- anyscale/client/openapi_client/models/app_config.py +436 -0
- anyscale/client/openapi_client/models/app_config_config_schema.py +235 -0
- anyscale/client/openapi_client/models/appconfig_list_response.py +147 -0
- anyscale/client/openapi_client/models/appconfig_response.py +121 -0
- anyscale/client/openapi_client/models/application_type.py +99 -0
- anyscale/client/openapi_client/models/applied_snapshot.py +175 -0
- anyscale/client/openapi_client/models/apply_production_service_v2_model.py +490 -0
- anyscale/client/openapi_client/models/archive_status.py +101 -0
- anyscale/client/openapi_client/models/archived_logs_info.py +164 -0
- anyscale/client/openapi_client/models/archivedlogsinfo_response.py +121 -0
- anyscale/client/openapi_client/models/attach_machine_pool_to_cloud_request.py +152 -0
- anyscale/client/openapi_client/models/attachmachinepooltocloudresponse_response.py +121 -0
- anyscale/client/openapi_client/models/aviary_model_config_v2.py +358 -0
- anyscale/client/openapi_client/models/aws_credentials.py +181 -0
- anyscale/client/openapi_client/models/aws_memory_db_cluster_config.py +148 -0
- anyscale/client/openapi_client/models/aws_region_and_zones.py +123 -0
- anyscale/client/openapi_client/models/aws_region_info.py +152 -0
- anyscale/client/openapi_client/models/awsregionandzones_response.py +121 -0
- anyscale/client/openapi_client/models/bank_account_information.py +239 -0
- anyscale/client/openapi_client/models/base_job_status.py +105 -0
- anyscale/client/openapi_client/models/baseimagesenum.py +2130 -0
- anyscale/client/openapi_client/models/batch_response_batched_result_organization_invitation_base.py +121 -0
- anyscale/client/openapi_client/models/batched_result_organization_invitation_base.py +173 -0
- anyscale/client/openapi_client/models/billing_information.py +181 -0
- anyscale/client/openapi_client/models/billing_version_code.py +100 -0
- anyscale/client/openapi_client/models/body_aws_marketplace_registration_api_v2_organization_billing_aws_marketplace_registration_post.py +121 -0
- anyscale/client/openapi_client/models/buffer_registration.py +285 -0
- anyscale/client/openapi_client/models/build.py +607 -0
- anyscale/client/openapi_client/models/build_log_response.py +123 -0
- anyscale/client/openapi_client/models/build_registration.py +285 -0
- anyscale/client/openapi_client/models/build_response.py +121 -0
- anyscale/client/openapi_client/models/build_status.py +104 -0
- anyscale/client/openapi_client/models/buildlogresponse_response.py +121 -0
- anyscale/client/openapi_client/models/card.py +181 -0
- anyscale/client/openapi_client/models/card_id.py +108 -0
- anyscale/client/openapi_client/models/card_list_response.py +147 -0
- anyscale/client/openapi_client/models/change_password_params.py +148 -0
- anyscale/client/openapi_client/models/cleanup_leaked_grafana_dashboard_response.py +208 -0
- anyscale/client/openapi_client/models/cleanupleakedgrafanadashboardresponse_response.py +121 -0
- anyscale/client/openapi_client/models/clone_experimental_workspace.py +151 -0
- anyscale/client/openapi_client/models/cloud.py +802 -0
- anyscale/client/openapi_client/models/cloud_analytics_event.py +351 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_cloud_provider_error.py +152 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_cloud_resource.py +117 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_command_name.py +103 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_error.py +150 -0
- anyscale/client/openapi_client/models/cloud_analytics_event_name.py +109 -0
- anyscale/client/openapi_client/models/cloud_collaborator.py +175 -0
- anyscale/client/openapi_client/models/cloud_collaborator_value.py +177 -0
- anyscale/client/openapi_client/models/cloud_collaborators_query.py +122 -0
- anyscale/client/openapi_client/models/cloud_config.py +206 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_access_mode.py +100 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_file_type.py +102 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_upload_info.py +268 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_upload_request.py +152 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_upload_scheme.py +100 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_request.py +209 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_response.py +296 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_presigned_url_scheme.py +100 -0
- anyscale/client/openapi_client/models/cloud_data_bucket_request_scope.py +100 -0
- anyscale/client/openapi_client/models/cloud_hosting_type.py +100 -0
- anyscale/client/openapi_client/models/cloud_list_response.py +147 -0
- anyscale/client/openapi_client/models/cloud_name_options.py +121 -0
- anyscale/client/openapi_client/models/cloud_overview_dashboard.py +175 -0
- anyscale/client/openapi_client/models/cloud_project_collaborator.py +175 -0
- anyscale/client/openapi_client/models/cloud_project_collaborator_value.py +121 -0
- anyscale/client/openapi_client/models/cloud_provider.py +102 -0
- anyscale/client/openapi_client/models/cloud_providers.py +103 -0
- anyscale/client/openapi_client/models/cloud_region_and_zones.py +123 -0
- anyscale/client/openapi_client/models/cloud_region_info.py +152 -0
- anyscale/client/openapi_client/models/cloud_resource.py +740 -0
- anyscale/client/openapi_client/models/cloud_resource_gcp.py +691 -0
- anyscale/client/openapi_client/models/cloud_response.py +121 -0
- anyscale/client/openapi_client/models/cloud_state.py +104 -0
- anyscale/client/openapi_client/models/cloud_status.py +100 -0
- anyscale/client/openapi_client/models/cloud_type.py +100 -0
- anyscale/client/openapi_client/models/cloud_types.py +100 -0
- anyscale/client/openapi_client/models/cloud_version.py +100 -0
- anyscale/client/openapi_client/models/cloud_waitlist_status.py +102 -0
- anyscale/client/openapi_client/models/cloud_with_cloud_resource.py +830 -0
- anyscale/client/openapi_client/models/cloud_with_cloud_resource_gcp.py +830 -0
- anyscale/client/openapi_client/models/cloudcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/clouddatabucketpresigneduploadinfo_response.py +121 -0
- anyscale/client/openapi_client/models/clouddatabucketpresignedurlresponse_response.py +121 -0
- anyscale/client/openapi_client/models/cloudoverviewdashboard_response.py +121 -0
- anyscale/client/openapi_client/models/cloudregionandzones_response.py +121 -0
- anyscale/client/openapi_client/models/cloudresource_response.py +121 -0
- anyscale/client/openapi_client/models/cloudresourcegcp_response.py +121 -0
- anyscale/client/openapi_client/models/cloudwithcloudresource_response.py +121 -0
- anyscale/client/openapi_client/models/cloudwithcloudresourcegcp_response.py +121 -0
- anyscale/client/openapi_client/models/cluster_auth_response.py +148 -0
- anyscale/client/openapi_client/models/cluster_config.py +178 -0
- anyscale/client/openapi_client/models/cluster_config_with_session_idle_timeout.py +204 -0
- anyscale/client/openapi_client/models/cluster_environments_query.py +290 -0
- anyscale/client/openapi_client/models/cluster_event.py +174 -0
- anyscale/client/openapi_client/models/cluster_events_output.py +175 -0
- anyscale/client/openapi_client/models/cluster_features.py +152 -0
- anyscale/client/openapi_client/models/cluster_management_stack_versions.py +100 -0
- anyscale/client/openapi_client/models/cluster_startup.py +208 -0
- anyscale/client/openapi_client/models/cluster_status.py +104 -0
- anyscale/client/openapi_client/models/cluster_status_details.py +100 -0
- anyscale/client/openapi_client/models/clusterauthresponse_response.py +121 -0
- anyscale/client/openapi_client/models/clusterconfig_response.py +121 -0
- anyscale/client/openapi_client/models/clusterconfigwithsessionidletimeout_response.py +121 -0
- anyscale/client/openapi_client/models/clustereventsoutput_response.py +121 -0
- anyscale/client/openapi_client/models/clusterfeatures_response.py +121 -0
- anyscale/client/openapi_client/models/company_size.py +103 -0
- anyscale/client/openapi_client/models/compute_node_type.py +292 -0
- anyscale/client/openapi_client/models/compute_stack.py +100 -0
- anyscale/client/openapi_client/models/compute_template.py +415 -0
- anyscale/client/openapi_client/models/compute_template_config.py +461 -0
- anyscale/client/openapi_client/models/compute_template_query.py +316 -0
- anyscale/client/openapi_client/models/computetemplate_response.py +121 -0
- anyscale/client/openapi_client/models/computetemplateconfig_response.py +121 -0
- anyscale/client/openapi_client/models/create_aica_endpoint.py +210 -0
- anyscale/client/openapi_client/models/create_aioa_cloud_waitlist.py +173 -0
- anyscale/client/openapi_client/models/create_analytics_event.py +122 -0
- anyscale/client/openapi_client/models/create_app_config.py +235 -0
- anyscale/client/openapi_client/models/create_app_config_configuration_schema.py +235 -0
- anyscale/client/openapi_client/models/create_billing_version.py +181 -0
- anyscale/client/openapi_client/models/create_bug_report_response.py +152 -0
- anyscale/client/openapi_client/models/create_build.py +263 -0
- anyscale/client/openapi_client/models/create_byod_app_config.py +180 -0
- anyscale/client/openapi_client/models/create_byod_app_config_configuration_schema.py +206 -0
- anyscale/client/openapi_client/models/create_byod_build.py +152 -0
- anyscale/client/openapi_client/models/create_cloud_collaborator.py +148 -0
- anyscale/client/openapi_client/models/create_cloud_resource.py +682 -0
- anyscale/client/openapi_client/models/create_cloud_resource_gcp.py +633 -0
- anyscale/client/openapi_client/models/create_cloud_with_cloud_resource.py +546 -0
- anyscale/client/openapi_client/models/create_cluster_compute_config.py +463 -0
- anyscale/client/openapi_client/models/create_compute_template.py +229 -0
- anyscale/client/openapi_client/models/create_compute_template_config.py +464 -0
- anyscale/client/openapi_client/models/create_dataset.py +200 -0
- anyscale/client/openapi_client/models/create_experimental_workspace.py +435 -0
- anyscale/client/openapi_client/models/create_experimental_workspace_from_job.py +123 -0
- anyscale/client/openapi_client/models/create_fine_tuning_hyperparameters.py +156 -0
- anyscale/client/openapi_client/models/create_fine_tuning_job_product_request.py +353 -0
- anyscale/client/openapi_client/models/create_instance_usage_budget.py +253 -0
- anyscale/client/openapi_client/models/create_internal_production_job.py +262 -0
- anyscale/client/openapi_client/models/create_job_queue_config.py +206 -0
- anyscale/client/openapi_client/models/create_job_queue_requests.py +323 -0
- anyscale/client/openapi_client/models/create_machine_pool_request.py +151 -0
- anyscale/client/openapi_client/models/create_machine_pool_response.py +123 -0
- anyscale/client/openapi_client/models/create_machine_request.py +151 -0
- anyscale/client/openapi_client/models/create_machine_response.py +123 -0
- anyscale/client/openapi_client/models/create_metronome_webhook_notification.py +175 -0
- anyscale/client/openapi_client/models/create_notification_channel_record.py +146 -0
- anyscale/client/openapi_client/models/create_organization_configuration.py +199 -0
- anyscale/client/openapi_client/models/create_organization_invitation.py +121 -0
- anyscale/client/openapi_client/models/create_otp_return_api_model.py +148 -0
- anyscale/client/openapi_client/models/create_production_job_config.py +347 -0
- anyscale/client/openapi_client/models/create_resource_quota.py +293 -0
- anyscale/client/openapi_client/models/create_schedule.py +263 -0
- anyscale/client/openapi_client/models/create_session_from_snapshot_options.py +565 -0
- anyscale/client/openapi_client/models/create_session_in_db.py +434 -0
- anyscale/client/openapi_client/models/create_session_response.py +174 -0
- anyscale/client/openapi_client/models/create_user.py +439 -0
- anyscale/client/openapi_client/models/create_user_project_collaborator.py +148 -0
- anyscale/client/openapi_client/models/create_user_project_collaborator_value.py +121 -0
- anyscale/client/openapi_client/models/create_workspace_from_template.py +263 -0
- anyscale/client/openapi_client/models/createbugreportresponse_response.py +121 -0
- anyscale/client/openapi_client/models/createcomputetemplateconfig_response.py +121 -0
- anyscale/client/openapi_client/models/createmachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/createmachineresponse_response.py +121 -0
- anyscale/client/openapi_client/models/createotpreturnapimodel_response.py +121 -0
- anyscale/client/openapi_client/models/createsessionresponse_response.py +121 -0
- anyscale/client/openapi_client/models/credit_card_information.py +268 -0
- anyscale/client/openapi_client/models/customer_alert_status.py +101 -0
- anyscale/client/openapi_client/models/customer_billing_type.py +101 -0
- anyscale/client/openapi_client/models/dataplane_services.py +102 -0
- anyscale/client/openapi_client/models/dataset.py +416 -0
- anyscale/client/openapi_client/models/dataset_list_response.py +150 -0
- anyscale/client/openapi_client/models/dataset_response.py +121 -0
- anyscale/client/openapi_client/models/dataset_upload.py +148 -0
- anyscale/client/openapi_client/models/datasetupload_response.py +121 -0
- anyscale/client/openapi_client/models/decorated_application_template.py +493 -0
- anyscale/client/openapi_client/models/decorated_build.py +664 -0
- anyscale/client/openapi_client/models/decorated_compute_template.py +446 -0
- anyscale/client/openapi_client/models/decorated_compute_template_config.py +490 -0
- anyscale/client/openapi_client/models/decorated_interactive_session.py +793 -0
- anyscale/client/openapi_client/models/decorated_job.py +793 -0
- anyscale/client/openapi_client/models/decorated_job_queue.py +639 -0
- anyscale/client/openapi_client/models/decorated_job_submission.py +575 -0
- anyscale/client/openapi_client/models/decorated_list_service_api_model.py +670 -0
- anyscale/client/openapi_client/models/decorated_production_job.py +805 -0
- anyscale/client/openapi_client/models/decorated_production_job_state_transition.py +319 -0
- anyscale/client/openapi_client/models/decorated_production_service_v2_api_model.py +641 -0
- anyscale/client/openapi_client/models/decorated_production_service_v2_version_api_model.py +437 -0
- anyscale/client/openapi_client/models/decorated_runtime_env.py +488 -0
- anyscale/client/openapi_client/models/decorated_schedule.py +552 -0
- anyscale/client/openapi_client/models/decorated_serve_deployment.py +711 -0
- anyscale/client/openapi_client/models/decorated_service_event_api_model.py +513 -0
- anyscale/client/openapi_client/models/decorated_session.py +1789 -0
- anyscale/client/openapi_client/models/decorated_support_request.py +283 -0
- anyscale/client/openapi_client/models/decorated_unified_job.py +466 -0
- anyscale/client/openapi_client/models/decoratedapplicationtemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedapplicationtemplate_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedbuild_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedbuild_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedcomputetemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedcomputetemplate_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedinteractivesession_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedinteractivesession_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedjob_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedjobqueue_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedjobqueue_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedjobsubmission_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedjobsubmission_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedlistserviceapimodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedproductionjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedproductionjob_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedproductionjobstatetransition_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedproductionservicev2_apimodel_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedproductionservicev2_versionapimodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedruntimeenv_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedruntimeenv_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedschedule_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedschedule_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedservedeployment_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedservedeployment_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedserviceeventapimodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedsession_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedsession_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedsupportrequest_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedsupportrequest_response.py +121 -0
- anyscale/client/openapi_client/models/decoratedunifiedjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/decoratedunifiedjob_response.py +121 -0
- anyscale/client/openapi_client/models/delete_machine_pool_request.py +123 -0
- anyscale/client/openapi_client/models/delete_machine_request.py +206 -0
- anyscale/client/openapi_client/models/deleted_platform_fine_tuned_model.py +148 -0
- anyscale/client/openapi_client/models/deletedplatformfinetunedmodel_response.py +121 -0
- anyscale/client/openapi_client/models/deletemachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/detach_machine_pool_from_cloud_request.py +152 -0
- anyscale/client/openapi_client/models/detachmachinepoolfromcloudresponse_response.py +121 -0
- anyscale/client/openapi_client/models/dismissal_type.py +100 -0
- anyscale/client/openapi_client/models/editable_cloud_resource.py +206 -0
- anyscale/client/openapi_client/models/editable_cloud_resource_gcp.py +178 -0
- anyscale/client/openapi_client/models/error.py +174 -0
- anyscale/client/openapi_client/models/event_level.py +104 -0
- anyscale/client/openapi_client/models/execute_command_response.py +175 -0
- anyscale/client/openapi_client/models/execute_interactive_command_options.py +147 -0
- anyscale/client/openapi_client/models/execute_shell_command_options.py +121 -0
- anyscale/client/openapi_client/models/executecommandresponse_response.py +121 -0
- anyscale/client/openapi_client/models/experimental_workspace.py +748 -0
- anyscale/client/openapi_client/models/experimental_workspaces_sort_field.py +100 -0
- anyscale/client/openapi_client/models/experimentalworkspace_list_response.py +147 -0
- anyscale/client/openapi_client/models/experimentalworkspace_response.py +121 -0
- anyscale/client/openapi_client/models/external_service_status.py +147 -0
- anyscale/client/openapi_client/models/external_service_status_response.py +250 -0
- anyscale/client/openapi_client/models/external_terminal_command.py +280 -0
- anyscale/client/openapi_client/models/externalservicestatusresponse_response.py +121 -0
- anyscale/client/openapi_client/models/feature_compatibility.py +152 -0
- anyscale/client/openapi_client/models/feature_flag_response.py +121 -0
- anyscale/client/openapi_client/models/featureflagresponse_response.py +121 -0
- anyscale/client/openapi_client/models/fine_tune_type.py +100 -0
- anyscale/client/openapi_client/models/fine_tuned_model.py +412 -0
- anyscale/client/openapi_client/models/fine_tuning_job_status.py +103 -0
- anyscale/client/openapi_client/models/finetunedmodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/finetunedmodel_response.py +121 -0
- anyscale/client/openapi_client/models/finish_ft_job_request.py +204 -0
- anyscale/client/openapi_client/models/finish_ft_job_request_v2.py +183 -0
- anyscale/client/openapi_client/models/gcp_file_store_config.py +175 -0
- anyscale/client/openapi_client/models/gcp_memorystore_instance_config.py +148 -0
- anyscale/client/openapi_client/models/grafana_dashboard.py +201 -0
- anyscale/client/openapi_client/models/grpc_protocol_config.py +178 -0
- anyscale/client/openapi_client/models/ha_job_error_types.py +103 -0
- anyscale/client/openapi_client/models/ha_job_event_level.py +101 -0
- anyscale/client/openapi_client/models/ha_job_event_origin.py +100 -0
- anyscale/client/openapi_client/models/ha_job_goal_states.py +102 -0
- anyscale/client/openapi_client/models/ha_job_states.py +109 -0
- anyscale/client/openapi_client/models/ha_job_type.py +100 -0
- anyscale/client/openapi_client/models/ha_jobs_sort_field.py +105 -0
- anyscale/client/openapi_client/models/head_ip.py +121 -0
- anyscale/client/openapi_client/models/headip_response.py +121 -0
- anyscale/client/openapi_client/models/http_protocol_config.py +150 -0
- anyscale/client/openapi_client/models/http_validation_error.py +120 -0
- anyscale/client/openapi_client/models/idle_termination_status.py +104 -0
- anyscale/client/openapi_client/models/import_aica_model.py +241 -0
- anyscale/client/openapi_client/models/instance_usage_budget.py +572 -0
- anyscale/client/openapi_client/models/instance_usage_budget_evaluation_period.py +100 -0
- anyscale/client/openapi_client/models/instanceusagebudget_list_response.py +147 -0
- anyscale/client/openapi_client/models/instanceusagebudget_response.py +121 -0
- anyscale/client/openapi_client/models/integration_details.py +120 -0
- anyscale/client/openapi_client/models/interactive_session_logs.py +152 -0
- anyscale/client/openapi_client/models/interactivesessionlogs_response.py +121 -0
- anyscale/client/openapi_client/models/internal_production_job.py +663 -0
- anyscale/client/openapi_client/models/internalproductionjob_response.py +121 -0
- anyscale/client/openapi_client/models/invoice.py +413 -0
- anyscale/client/openapi_client/models/invoice_list_response.py +147 -0
- anyscale/client/openapi_client/models/invoice_status.py +102 -0
- anyscale/client/openapi_client/models/invoices_query.py +150 -0
- anyscale/client/openapi_client/models/job_access.py +102 -0
- anyscale/client/openapi_client/models/job_queue.py +467 -0
- anyscale/client/openapi_client/models/job_queue_config.py +122 -0
- anyscale/client/openapi_client/models/job_queue_execution_mode.py +101 -0
- anyscale/client/openapi_client/models/job_queue_spec.py +263 -0
- anyscale/client/openapi_client/models/job_queue_state.py +100 -0
- anyscale/client/openapi_client/models/job_queues_query.py +262 -0
- anyscale/client/openapi_client/models/job_run_type.py +101 -0
- anyscale/client/openapi_client/models/job_state_log_level_types.py +100 -0
- anyscale/client/openapi_client/models/job_status.py +105 -0
- anyscale/client/openapi_client/models/job_submissions_sort_field.py +101 -0
- anyscale/client/openapi_client/models/jobqueue_response.py +121 -0
- anyscale/client/openapi_client/models/jobs_logs.py +152 -0
- anyscale/client/openapi_client/models/jobs_logs_query_info.py +181 -0
- anyscale/client/openapi_client/models/jobs_sort_field.py +104 -0
- anyscale/client/openapi_client/models/jobslogs_response.py +121 -0
- anyscale/client/openapi_client/models/jobslogsqueryinfo_response.py +121 -0
- anyscale/client/openapi_client/models/json_patch_operation.py +200 -0
- anyscale/client/openapi_client/models/kubernetes_manager_registration_request.py +123 -0
- anyscale/client/openapi_client/models/kubernetes_manager_registration_response.py +123 -0
- anyscale/client/openapi_client/models/kubernetesmanagerregistrationresponse_response.py +121 -0
- anyscale/client/openapi_client/models/lb_resource.py +123 -0
- anyscale/client/openapi_client/models/lbresource_response.py +121 -0
- anyscale/client/openapi_client/models/list_machine_pools_response.py +123 -0
- anyscale/client/openapi_client/models/list_machines_response.py +121 -0
- anyscale/client/openapi_client/models/list_resource_quotas_query.py +234 -0
- anyscale/client/openapi_client/models/list_response_metadata.py +146 -0
- anyscale/client/openapi_client/models/listmachinepoolsresponse_response.py +121 -0
- anyscale/client/openapi_client/models/listmachinesresponse_response.py +121 -0
- anyscale/client/openapi_client/models/log_detail.py +187 -0
- anyscale/client/openapi_client/models/log_details.py +151 -0
- anyscale/client/openapi_client/models/log_download_config.py +206 -0
- anyscale/client/openapi_client/models/log_download_request.py +150 -0
- anyscale/client/openapi_client/models/log_download_result.py +207 -0
- anyscale/client/openapi_client/models/log_file_chunk.py +439 -0
- anyscale/client/openapi_client/models/log_filter.py +430 -0
- anyscale/client/openapi_client/models/log_item.py +181 -0
- anyscale/client/openapi_client/models/log_item_batch.py +151 -0
- anyscale/client/openapi_client/models/log_level_types.py +100 -0
- anyscale/client/openapi_client/models/log_stream.py +151 -0
- anyscale/client/openapi_client/models/logdetails_response.py +121 -0
- anyscale/client/openapi_client/models/logdownloadresult_response.py +121 -0
- anyscale/client/openapi_client/models/login_user_params.py +205 -0
- anyscale/client/openapi_client/models/logitembatch_response.py +121 -0
- anyscale/client/openapi_client/models/logs_output.py +202 -0
- anyscale/client/openapi_client/models/logsoutput_response.py +121 -0
- anyscale/client/openapi_client/models/logstream_response.py +121 -0
- anyscale/client/openapi_client/models/long_running_workload.py +256 -0
- anyscale/client/openapi_client/models/longrunningworkload_list_response.py +147 -0
- anyscale/client/openapi_client/models/machine_allocation_state.py +100 -0
- anyscale/client/openapi_client/models/machine_connection_state.py +100 -0
- anyscale/client/openapi_client/models/machine_info.py +466 -0
- anyscale/client/openapi_client/models/machine_pool.py +266 -0
- anyscale/client/openapi_client/models/metronome_customer_info_model.py +148 -0
- anyscale/client/openapi_client/models/metronome_dashboard_type.py +101 -0
- anyscale/client/openapi_client/models/metronomecustomerinfomodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/metronomecustomerinfomodel_response.py +121 -0
- anyscale/client/openapi_client/models/mini_build.py +267 -0
- anyscale/client/openapi_client/models/mini_cloud.py +321 -0
- anyscale/client/openapi_client/models/mini_cluster.py +148 -0
- anyscale/client/openapi_client/models/mini_compute_template.py +228 -0
- anyscale/client/openapi_client/models/mini_compute_template_config.py +121 -0
- anyscale/client/openapi_client/models/mini_job_run.py +599 -0
- anyscale/client/openapi_client/models/mini_namespace.py +148 -0
- anyscale/client/openapi_client/models/mini_organization.py +148 -0
- anyscale/client/openapi_client/models/mini_production_job.py +202 -0
- anyscale/client/openapi_client/models/mini_project.py +205 -0
- anyscale/client/openapi_client/models/mini_runtime_environment.py +147 -0
- anyscale/client/openapi_client/models/mini_schedule.py +180 -0
- anyscale/client/openapi_client/models/mini_user.py +266 -0
- anyscale/client/openapi_client/models/minibuild_list_response.py +147 -0
- anyscale/client/openapi_client/models/minicomputetemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/miniproject_list_response.py +147 -0
- anyscale/client/openapi_client/models/monitor_logs_extension.py +100 -0
- anyscale/client/openapi_client/models/named_entity.py +148 -0
- anyscale/client/openapi_client/models/nfs_mount_target.py +151 -0
- anyscale/client/openapi_client/models/node_registration_aws.py +152 -0
- anyscale/client/openapi_client/models/node_registration_gcp.py +123 -0
- anyscale/client/openapi_client/models/node_registration_k8_s.py +178 -0
- anyscale/client/openapi_client/models/node_registration_provisioned.py +150 -0
- anyscale/client/openapi_client/models/node_registration_v2.py +279 -0
- anyscale/client/openapi_client/models/node_type.py +100 -0
- anyscale/client/openapi_client/models/notification_channel_email_config.py +121 -0
- anyscale/client/openapi_client/models/notification_channel_webhook_config.py +121 -0
- anyscale/client/openapi_client/models/onboarding_user_cards_query.py +122 -0
- anyscale/client/openapi_client/models/organization.py +490 -0
- anyscale/client/openapi_client/models/organization_availability.py +148 -0
- anyscale/client/openapi_client/models/organization_collaborator.py +259 -0
- anyscale/client/openapi_client/models/organization_configuration.py +280 -0
- anyscale/client/openapi_client/models/organization_configuration_response.py +227 -0
- anyscale/client/openapi_client/models/organization_invitation.py +255 -0
- anyscale/client/openapi_client/models/organization_invitation_base.py +121 -0
- anyscale/client/openapi_client/models/organization_marketing_questions.py +198 -0
- anyscale/client/openapi_client/models/organization_permission_level.py +100 -0
- anyscale/client/openapi_client/models/organization_project_collaborator.py +175 -0
- anyscale/client/openapi_client/models/organization_project_collaborator_value.py +148 -0
- anyscale/client/openapi_client/models/organization_public_identifier.py +121 -0
- anyscale/client/openapi_client/models/organization_response.py +121 -0
- anyscale/client/openapi_client/models/organization_summary.py +229 -0
- anyscale/client/openapi_client/models/organization_usage_alert.py +210 -0
- anyscale/client/openapi_client/models/organization_usage_alert_severity.py +100 -0
- anyscale/client/openapi_client/models/organizationavailability_response.py +121 -0
- anyscale/client/openapi_client/models/organizationcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationconfiguration_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationconfigurationresponse_response.py +121 -0
- anyscale/client/openapi_client/models/organizationinvitation_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationinvitation_response.py +121 -0
- anyscale/client/openapi_client/models/organizationinvitationbase_response.py +121 -0
- anyscale/client/openapi_client/models/organizationprojectcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/organizationpublicidentifier_response.py +121 -0
- anyscale/client/openapi_client/models/organizationusagealert_list_response.py +147 -0
- anyscale/client/openapi_client/models/page_query.py +153 -0
- anyscale/client/openapi_client/models/pause_schedule.py +123 -0
- anyscale/client/openapi_client/models/permission_level.py +101 -0
- anyscale/client/openapi_client/models/platform_fine_tuning_job.py +577 -0
- anyscale/client/openapi_client/models/platformfinetuningjob_list_response.py +147 -0
- anyscale/client/openapi_client/models/platformfinetuningjob_response.py +121 -0
- anyscale/client/openapi_client/models/product_autoscaler_flag.py +122 -0
- anyscale/client/openapi_client/models/product_type.py +100 -0
- anyscale/client/openapi_client/models/productautoscalerflag_response.py +121 -0
- anyscale/client/openapi_client/models/production_job.py +437 -0
- anyscale/client/openapi_client/models/production_job_config.py +348 -0
- anyscale/client/openapi_client/models/production_job_event.py +378 -0
- anyscale/client/openapi_client/models/production_job_event_scope_filter.py +101 -0
- anyscale/client/openapi_client/models/production_job_state_transition.py +293 -0
- anyscale/client/openapi_client/models/productionjob_response.py +121 -0
- anyscale/client/openapi_client/models/productionjobevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/project.py +554 -0
- anyscale/client/openapi_client/models/project_base.py +121 -0
- anyscale/client/openapi_client/models/project_collaborator.py +175 -0
- anyscale/client/openapi_client/models/project_collaborator_value.py +175 -0
- anyscale/client/openapi_client/models/project_collaborators_put_message.py +121 -0
- anyscale/client/openapi_client/models/project_create_message.py +148 -0
- anyscale/client/openapi_client/models/project_default_session_name.py +121 -0
- anyscale/client/openapi_client/models/project_delete_message.py +121 -0
- anyscale/client/openapi_client/models/project_list_response.py +147 -0
- anyscale/client/openapi_client/models/project_patch_message.py +121 -0
- anyscale/client/openapi_client/models/project_response.py +121 -0
- anyscale/client/openapi_client/models/projectbase_response.py +121 -0
- anyscale/client/openapi_client/models/projectcollaborator_list_response.py +147 -0
- anyscale/client/openapi_client/models/projectdefaultsessionname_response.py +121 -0
- anyscale/client/openapi_client/models/projects_sort_field.py +101 -0
- anyscale/client/openapi_client/models/projects_violating_tree_hierarchy_response.py +121 -0
- anyscale/client/openapi_client/models/projectsviolatingtreehierarchyresponse_response.py +121 -0
- anyscale/client/openapi_client/models/protocols.py +150 -0
- anyscale/client/openapi_client/models/provider_metadata.py +205 -0
- anyscale/client/openapi_client/models/providermetadata_response.py +121 -0
- anyscale/client/openapi_client/models/python_modules.py +150 -0
- anyscale/client/openapi_client/models/quota.py +198 -0
- anyscale/client/openapi_client/models/ray_gcs_external_storage_config.py +178 -0
- anyscale/client/openapi_client/models/ray_runtime_env_config.py +262 -0
- anyscale/client/openapi_client/models/read_billing_version.py +210 -0
- anyscale/client/openapi_client/models/readbillingversion_list_response.py +147 -0
- anyscale/client/openapi_client/models/replica_details.py +152 -0
- anyscale/client/openapi_client/models/replica_state.py +104 -0
- anyscale/client/openapi_client/models/request_email_magic_link_response.py +147 -0
- anyscale/client/openapi_client/models/request_otp_return_api_model.py +148 -0
- anyscale/client/openapi_client/models/request_password_reset_params.py +147 -0
- anyscale/client/openapi_client/models/requestemailmagiclinkresponse_response.py +121 -0
- anyscale/client/openapi_client/models/requestotpreturnapimodel_response.py +121 -0
- anyscale/client/openapi_client/models/reset_password_params.py +148 -0
- anyscale/client/openapi_client/models/resource_quota.py +465 -0
- anyscale/client/openapi_client/models/resource_quota_status.py +123 -0
- anyscale/client/openapi_client/models/resourcequota_list_response.py +147 -0
- anyscale/client/openapi_client/models/resourcequota_response.py +121 -0
- anyscale/client/openapi_client/models/resources.py +234 -0
- anyscale/client/openapi_client/models/resubmit_ft_job_request.py +121 -0
- anyscale/client/openapi_client/models/rollback_service_model.py +122 -0
- anyscale/client/openapi_client/models/rollout_strategy.py +100 -0
- anyscale/client/openapi_client/models/s3_download_location.py +148 -0
- anyscale/client/openapi_client/models/schedule_config.py +151 -0
- anyscale/client/openapi_client/models/serve_deployment_grafana_dashboard_status.py +101 -0
- anyscale/client/openapi_client/models/serve_deployment_logs.py +152 -0
- anyscale/client/openapi_client/models/serve_deployment_state.py +104 -0
- anyscale/client/openapi_client/models/servedeploymentlogs_response.py +121 -0
- anyscale/client/openapi_client/models/server_session_token.py +121 -0
- anyscale/client/openapi_client/models/serversessiontoken_response.py +121 -0
- anyscale/client/openapi_client/models/service_config.py +178 -0
- anyscale/client/openapi_client/models/service_event_current_state.py +108 -0
- anyscale/client/openapi_client/models/service_event_level.py +102 -0
- anyscale/client/openapi_client/models/service_event_origin.py +103 -0
- anyscale/client/openapi_client/models/service_event_scope.py +103 -0
- anyscale/client/openapi_client/models/service_event_scope_filter.py +104 -0
- anyscale/client/openapi_client/models/service_event_type.py +125 -0
- anyscale/client/openapi_client/models/service_event_verbose_message_model.py +180 -0
- anyscale/client/openapi_client/models/service_goal_states.py +100 -0
- anyscale/client/openapi_client/models/service_observability_urls.py +206 -0
- anyscale/client/openapi_client/models/service_sort_field.py +101 -0
- anyscale/client/openapi_client/models/service_type.py +100 -0
- anyscale/client/openapi_client/models/service_usage.py +353 -0
- anyscale/client/openapi_client/models/service_version_state.py +106 -0
- anyscale/client/openapi_client/models/serviceeventverbosemessagemodel_list_response.py +147 -0
- anyscale/client/openapi_client/models/session.py +834 -0
- anyscale/client/openapi_client/models/session_access.py +102 -0
- anyscale/client/openapi_client/models/session_autosync_sessions_update_message.py +121 -0
- anyscale/client/openapi_client/models/session_command.py +413 -0
- anyscale/client/openapi_client/models/session_command_finish_options.py +226 -0
- anyscale/client/openapi_client/models/session_command_id.py +121 -0
- anyscale/client/openapi_client/models/session_command_types.py +100 -0
- anyscale/client/openapi_client/models/session_create_message.py +148 -0
- anyscale/client/openapi_client/models/session_delete_message.py +121 -0
- anyscale/client/openapi_client/models/session_describe.py +175 -0
- anyscale/client/openapi_client/models/session_details.py +148 -0
- anyscale/client/openapi_client/models/session_event.py +267 -0
- anyscale/client/openapi_client/models/session_event_cause.py +150 -0
- anyscale/client/openapi_client/models/session_event_types.py +111 -0
- anyscale/client/openapi_client/models/session_execute_message.py +121 -0
- anyscale/client/openapi_client/models/session_finish_command_message.py +175 -0
- anyscale/client/openapi_client/models/session_history_item.py +146 -0
- anyscale/client/openapi_client/models/session_kill_command_message.py +121 -0
- anyscale/client/openapi_client/models/session_list_response.py +147 -0
- anyscale/client/openapi_client/models/session_patch_message.py +121 -0
- anyscale/client/openapi_client/models/session_response.py +121 -0
- anyscale/client/openapi_client/models/session_ssh_key.py +148 -0
- anyscale/client/openapi_client/models/session_starting_up_data.py +146 -0
- anyscale/client/openapi_client/models/session_state.py +111 -0
- anyscale/client/openapi_client/models/session_state_change_message.py +121 -0
- anyscale/client/openapi_client/models/session_state_data.py +146 -0
- anyscale/client/openapi_client/models/session_stopping_data.py +146 -0
- anyscale/client/openapi_client/models/sessioncommand_list_response.py +147 -0
- anyscale/client/openapi_client/models/sessioncommandid_response.py +121 -0
- anyscale/client/openapi_client/models/sessiondescribe_response.py +121 -0
- anyscale/client/openapi_client/models/sessiondetails_response.py +121 -0
- anyscale/client/openapi_client/models/sessionevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/sessionhistoryitem_list_response.py +147 -0
- anyscale/client/openapi_client/models/sessions_sort_field.py +104 -0
- anyscale/client/openapi_client/models/sessionsshkey_response.py +121 -0
- anyscale/client/openapi_client/models/setup_initialize_session_options.py +225 -0
- anyscale/client/openapi_client/models/show_otp_source_return_api_model.py +121 -0
- anyscale/client/openapi_client/models/showotpsourcereturnapimodel_response.py +121 -0
- anyscale/client/openapi_client/models/snapshot_create_message.py +148 -0
- anyscale/client/openapi_client/models/snapshot_delete_message.py +148 -0
- anyscale/client/openapi_client/models/snapshot_patch_message.py +148 -0
- anyscale/client/openapi_client/models/socket_message_schemas.py +499 -0
- anyscale/client/openapi_client/models/socket_message_types.py +113 -0
- anyscale/client/openapi_client/models/socketmessageschemas_response.py +121 -0
- anyscale/client/openapi_client/models/socketmessagetypes_response.py +121 -0
- anyscale/client/openapi_client/models/sort_order.py +100 -0
- anyscale/client/openapi_client/models/sso_login_info.py +151 -0
- anyscale/client/openapi_client/models/ssologininfo_response.py +121 -0
- anyscale/client/openapi_client/models/start_session_options.py +146 -0
- anyscale/client/openapi_client/models/stop_session_options.py +227 -0
- anyscale/client/openapi_client/models/stream_publish_request.py +239 -0
- anyscale/client/openapi_client/models/subnet_id_with_availability_zone_aws.py +148 -0
- anyscale/client/openapi_client/models/support_requests_query.py +178 -0
- anyscale/client/openapi_client/models/supportedbaseimagesenum.py +1570 -0
- anyscale/client/openapi_client/models/templatized_compute_configs.py +202 -0
- anyscale/client/openapi_client/models/templatized_decorated_application_templates.py +202 -0
- anyscale/client/openapi_client/models/templatizedcomputeconfigs_response.py +121 -0
- anyscale/client/openapi_client/models/templatizeddecoratedapplicationtemplates_response.py +121 -0
- anyscale/client/openapi_client/models/text_query.py +178 -0
- anyscale/client/openapi_client/models/timestamped_logs_output.py +148 -0
- anyscale/client/openapi_client/models/timestampedlogsoutput_response.py +121 -0
- anyscale/client/openapi_client/models/tool.py +100 -0
- anyscale/client/openapi_client/models/tracing_config.py +178 -0
- anyscale/client/openapi_client/models/try_login_email_response.py +208 -0
- anyscale/client/openapi_client/models/tryloginemailresponse_response.py +121 -0
- anyscale/client/openapi_client/models/unified_job_sort_field.py +103 -0
- anyscale/client/openapi_client/models/unified_job_status.py +114 -0
- anyscale/client/openapi_client/models/unified_job_type.py +100 -0
- anyscale/client/openapi_client/models/update_cloud_with_cloud_resource.py +178 -0
- anyscale/client/openapi_client/models/update_cloud_with_cloud_resource_gcp.py +178 -0
- anyscale/client/openapi_client/models/update_cluster_dns.py +152 -0
- anyscale/client/openapi_client/models/update_compute_template.py +146 -0
- anyscale/client/openapi_client/models/update_compute_template_config.py +464 -0
- anyscale/client/openapi_client/models/update_endpoint.py +152 -0
- anyscale/client/openapi_client/models/update_machine_pool_request.py +151 -0
- anyscale/client/openapi_client/models/update_model_deployment.py +152 -0
- anyscale/client/openapi_client/models/update_organization_collaborator.py +121 -0
- anyscale/client/openapi_client/models/update_project_collaborator.py +121 -0
- anyscale/client/openapi_client/models/update_resource_quota.py +122 -0
- anyscale/client/openapi_client/models/updatemachinepoolresponse_response.py +121 -0
- anyscale/client/openapi_client/models/upload_session_command_logs_locations.py +148 -0
- anyscale/client/openapi_client/models/uploadsessioncommandlogslocations_response.py +121 -0
- anyscale/client/openapi_client/models/user_info.py +569 -0
- anyscale/client/openapi_client/models/user_resend_email_options.py +147 -0
- anyscale/client/openapi_client/models/user_service_access_types.py +100 -0
- anyscale/client/openapi_client/models/userinfo_response.py +121 -0
- anyscale/client/openapi_client/models/utm_fields.py +224 -0
- anyscale/client/openapi_client/models/ux_instance.py +468 -0
- anyscale/client/openapi_client/models/validate_otp_params_api_model.py +121 -0
- anyscale/client/openapi_client/models/validation_error.py +175 -0
- anyscale/client/openapi_client/models/verify_response.py +147 -0
- anyscale/client/openapi_client/models/verifyresponse_response.py +121 -0
- anyscale/client/openapi_client/models/visibility.py +100 -0
- anyscale/client/openapi_client/models/waitlist_status_response.py +121 -0
- anyscale/client/openapi_client/models/waitlist_status_type.py +100 -0
- anyscale/client/openapi_client/models/waitliststatusresponse_response.py +121 -0
- anyscale/client/openapi_client/models/wand_b_run_details.py +147 -0
- anyscale/client/openapi_client/models/web_terminal.py +121 -0
- anyscale/client/openapi_client/models/webterminal_list_response.py +147 -0
- anyscale/client/openapi_client/models/webterminal_response.py +121 -0
- anyscale/client/openapi_client/models/worker_node_type.py +404 -0
- anyscale/client/openapi_client/models/workload_type.py +102 -0
- anyscale/client/openapi_client/models/workspace_dataplane_artifact.py +181 -0
- anyscale/client/openapi_client/models/workspace_dataplane_artifacts.py +123 -0
- anyscale/client/openapi_client/models/workspace_dataplane_proxied_artifacts.py +178 -0
- anyscale/client/openapi_client/models/workspace_event.py +325 -0
- anyscale/client/openapi_client/models/workspace_event_source.py +100 -0
- anyscale/client/openapi_client/models/workspace_event_source_filter.py +101 -0
- anyscale/client/openapi_client/models/workspace_readme.py +123 -0
- anyscale/client/openapi_client/models/workspace_snapshot_states.py +108 -0
- anyscale/client/openapi_client/models/workspace_template.py +353 -0
- anyscale/client/openapi_client/models/workspace_template_cluster_environment_metadata.py +178 -0
- anyscale/client/openapi_client/models/workspacedataplaneartifacts_response.py +121 -0
- anyscale/client/openapi_client/models/workspacedataplaneproxiedartifacts_response.py +121 -0
- anyscale/client/openapi_client/models/workspaceevent_list_response.py +147 -0
- anyscale/client/openapi_client/models/workspacereadme_response.py +121 -0
- anyscale/client/openapi_client/models/workspacetemplate_list_response.py +147 -0
- anyscale/client/openapi_client/models/workspacetemplateclusterenvironmentmetadata_response.py +121 -0
- anyscale/client/openapi_client/models/write_cloud.py +546 -0
- anyscale/client/openapi_client/models/write_cluster_config.py +123 -0
- anyscale/client/openapi_client/models/write_project.py +226 -0
- anyscale/client/openapi_client/models/write_session.py +147 -0
- anyscale/client/openapi_client/models/write_support_request.py +121 -0
- anyscale/client/openapi_client/rest.py +296 -0
- anyscale/client/requirements.txt +6 -0
- anyscale/client/setup.cfg +2 -0
- anyscale/client/setup.py +40 -0
- anyscale/client/test-requirements.txt +3 -0
- anyscale/client/tox.ini +9 -0
- anyscale/cloud.py +216 -0
- anyscale/cloud_resource.py +1032 -0
- anyscale/cluster.py +138 -0
- anyscale/cluster_compute.py +167 -0
- anyscale/cluster_env.py +173 -0
- anyscale/commands/__init__.py +0 -0
- anyscale/commands/aggregated_instance_usage_commands.py +86 -0
- anyscale/commands/anyscale_api/__init__.py +0 -0
- anyscale/commands/anyscale_api/api_commands.py +23 -0
- anyscale/commands/anyscale_api/session_commands_commands.py +80 -0
- anyscale/commands/anyscale_api/session_operations_commands.py +28 -0
- anyscale/commands/anyscale_api/sessions_commands.py +152 -0
- anyscale/commands/auth_commands.py +41 -0
- anyscale/commands/cloud_commands.py +1011 -0
- anyscale/commands/cloud_commands_util.py +10 -0
- anyscale/commands/cluster_commands.py +476 -0
- anyscale/commands/cluster_env_commands.py +139 -0
- anyscale/commands/command_examples.py +495 -0
- anyscale/commands/compute_config_commands.py +252 -0
- anyscale/commands/config_commands.py +213 -0
- anyscale/commands/exec_commands.py +14 -0
- anyscale/commands/experimental_integrations_commands.py +70 -0
- anyscale/commands/image_commands.py +125 -0
- anyscale/commands/job_commands.py +745 -0
- anyscale/commands/list_commands.py +85 -0
- anyscale/commands/llm/dataset_commands.py +269 -0
- anyscale/commands/llm/group.py +15 -0
- anyscale/commands/llm/models_commands.py +123 -0
- anyscale/commands/login_commands.py +79 -0
- anyscale/commands/logs_commands.py +312 -0
- anyscale/commands/machine_commands.py +116 -0
- anyscale/commands/machine_pool_commands.py +163 -0
- anyscale/commands/migrate_commands.py +84 -0
- anyscale/commands/project_commands.py +203 -0
- anyscale/commands/resource_quota_commands.py +214 -0
- anyscale/commands/schedule_commands.py +436 -0
- anyscale/commands/service_account_commands.py +72 -0
- anyscale/commands/service_commands.py +738 -0
- anyscale/commands/session_commands_hidden.py +179 -0
- anyscale/commands/util.py +152 -0
- anyscale/commands/workspace_commands.py +511 -0
- anyscale/commands/workspace_commands_v2.py +874 -0
- anyscale/component_activity_util.py +83 -0
- anyscale/compute_config/__init__.py +84 -0
- anyscale/compute_config/_private/compute_config_sdk.py +433 -0
- anyscale/compute_config/commands.py +122 -0
- anyscale/compute_config/models.py +630 -0
- anyscale/conf.py +23 -0
- anyscale/connect.py +1323 -0
- anyscale/connect_utils/__init__.py +0 -0
- anyscale/connect_utils/prepare_cluster.py +962 -0
- anyscale/connect_utils/project.py +298 -0
- anyscale/connect_utils/start_interactive_session.py +437 -0
- anyscale/controllers/__init__.py +0 -0
- anyscale/controllers/auth_controller.py +134 -0
- anyscale/controllers/base_controller.py +52 -0
- anyscale/controllers/cloud_controller.py +3609 -0
- anyscale/controllers/cloud_functional_verification_controller.py +858 -0
- anyscale/controllers/cluster_controller.py +720 -0
- anyscale/controllers/cluster_env_controller.py +219 -0
- anyscale/controllers/compute_config_controller.py +351 -0
- anyscale/controllers/config_controller.py +422 -0
- anyscale/controllers/experimental_integrations_controller.py +80 -0
- anyscale/controllers/job_controller.py +647 -0
- anyscale/controllers/jobs_bg_controller.py +0 -0
- anyscale/controllers/list_controller.py +290 -0
- anyscale/controllers/llm/__init__.py +0 -0
- anyscale/controllers/llm/models_controller.py +144 -0
- anyscale/controllers/logs_controller.py +449 -0
- anyscale/controllers/machine_controller.py +37 -0
- anyscale/controllers/machine_pool_controller.py +86 -0
- anyscale/controllers/project_controller.py +281 -0
- anyscale/controllers/resource_quota_controller.py +183 -0
- anyscale/controllers/schedule_controller.py +333 -0
- anyscale/controllers/service_account_controller.py +168 -0
- anyscale/controllers/service_controller.py +453 -0
- anyscale/controllers/workspace_controller.py +253 -0
- anyscale/feature_flags.py +4 -0
- anyscale/fingerprint.py +62 -0
- anyscale/formatters/__init__.py +0 -0
- anyscale/formatters/clouds_formatter.py +65 -0
- anyscale/formatters/common_formatter.py +22 -0
- anyscale/gcp_verification.py +792 -0
- anyscale/image/__init__.py +73 -0
- anyscale/image/_private/image_sdk.py +202 -0
- anyscale/image/commands.py +117 -0
- anyscale/image/models.py +57 -0
- anyscale/integrations.py +329 -0
- anyscale/job/__init__.py +166 -0
- anyscale/job/_private/job_sdk.py +497 -0
- anyscale/job/commands.py +267 -0
- anyscale/job/models.py +500 -0
- anyscale/links.py +4 -0
- anyscale/llm/__init__.py +2 -0
- anyscale/llm/dataset/__init__.py +2 -0
- anyscale/llm/dataset/_private/__init__.py +0 -0
- anyscale/llm/dataset/_private/docs.py +63 -0
- anyscale/llm/dataset/_private/models.py +71 -0
- anyscale/llm/dataset/_private/sdk.py +147 -0
- anyscale/llm/model/__init__.py +2 -0
- anyscale/llm/model/_private/models_sdk.py +62 -0
- anyscale/llm/model/commands.py +93 -0
- anyscale/llm/model/models.py +171 -0
- anyscale/llm/model/sdk.py +62 -0
- anyscale/llm/sdk.py +27 -0
- anyscale/memorydb_supported_zones.json +22 -0
- anyscale/models/job_model.py +457 -0
- anyscale/models/service_model.py +125 -0
- anyscale/project.py +501 -0
- anyscale/schedule/__init__.py +91 -0
- anyscale/schedule/_private/schedule_sdk.py +165 -0
- anyscale/schedule/commands.py +149 -0
- anyscale/schedule/models.py +145 -0
- anyscale/scripts.py +164 -0
- anyscale/sdk/anyscale_client/__init__.py +235 -0
- anyscale/sdk/anyscale_client/api/__init__.py +6 -0
- anyscale/sdk/anyscale_client/api/default_api.py +11625 -0
- anyscale/sdk/anyscale_client/api_client.py +647 -0
- anyscale/sdk/anyscale_client/configuration.py +373 -0
- anyscale/sdk/anyscale_client/exceptions.py +120 -0
- anyscale/sdk/anyscale_client/models/__init__.py +220 -0
- anyscale/sdk/anyscale_client/models/access_config.py +122 -0
- anyscale/sdk/anyscale_client/models/app_config.py +436 -0
- anyscale/sdk/anyscale_client/models/app_config_config_schema.py +235 -0
- anyscale/sdk/anyscale_client/models/appconfig_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/appconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/apply_production_service_v2_model.py +490 -0
- anyscale/sdk/anyscale_client/models/apply_service_model.py +490 -0
- anyscale/sdk/anyscale_client/models/archive_status.py +101 -0
- anyscale/sdk/anyscale_client/models/base_job_status.py +105 -0
- anyscale/sdk/anyscale_client/models/baseimagesenum.py +2130 -0
- anyscale/sdk/anyscale_client/models/build.py +607 -0
- anyscale/sdk/anyscale_client/models/build_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/build_log_response.py +123 -0
- anyscale/sdk/anyscale_client/models/build_response.py +121 -0
- anyscale/sdk/anyscale_client/models/build_status.py +104 -0
- anyscale/sdk/anyscale_client/models/buildlogresponse_response.py +121 -0
- anyscale/sdk/anyscale_client/models/cloud.py +802 -0
- anyscale/sdk/anyscale_client/models/cloud_config.py +206 -0
- anyscale/sdk/anyscale_client/models/cloud_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/cloud_providers.py +103 -0
- anyscale/sdk/anyscale_client/models/cloud_response.py +121 -0
- anyscale/sdk/anyscale_client/models/cloud_state.py +104 -0
- anyscale/sdk/anyscale_client/models/cloud_status.py +100 -0
- anyscale/sdk/anyscale_client/models/cloud_type.py +100 -0
- anyscale/sdk/anyscale_client/models/cloud_types.py +100 -0
- anyscale/sdk/anyscale_client/models/cloud_version.py +100 -0
- anyscale/sdk/anyscale_client/models/clouds_query.py +150 -0
- anyscale/sdk/anyscale_client/models/cluster.py +721 -0
- anyscale/sdk/anyscale_client/models/cluster_compute.py +415 -0
- anyscale/sdk/anyscale_client/models/cluster_compute_config.py +461 -0
- anyscale/sdk/anyscale_client/models/cluster_computes_query.py +293 -0
- anyscale/sdk/anyscale_client/models/cluster_environment.py +380 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build.py +578 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build_log_response.py +123 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build_operation.py +237 -0
- anyscale/sdk/anyscale_client/models/cluster_environment_build_status.py +104 -0
- anyscale/sdk/anyscale_client/models/cluster_environments_query.py +290 -0
- anyscale/sdk/anyscale_client/models/cluster_head_node_info.py +152 -0
- anyscale/sdk/anyscale_client/models/cluster_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/cluster_management_stack_versions.py +100 -0
- anyscale/sdk/anyscale_client/models/cluster_operation.py +266 -0
- anyscale/sdk/anyscale_client/models/cluster_operation_type.py +101 -0
- anyscale/sdk/anyscale_client/models/cluster_response.py +121 -0
- anyscale/sdk/anyscale_client/models/cluster_services_urls.py +430 -0
- anyscale/sdk/anyscale_client/models/cluster_state.py +108 -0
- anyscale/sdk/anyscale_client/models/cluster_status.py +104 -0
- anyscale/sdk/anyscale_client/models/cluster_status_details.py +100 -0
- anyscale/sdk/anyscale_client/models/clustercompute_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/clustercompute_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironment_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/clusterenvironment_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuild_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuild_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuildlogresponse_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusterenvironmentbuildoperation_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusteroperation_response.py +121 -0
- anyscale/sdk/anyscale_client/models/clusters_query.py +234 -0
- anyscale/sdk/anyscale_client/models/compute_node_type.py +292 -0
- anyscale/sdk/anyscale_client/models/compute_stack.py +100 -0
- anyscale/sdk/anyscale_client/models/compute_template.py +415 -0
- anyscale/sdk/anyscale_client/models/compute_template_config.py +461 -0
- anyscale/sdk/anyscale_client/models/compute_template_query.py +316 -0
- anyscale/sdk/anyscale_client/models/computetemplate_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/computetemplate_response.py +121 -0
- anyscale/sdk/anyscale_client/models/computetemplateconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/create_app_config.py +235 -0
- anyscale/sdk/anyscale_client/models/create_app_config_configuration_schema.py +235 -0
- anyscale/sdk/anyscale_client/models/create_build.py +263 -0
- anyscale/sdk/anyscale_client/models/create_byod_app_config_configuration_schema.py +206 -0
- anyscale/sdk/anyscale_client/models/create_byod_cluster_environment.py +180 -0
- anyscale/sdk/anyscale_client/models/create_byod_cluster_environment_build.py +152 -0
- anyscale/sdk/anyscale_client/models/create_byod_cluster_environment_configuration_schema.py +208 -0
- anyscale/sdk/anyscale_client/models/create_cloud.py +518 -0
- anyscale/sdk/anyscale_client/models/create_cluster.py +376 -0
- anyscale/sdk/anyscale_client/models/create_cluster_compute.py +229 -0
- anyscale/sdk/anyscale_client/models/create_cluster_compute_config.py +463 -0
- anyscale/sdk/anyscale_client/models/create_cluster_environment.py +235 -0
- anyscale/sdk/anyscale_client/models/create_cluster_environment_build.py +263 -0
- anyscale/sdk/anyscale_client/models/create_cluster_environment_configuration_schema.py +235 -0
- anyscale/sdk/anyscale_client/models/create_compute_template.py +229 -0
- anyscale/sdk/anyscale_client/models/create_compute_template_config.py +464 -0
- anyscale/sdk/anyscale_client/models/create_job_queue_config.py +206 -0
- anyscale/sdk/anyscale_client/models/create_production_job.py +234 -0
- anyscale/sdk/anyscale_client/models/create_production_job_config.py +347 -0
- anyscale/sdk/anyscale_client/models/create_project.py +207 -0
- anyscale/sdk/anyscale_client/models/create_schedule.py +263 -0
- anyscale/sdk/anyscale_client/models/create_session.py +432 -0
- anyscale/sdk/anyscale_client/models/create_session_command.py +152 -0
- anyscale/sdk/anyscale_client/models/create_sso_config.py +150 -0
- anyscale/sdk/anyscale_client/models/grpc_protocol_config.py +178 -0
- anyscale/sdk/anyscale_client/models/ha_job_goal_states.py +102 -0
- anyscale/sdk/anyscale_client/models/ha_job_states.py +109 -0
- anyscale/sdk/anyscale_client/models/http_protocol_config.py +150 -0
- anyscale/sdk/anyscale_client/models/http_validation_error.py +120 -0
- anyscale/sdk/anyscale_client/models/idle_termination_status.py +104 -0
- anyscale/sdk/anyscale_client/models/job.py +466 -0
- anyscale/sdk/anyscale_client/models/job_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/job_queue_config.py +122 -0
- anyscale/sdk/anyscale_client/models/job_queue_execution_mode.py +101 -0
- anyscale/sdk/anyscale_client/models/job_queue_spec.py +263 -0
- anyscale/sdk/anyscale_client/models/job_run_type.py +101 -0
- anyscale/sdk/anyscale_client/models/job_status.py +105 -0
- anyscale/sdk/anyscale_client/models/jobs_query.py +458 -0
- anyscale/sdk/anyscale_client/models/jobs_sort_field.py +104 -0
- anyscale/sdk/anyscale_client/models/list_response_metadata.py +146 -0
- anyscale/sdk/anyscale_client/models/list_service_model.py +347 -0
- anyscale/sdk/anyscale_client/models/listservicemodel_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/log_download_result.py +207 -0
- anyscale/sdk/anyscale_client/models/log_file_chunk.py +439 -0
- anyscale/sdk/anyscale_client/models/log_level_types.py +100 -0
- anyscale/sdk/anyscale_client/models/log_stream.py +151 -0
- anyscale/sdk/anyscale_client/models/logdownloadresult_response.py +121 -0
- anyscale/sdk/anyscale_client/models/logstream_response.py +121 -0
- anyscale/sdk/anyscale_client/models/node_type.py +100 -0
- anyscale/sdk/anyscale_client/models/object_storage_config.py +122 -0
- anyscale/sdk/anyscale_client/models/object_storage_config_s3.py +256 -0
- anyscale/sdk/anyscale_client/models/objectstorageconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/operation_error.py +123 -0
- anyscale/sdk/anyscale_client/models/operation_progress.py +123 -0
- anyscale/sdk/anyscale_client/models/operation_result.py +150 -0
- anyscale/sdk/anyscale_client/models/organization.py +209 -0
- anyscale/sdk/anyscale_client/models/organization_response.py +121 -0
- anyscale/sdk/anyscale_client/models/page_query.py +153 -0
- anyscale/sdk/anyscale_client/models/pause_schedule.py +123 -0
- anyscale/sdk/anyscale_client/models/production_job.py +437 -0
- anyscale/sdk/anyscale_client/models/production_job_config.py +348 -0
- anyscale/sdk/anyscale_client/models/production_job_state_transition.py +293 -0
- anyscale/sdk/anyscale_client/models/production_service_v2_model.py +612 -0
- anyscale/sdk/anyscale_client/models/production_service_v2_version_model.py +437 -0
- anyscale/sdk/anyscale_client/models/productionjob_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/productionjob_response.py +121 -0
- anyscale/sdk/anyscale_client/models/productionservicev2_model_response.py +121 -0
- anyscale/sdk/anyscale_client/models/project.py +467 -0
- anyscale/sdk/anyscale_client/models/project_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/project_response.py +121 -0
- anyscale/sdk/anyscale_client/models/projects_query.py +234 -0
- anyscale/sdk/anyscale_client/models/protocols.py +150 -0
- anyscale/sdk/anyscale_client/models/python_modules.py +150 -0
- anyscale/sdk/anyscale_client/models/python_version.py +105 -0
- anyscale/sdk/anyscale_client/models/ray_gcs_external_storage_config.py +178 -0
- anyscale/sdk/anyscale_client/models/ray_runtime_env_config.py +262 -0
- anyscale/sdk/anyscale_client/models/resources.py +234 -0
- anyscale/sdk/anyscale_client/models/rollback_service_model.py +122 -0
- anyscale/sdk/anyscale_client/models/rollout_strategy.py +100 -0
- anyscale/sdk/anyscale_client/models/runtime_environment.py +406 -0
- anyscale/sdk/anyscale_client/models/runtimeenvironment_response.py +121 -0
- anyscale/sdk/anyscale_client/models/schedule_api_model.py +467 -0
- anyscale/sdk/anyscale_client/models/schedule_config.py +151 -0
- anyscale/sdk/anyscale_client/models/scheduleapimodel_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/scheduleapimodel_response.py +121 -0
- anyscale/sdk/anyscale_client/models/service_config.py +178 -0
- anyscale/sdk/anyscale_client/models/service_event_current_state.py +108 -0
- anyscale/sdk/anyscale_client/models/service_goal_states.py +100 -0
- anyscale/sdk/anyscale_client/models/service_model.py +612 -0
- anyscale/sdk/anyscale_client/models/service_observability_urls.py +206 -0
- anyscale/sdk/anyscale_client/models/service_sort_field.py +101 -0
- anyscale/sdk/anyscale_client/models/service_type.py +100 -0
- anyscale/sdk/anyscale_client/models/service_version_state.py +106 -0
- anyscale/sdk/anyscale_client/models/servicemodel_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/servicemodel_response.py +121 -0
- anyscale/sdk/anyscale_client/models/session.py +1535 -0
- anyscale/sdk/anyscale_client/models/session_command.py +350 -0
- anyscale/sdk/anyscale_client/models/session_command_types.py +100 -0
- anyscale/sdk/anyscale_client/models/session_event.py +267 -0
- anyscale/sdk/anyscale_client/models/session_event_cause.py +150 -0
- anyscale/sdk/anyscale_client/models/session_event_types.py +111 -0
- anyscale/sdk/anyscale_client/models/session_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/session_operation.py +266 -0
- anyscale/sdk/anyscale_client/models/session_operation_type.py +101 -0
- anyscale/sdk/anyscale_client/models/session_response.py +121 -0
- anyscale/sdk/anyscale_client/models/session_starting_up_data.py +146 -0
- anyscale/sdk/anyscale_client/models/session_state.py +111 -0
- anyscale/sdk/anyscale_client/models/session_state_data.py +146 -0
- anyscale/sdk/anyscale_client/models/session_stopping_data.py +146 -0
- anyscale/sdk/anyscale_client/models/sessioncommand_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/sessioncommand_response.py +121 -0
- anyscale/sdk/anyscale_client/models/sessionevent_list_response.py +147 -0
- anyscale/sdk/anyscale_client/models/sessionoperation_response.py +121 -0
- anyscale/sdk/anyscale_client/models/sessions_query.py +206 -0
- anyscale/sdk/anyscale_client/models/sort_by_clause_jobs_sort_field.py +148 -0
- anyscale/sdk/anyscale_client/models/sort_order.py +100 -0
- anyscale/sdk/anyscale_client/models/sso_config.py +237 -0
- anyscale/sdk/anyscale_client/models/sso_mode.py +101 -0
- anyscale/sdk/anyscale_client/models/ssoconfig_response.py +121 -0
- anyscale/sdk/anyscale_client/models/start_cluster_options.py +178 -0
- anyscale/sdk/anyscale_client/models/start_session_options.py +206 -0
- anyscale/sdk/anyscale_client/models/static_sso_config.py +210 -0
- anyscale/sdk/anyscale_client/models/supportedbaseimagesenum.py +1570 -0
- anyscale/sdk/anyscale_client/models/terminate_cluster_options.py +122 -0
- anyscale/sdk/anyscale_client/models/terminate_session_options.py +206 -0
- anyscale/sdk/anyscale_client/models/text_query.py +178 -0
- anyscale/sdk/anyscale_client/models/tracing_config.py +178 -0
- anyscale/sdk/anyscale_client/models/update_app_config.py +122 -0
- anyscale/sdk/anyscale_client/models/update_cloud.py +150 -0
- anyscale/sdk/anyscale_client/models/update_cluster.py +206 -0
- anyscale/sdk/anyscale_client/models/update_compute_template.py +146 -0
- anyscale/sdk/anyscale_client/models/update_compute_template_config.py +464 -0
- anyscale/sdk/anyscale_client/models/update_organization.py +123 -0
- anyscale/sdk/anyscale_client/models/update_project.py +150 -0
- anyscale/sdk/anyscale_client/models/update_session.py +150 -0
- anyscale/sdk/anyscale_client/models/user_service_access_types.py +100 -0
- anyscale/sdk/anyscale_client/models/ux_instance.py +468 -0
- anyscale/sdk/anyscale_client/models/validation_error.py +175 -0
- anyscale/sdk/anyscale_client/models/worker_node_type.py +404 -0
- anyscale/sdk/anyscale_client/rest.py +296 -0
- anyscale/sdk/anyscale_client/sdk.py +634 -0
- anyscale/service/__init__.py +168 -0
- anyscale/service/_private/service_sdk.py +702 -0
- anyscale/service/commands.py +261 -0
- anyscale/service/models.py +671 -0
- anyscale/shared_anyscale_utils/__init__.py +1 -0
- anyscale/shared_anyscale_utils/aws.py +153 -0
- anyscale/shared_anyscale_utils/bytes_util.py +10 -0
- anyscale/shared_anyscale_utils/conf.py +47 -0
- anyscale/shared_anyscale_utils/default_anyscale_aws.yaml +74 -0
- anyscale/shared_anyscale_utils/default_anyscale_gcp.yaml +80 -0
- anyscale/shared_anyscale_utils/headers.py +38 -0
- anyscale/shared_anyscale_utils/latest_ray_version.py +2 -0
- anyscale/shared_anyscale_utils/project.py +15 -0
- anyscale/shared_anyscale_utils/test_util.py +22 -0
- anyscale/shared_anyscale_utils/tests/__init__.py +1 -0
- anyscale/shared_anyscale_utils/tests/test_asyncio.py +41 -0
- anyscale/shared_anyscale_utils/tests/test_ray_semver.py +63 -0
- anyscale/shared_anyscale_utils/util.py +50 -0
- anyscale/shared_anyscale_utils/utils/__init__.py +2 -0
- anyscale/shared_anyscale_utils/utils/asyncio.py +120 -0
- anyscale/shared_anyscale_utils/utils/byod.py +40 -0
- anyscale/shared_anyscale_utils/utils/collections.py +33 -0
- anyscale/shared_anyscale_utils/utils/id_gen.py +147 -0
- anyscale/shared_anyscale_utils/utils/protected_string.py +89 -0
- anyscale/shared_anyscale_utils/utils/ray_semver.py +81 -0
- anyscale/snapshot.py +46 -0
- anyscale/tables.py +82 -0
- anyscale/util.py +1155 -0
- anyscale/utils/__init__.py +0 -0
- anyscale/utils/cli_version_check_util.py +63 -0
- anyscale/utils/cloud_update_utils.py +862 -0
- anyscale/utils/cloud_utils.py +317 -0
- anyscale/utils/cluster_debug.py +191 -0
- anyscale/utils/connect_helpers.py +155 -0
- anyscale/utils/deprecation_util.py +32 -0
- anyscale/utils/entity_arg_utils.py +43 -0
- anyscale/utils/env_utils.py +17 -0
- anyscale/utils/gcp_managed_setup_utils.py +888 -0
- anyscale/utils/gcp_utils.py +312 -0
- anyscale/utils/imports/__init__.py +0 -0
- anyscale/utils/imports/all.py +13 -0
- anyscale/utils/imports/azure.py +14 -0
- anyscale/utils/imports/gcp.py +59 -0
- anyscale/utils/logs_utils.py +141 -0
- anyscale/utils/name_utils.py +33 -0
- anyscale/utils/network_verification.py +153 -0
- anyscale/utils/ray_utils.py +128 -0
- anyscale/utils/ray_version_checker.py +48 -0
- anyscale/utils/ray_version_utils.py +53 -0
- anyscale/utils/runtime_env.py +487 -0
- anyscale/utils/s3.py +92 -0
- anyscale/utils/user_utils.py +17 -0
- anyscale/utils/workload_types.py +7 -0
- anyscale/utils/workspace_notification.py +39 -0
- anyscale/utils/workspace_utils.py +65 -0
- anyscale/version.py +1 -0
- anyscale/webterminal/__init__.py +0 -0
- anyscale/webterminal/bash-preexec.sh +370 -0
- anyscale/webterminal/command_persister.py +164 -0
- anyscale/webterminal/utils.py +176 -0
- anyscale/webterminal/webterminal.py +311 -0
- anyscale/workspace/__init__.py +270 -0
- anyscale/workspace/_private/workspace_sdk.py +737 -0
- anyscale/workspace/commands.py +472 -0
- anyscale/workspace/models.py +296 -0
- anyscale/workspace_utils.py +35 -0
- anyscale-0.24.86.dist-info/LICENSE +68 -0
- anyscale-0.24.86.dist-info/METADATA +82 -0
- anyscale-0.24.86.dist-info/NOTICE +6 -0
- anyscale-0.24.86.dist-info/RECORD +1131 -0
- anyscale-0.24.86.dist-info/WHEEL +5 -0
- anyscale-0.24.86.dist-info/entry_points.txt +2 -0
- anyscale-0.24.86.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,943 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from configparser import ConfigParser
|
|
3
|
+
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type as TypingType, Union
|
|
4
|
+
|
|
5
|
+
from mypy.errorcodes import ErrorCode
|
|
6
|
+
from mypy.nodes import (
|
|
7
|
+
ARG_NAMED,
|
|
8
|
+
ARG_NAMED_OPT,
|
|
9
|
+
ARG_OPT,
|
|
10
|
+
ARG_POS,
|
|
11
|
+
ARG_STAR2,
|
|
12
|
+
MDEF,
|
|
13
|
+
Argument,
|
|
14
|
+
AssignmentStmt,
|
|
15
|
+
Block,
|
|
16
|
+
CallExpr,
|
|
17
|
+
ClassDef,
|
|
18
|
+
Context,
|
|
19
|
+
Decorator,
|
|
20
|
+
EllipsisExpr,
|
|
21
|
+
FuncBase,
|
|
22
|
+
FuncDef,
|
|
23
|
+
JsonDict,
|
|
24
|
+
MemberExpr,
|
|
25
|
+
NameExpr,
|
|
26
|
+
PassStmt,
|
|
27
|
+
PlaceholderNode,
|
|
28
|
+
RefExpr,
|
|
29
|
+
StrExpr,
|
|
30
|
+
SymbolNode,
|
|
31
|
+
SymbolTableNode,
|
|
32
|
+
TempNode,
|
|
33
|
+
TypeInfo,
|
|
34
|
+
TypeVarExpr,
|
|
35
|
+
Var,
|
|
36
|
+
)
|
|
37
|
+
from mypy.options import Options
|
|
38
|
+
from mypy.plugin import (
|
|
39
|
+
CheckerPluginInterface,
|
|
40
|
+
ClassDefContext,
|
|
41
|
+
FunctionContext,
|
|
42
|
+
MethodContext,
|
|
43
|
+
Plugin,
|
|
44
|
+
ReportConfigContext,
|
|
45
|
+
SemanticAnalyzerPluginInterface,
|
|
46
|
+
)
|
|
47
|
+
from mypy.plugins import dataclasses
|
|
48
|
+
from mypy.semanal import set_callable_name # type: ignore
|
|
49
|
+
from mypy.server.trigger import make_wildcard_trigger
|
|
50
|
+
from mypy.types import (
|
|
51
|
+
AnyType,
|
|
52
|
+
CallableType,
|
|
53
|
+
Instance,
|
|
54
|
+
NoneType,
|
|
55
|
+
Overloaded,
|
|
56
|
+
ProperType,
|
|
57
|
+
Type,
|
|
58
|
+
TypeOfAny,
|
|
59
|
+
TypeType,
|
|
60
|
+
TypeVarType,
|
|
61
|
+
UnionType,
|
|
62
|
+
get_proper_type,
|
|
63
|
+
)
|
|
64
|
+
from mypy.typevars import fill_typevars
|
|
65
|
+
from mypy.util import get_unique_redefinition_name
|
|
66
|
+
from mypy.version import __version__ as mypy_version
|
|
67
|
+
|
|
68
|
+
from pydantic.utils import is_valid_field
|
|
69
|
+
|
|
70
|
+
try:
|
|
71
|
+
from mypy.types import TypeVarDef # type: ignore[attr-defined]
|
|
72
|
+
except ImportError: # pragma: no cover
|
|
73
|
+
# Backward-compatible with TypeVarDef from Mypy 0.910.
|
|
74
|
+
from mypy.types import TypeVarType as TypeVarDef
|
|
75
|
+
|
|
76
|
+
CONFIGFILE_KEY = 'pydantic-mypy'
|
|
77
|
+
METADATA_KEY = 'pydantic-mypy-metadata'
|
|
78
|
+
BASEMODEL_FULLNAME = 'pydantic.main.BaseModel'
|
|
79
|
+
BASESETTINGS_FULLNAME = 'pydantic.env_settings.BaseSettings'
|
|
80
|
+
MODEL_METACLASS_FULLNAME = 'pydantic.main.ModelMetaclass'
|
|
81
|
+
FIELD_FULLNAME = 'pydantic.fields.Field'
|
|
82
|
+
DATACLASS_FULLNAME = 'pydantic.dataclasses.dataclass'
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def parse_mypy_version(version: str) -> Tuple[int, ...]:
|
|
86
|
+
return tuple(map(int, version.partition('+')[0].split('.')))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
MYPY_VERSION_TUPLE = parse_mypy_version(mypy_version)
|
|
90
|
+
BUILTINS_NAME = 'builtins' if MYPY_VERSION_TUPLE >= (0, 930) else '__builtins__'
|
|
91
|
+
|
|
92
|
+
# Increment version if plugin changes and mypy caches should be invalidated
|
|
93
|
+
__version__ = 2
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def plugin(version: str) -> 'TypingType[Plugin]':
|
|
97
|
+
"""
|
|
98
|
+
`version` is the mypy version string
|
|
99
|
+
|
|
100
|
+
We might want to use this to print a warning if the mypy version being used is
|
|
101
|
+
newer, or especially older, than we expect (or need).
|
|
102
|
+
"""
|
|
103
|
+
return PydanticPlugin
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class PydanticPlugin(Plugin):
|
|
107
|
+
def __init__(self, options: Options) -> None:
|
|
108
|
+
self.plugin_config = PydanticPluginConfig(options)
|
|
109
|
+
self._plugin_data = self.plugin_config.to_data()
|
|
110
|
+
super().__init__(options)
|
|
111
|
+
|
|
112
|
+
def get_base_class_hook(self, fullname: str) -> 'Optional[Callable[[ClassDefContext], None]]':
|
|
113
|
+
sym = self.lookup_fully_qualified(fullname)
|
|
114
|
+
if sym and isinstance(sym.node, TypeInfo): # pragma: no branch
|
|
115
|
+
# No branching may occur if the mypy cache has not been cleared
|
|
116
|
+
if any(get_fullname(base) == BASEMODEL_FULLNAME for base in sym.node.mro):
|
|
117
|
+
return self._pydantic_model_class_maker_callback
|
|
118
|
+
return None
|
|
119
|
+
|
|
120
|
+
def get_metaclass_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]:
|
|
121
|
+
if fullname == MODEL_METACLASS_FULLNAME:
|
|
122
|
+
return self._pydantic_model_metaclass_marker_callback
|
|
123
|
+
return None
|
|
124
|
+
|
|
125
|
+
def get_function_hook(self, fullname: str) -> 'Optional[Callable[[FunctionContext], Type]]':
|
|
126
|
+
sym = self.lookup_fully_qualified(fullname)
|
|
127
|
+
if sym and sym.fullname == FIELD_FULLNAME:
|
|
128
|
+
return self._pydantic_field_callback
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
def get_method_hook(self, fullname: str) -> Optional[Callable[[MethodContext], Type]]:
|
|
132
|
+
if fullname.endswith('.from_orm'):
|
|
133
|
+
return from_orm_callback
|
|
134
|
+
return None
|
|
135
|
+
|
|
136
|
+
def get_class_decorator_hook(self, fullname: str) -> Optional[Callable[[ClassDefContext], None]]:
|
|
137
|
+
"""Mark pydantic.dataclasses as dataclass.
|
|
138
|
+
|
|
139
|
+
Mypy version 1.1.1 added support for `@dataclass_transform` decorator.
|
|
140
|
+
"""
|
|
141
|
+
if fullname == DATACLASS_FULLNAME and MYPY_VERSION_TUPLE < (1, 1):
|
|
142
|
+
return dataclasses.dataclass_class_maker_callback # type: ignore[return-value]
|
|
143
|
+
return None
|
|
144
|
+
|
|
145
|
+
def report_config_data(self, ctx: ReportConfigContext) -> Dict[str, Any]:
|
|
146
|
+
"""Return all plugin config data.
|
|
147
|
+
|
|
148
|
+
Used by mypy to determine if cache needs to be discarded.
|
|
149
|
+
"""
|
|
150
|
+
return self._plugin_data
|
|
151
|
+
|
|
152
|
+
def _pydantic_model_class_maker_callback(self, ctx: ClassDefContext) -> None:
|
|
153
|
+
transformer = PydanticModelTransformer(ctx, self.plugin_config)
|
|
154
|
+
transformer.transform()
|
|
155
|
+
|
|
156
|
+
def _pydantic_model_metaclass_marker_callback(self, ctx: ClassDefContext) -> None:
|
|
157
|
+
"""Reset dataclass_transform_spec attribute of ModelMetaclass.
|
|
158
|
+
|
|
159
|
+
Let the plugin handle it. This behavior can be disabled
|
|
160
|
+
if 'debug_dataclass_transform' is set to True', for testing purposes.
|
|
161
|
+
"""
|
|
162
|
+
if self.plugin_config.debug_dataclass_transform:
|
|
163
|
+
return
|
|
164
|
+
info_metaclass = ctx.cls.info.declared_metaclass
|
|
165
|
+
assert info_metaclass, "callback not passed from 'get_metaclass_hook'"
|
|
166
|
+
if getattr(info_metaclass.type, 'dataclass_transform_spec', None):
|
|
167
|
+
info_metaclass.type.dataclass_transform_spec = None # type: ignore[attr-defined]
|
|
168
|
+
|
|
169
|
+
def _pydantic_field_callback(self, ctx: FunctionContext) -> 'Type':
|
|
170
|
+
"""
|
|
171
|
+
Extract the type of the `default` argument from the Field function, and use it as the return type.
|
|
172
|
+
|
|
173
|
+
In particular:
|
|
174
|
+
* Check whether the default and default_factory argument is specified.
|
|
175
|
+
* Output an error if both are specified.
|
|
176
|
+
* Retrieve the type of the argument which is specified, and use it as return type for the function.
|
|
177
|
+
"""
|
|
178
|
+
default_any_type = ctx.default_return_type
|
|
179
|
+
|
|
180
|
+
assert ctx.callee_arg_names[0] == 'default', '"default" is no longer first argument in Field()'
|
|
181
|
+
assert ctx.callee_arg_names[1] == 'default_factory', '"default_factory" is no longer second argument in Field()'
|
|
182
|
+
default_args = ctx.args[0]
|
|
183
|
+
default_factory_args = ctx.args[1]
|
|
184
|
+
|
|
185
|
+
if default_args and default_factory_args:
|
|
186
|
+
error_default_and_default_factory_specified(ctx.api, ctx.context)
|
|
187
|
+
return default_any_type
|
|
188
|
+
|
|
189
|
+
if default_args:
|
|
190
|
+
default_type = ctx.arg_types[0][0]
|
|
191
|
+
default_arg = default_args[0]
|
|
192
|
+
|
|
193
|
+
# Fallback to default Any type if the field is required
|
|
194
|
+
if not isinstance(default_arg, EllipsisExpr):
|
|
195
|
+
return default_type
|
|
196
|
+
|
|
197
|
+
elif default_factory_args:
|
|
198
|
+
default_factory_type = ctx.arg_types[1][0]
|
|
199
|
+
|
|
200
|
+
# Functions which use `ParamSpec` can be overloaded, exposing the callable's types as a parameter
|
|
201
|
+
# Pydantic calls the default factory without any argument, so we retrieve the first item
|
|
202
|
+
if isinstance(default_factory_type, Overloaded):
|
|
203
|
+
if MYPY_VERSION_TUPLE > (0, 910):
|
|
204
|
+
default_factory_type = default_factory_type.items[0]
|
|
205
|
+
else:
|
|
206
|
+
# Mypy0.910 exposes the items of overloaded types in a function
|
|
207
|
+
default_factory_type = default_factory_type.items()[0] # type: ignore[operator]
|
|
208
|
+
|
|
209
|
+
if isinstance(default_factory_type, CallableType):
|
|
210
|
+
ret_type = default_factory_type.ret_type
|
|
211
|
+
# mypy doesn't think `ret_type` has `args`, you'd think mypy should know,
|
|
212
|
+
# add this check in case it varies by version
|
|
213
|
+
args = getattr(ret_type, 'args', None)
|
|
214
|
+
if args:
|
|
215
|
+
if all(isinstance(arg, TypeVarType) for arg in args):
|
|
216
|
+
# Looks like the default factory is a type like `list` or `dict`, replace all args with `Any`
|
|
217
|
+
ret_type.args = tuple(default_any_type for _ in args) # type: ignore[attr-defined]
|
|
218
|
+
return ret_type
|
|
219
|
+
|
|
220
|
+
return default_any_type
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class PydanticPluginConfig:
|
|
224
|
+
__slots__ = (
|
|
225
|
+
'init_forbid_extra',
|
|
226
|
+
'init_typed',
|
|
227
|
+
'warn_required_dynamic_aliases',
|
|
228
|
+
'warn_untyped_fields',
|
|
229
|
+
'debug_dataclass_transform',
|
|
230
|
+
)
|
|
231
|
+
init_forbid_extra: bool
|
|
232
|
+
init_typed: bool
|
|
233
|
+
warn_required_dynamic_aliases: bool
|
|
234
|
+
warn_untyped_fields: bool
|
|
235
|
+
debug_dataclass_transform: bool # undocumented
|
|
236
|
+
|
|
237
|
+
def __init__(self, options: Options) -> None:
|
|
238
|
+
if options.config_file is None: # pragma: no cover
|
|
239
|
+
return
|
|
240
|
+
|
|
241
|
+
toml_config = parse_toml(options.config_file)
|
|
242
|
+
if toml_config is not None:
|
|
243
|
+
config = toml_config.get('tool', {}).get('pydantic-mypy', {})
|
|
244
|
+
for key in self.__slots__:
|
|
245
|
+
setting = config.get(key, False)
|
|
246
|
+
if not isinstance(setting, bool):
|
|
247
|
+
raise ValueError(f'Configuration value must be a boolean for key: {key}')
|
|
248
|
+
setattr(self, key, setting)
|
|
249
|
+
else:
|
|
250
|
+
plugin_config = ConfigParser()
|
|
251
|
+
plugin_config.read(options.config_file)
|
|
252
|
+
for key in self.__slots__:
|
|
253
|
+
setting = plugin_config.getboolean(CONFIGFILE_KEY, key, fallback=False)
|
|
254
|
+
setattr(self, key, setting)
|
|
255
|
+
|
|
256
|
+
def to_data(self) -> Dict[str, Any]:
|
|
257
|
+
return {key: getattr(self, key) for key in self.__slots__}
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def from_orm_callback(ctx: MethodContext) -> Type:
|
|
261
|
+
"""
|
|
262
|
+
Raise an error if orm_mode is not enabled
|
|
263
|
+
"""
|
|
264
|
+
model_type: Instance
|
|
265
|
+
ctx_type = ctx.type
|
|
266
|
+
if isinstance(ctx_type, TypeType):
|
|
267
|
+
ctx_type = ctx_type.item
|
|
268
|
+
if isinstance(ctx_type, CallableType) and isinstance(ctx_type.ret_type, Instance):
|
|
269
|
+
model_type = ctx_type.ret_type # called on the class
|
|
270
|
+
elif isinstance(ctx_type, Instance):
|
|
271
|
+
model_type = ctx_type # called on an instance (unusual, but still valid)
|
|
272
|
+
else: # pragma: no cover
|
|
273
|
+
detail = f'ctx.type: {ctx_type} (of type {ctx_type.__class__.__name__})'
|
|
274
|
+
error_unexpected_behavior(detail, ctx.api, ctx.context)
|
|
275
|
+
return ctx.default_return_type
|
|
276
|
+
pydantic_metadata = model_type.type.metadata.get(METADATA_KEY)
|
|
277
|
+
if pydantic_metadata is None:
|
|
278
|
+
return ctx.default_return_type
|
|
279
|
+
orm_mode = pydantic_metadata.get('config', {}).get('orm_mode')
|
|
280
|
+
if orm_mode is not True:
|
|
281
|
+
error_from_orm(get_name(model_type.type), ctx.api, ctx.context)
|
|
282
|
+
return ctx.default_return_type
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
class PydanticModelTransformer:
|
|
286
|
+
tracked_config_fields: Set[str] = {
|
|
287
|
+
'extra',
|
|
288
|
+
'allow_mutation',
|
|
289
|
+
'frozen',
|
|
290
|
+
'orm_mode',
|
|
291
|
+
'allow_population_by_field_name',
|
|
292
|
+
'alias_generator',
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
def __init__(self, ctx: ClassDefContext, plugin_config: PydanticPluginConfig) -> None:
|
|
296
|
+
self._ctx = ctx
|
|
297
|
+
self.plugin_config = plugin_config
|
|
298
|
+
|
|
299
|
+
def transform(self) -> None:
|
|
300
|
+
"""
|
|
301
|
+
Configures the BaseModel subclass according to the plugin settings.
|
|
302
|
+
|
|
303
|
+
In particular:
|
|
304
|
+
* determines the model config and fields,
|
|
305
|
+
* adds a fields-aware signature for the initializer and construct methods
|
|
306
|
+
* freezes the class if allow_mutation = False or frozen = True
|
|
307
|
+
* stores the fields, config, and if the class is settings in the mypy metadata for access by subclasses
|
|
308
|
+
"""
|
|
309
|
+
ctx = self._ctx
|
|
310
|
+
info = ctx.cls.info
|
|
311
|
+
|
|
312
|
+
self.adjust_validator_signatures()
|
|
313
|
+
config = self.collect_config()
|
|
314
|
+
fields = self.collect_fields(config)
|
|
315
|
+
is_settings = any(get_fullname(base) == BASESETTINGS_FULLNAME for base in info.mro[:-1])
|
|
316
|
+
self.add_initializer(fields, config, is_settings)
|
|
317
|
+
self.add_construct_method(fields)
|
|
318
|
+
self.set_frozen(fields, frozen=config.allow_mutation is False or config.frozen is True)
|
|
319
|
+
info.metadata[METADATA_KEY] = {
|
|
320
|
+
'fields': {field.name: field.serialize() for field in fields},
|
|
321
|
+
'config': config.set_values_dict(),
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
def adjust_validator_signatures(self) -> None:
|
|
325
|
+
"""When we decorate a function `f` with `pydantic.validator(...), mypy sees
|
|
326
|
+
`f` as a regular method taking a `self` instance, even though pydantic
|
|
327
|
+
internally wraps `f` with `classmethod` if necessary.
|
|
328
|
+
|
|
329
|
+
Teach mypy this by marking any function whose outermost decorator is a
|
|
330
|
+
`validator()` call as a classmethod.
|
|
331
|
+
"""
|
|
332
|
+
for name, sym in self._ctx.cls.info.names.items():
|
|
333
|
+
if isinstance(sym.node, Decorator):
|
|
334
|
+
first_dec = sym.node.original_decorators[0]
|
|
335
|
+
if (
|
|
336
|
+
isinstance(first_dec, CallExpr)
|
|
337
|
+
and isinstance(first_dec.callee, NameExpr)
|
|
338
|
+
and first_dec.callee.fullname == 'pydantic.class_validators.validator'
|
|
339
|
+
):
|
|
340
|
+
sym.node.func.is_class = True
|
|
341
|
+
|
|
342
|
+
def collect_config(self) -> 'ModelConfigData':
|
|
343
|
+
"""
|
|
344
|
+
Collects the values of the config attributes that are used by the plugin, accounting for parent classes.
|
|
345
|
+
"""
|
|
346
|
+
ctx = self._ctx
|
|
347
|
+
cls = ctx.cls
|
|
348
|
+
config = ModelConfigData()
|
|
349
|
+
for stmt in cls.defs.body:
|
|
350
|
+
if not isinstance(stmt, ClassDef):
|
|
351
|
+
continue
|
|
352
|
+
if stmt.name == 'Config':
|
|
353
|
+
for substmt in stmt.defs.body:
|
|
354
|
+
if not isinstance(substmt, AssignmentStmt):
|
|
355
|
+
continue
|
|
356
|
+
config.update(self.get_config_update(substmt))
|
|
357
|
+
if (
|
|
358
|
+
config.has_alias_generator
|
|
359
|
+
and not config.allow_population_by_field_name
|
|
360
|
+
and self.plugin_config.warn_required_dynamic_aliases
|
|
361
|
+
):
|
|
362
|
+
error_required_dynamic_aliases(ctx.api, stmt)
|
|
363
|
+
for info in cls.info.mro[1:]: # 0 is the current class
|
|
364
|
+
if METADATA_KEY not in info.metadata:
|
|
365
|
+
continue
|
|
366
|
+
|
|
367
|
+
# Each class depends on the set of fields in its ancestors
|
|
368
|
+
ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info)))
|
|
369
|
+
for name, value in info.metadata[METADATA_KEY]['config'].items():
|
|
370
|
+
config.setdefault(name, value)
|
|
371
|
+
return config
|
|
372
|
+
|
|
373
|
+
def collect_fields(self, model_config: 'ModelConfigData') -> List['PydanticModelField']:
|
|
374
|
+
"""
|
|
375
|
+
Collects the fields for the model, accounting for parent classes
|
|
376
|
+
"""
|
|
377
|
+
# First, collect fields belonging to the current class.
|
|
378
|
+
ctx = self._ctx
|
|
379
|
+
cls = self._ctx.cls
|
|
380
|
+
fields = [] # type: List[PydanticModelField]
|
|
381
|
+
known_fields = set() # type: Set[str]
|
|
382
|
+
for stmt in cls.defs.body:
|
|
383
|
+
if not isinstance(stmt, AssignmentStmt): # `and stmt.new_syntax` to require annotation
|
|
384
|
+
continue
|
|
385
|
+
|
|
386
|
+
lhs = stmt.lvalues[0]
|
|
387
|
+
if not isinstance(lhs, NameExpr) or not is_valid_field(lhs.name):
|
|
388
|
+
continue
|
|
389
|
+
|
|
390
|
+
if not stmt.new_syntax and self.plugin_config.warn_untyped_fields:
|
|
391
|
+
error_untyped_fields(ctx.api, stmt)
|
|
392
|
+
|
|
393
|
+
# if lhs.name == '__config__': # BaseConfig not well handled; I'm not sure why yet
|
|
394
|
+
# continue
|
|
395
|
+
|
|
396
|
+
sym = cls.info.names.get(lhs.name)
|
|
397
|
+
if sym is None: # pragma: no cover
|
|
398
|
+
# This is likely due to a star import (see the dataclasses plugin for a more detailed explanation)
|
|
399
|
+
# This is the same logic used in the dataclasses plugin
|
|
400
|
+
continue
|
|
401
|
+
|
|
402
|
+
node = sym.node
|
|
403
|
+
if isinstance(node, PlaceholderNode): # pragma: no cover
|
|
404
|
+
# See the PlaceholderNode docstring for more detail about how this can occur
|
|
405
|
+
# Basically, it is an edge case when dealing with complex import logic
|
|
406
|
+
# This is the same logic used in the dataclasses plugin
|
|
407
|
+
continue
|
|
408
|
+
if not isinstance(node, Var): # pragma: no cover
|
|
409
|
+
# Don't know if this edge case still happens with the `is_valid_field` check above
|
|
410
|
+
# but better safe than sorry
|
|
411
|
+
continue
|
|
412
|
+
|
|
413
|
+
# x: ClassVar[int] is ignored by dataclasses.
|
|
414
|
+
if node.is_classvar:
|
|
415
|
+
continue
|
|
416
|
+
|
|
417
|
+
is_required = self.get_is_required(cls, stmt, lhs)
|
|
418
|
+
alias, has_dynamic_alias = self.get_alias_info(stmt)
|
|
419
|
+
if (
|
|
420
|
+
has_dynamic_alias
|
|
421
|
+
and not model_config.allow_population_by_field_name
|
|
422
|
+
and self.plugin_config.warn_required_dynamic_aliases
|
|
423
|
+
):
|
|
424
|
+
error_required_dynamic_aliases(ctx.api, stmt)
|
|
425
|
+
fields.append(
|
|
426
|
+
PydanticModelField(
|
|
427
|
+
name=lhs.name,
|
|
428
|
+
is_required=is_required,
|
|
429
|
+
alias=alias,
|
|
430
|
+
has_dynamic_alias=has_dynamic_alias,
|
|
431
|
+
line=stmt.line,
|
|
432
|
+
column=stmt.column,
|
|
433
|
+
)
|
|
434
|
+
)
|
|
435
|
+
known_fields.add(lhs.name)
|
|
436
|
+
all_fields = fields.copy()
|
|
437
|
+
for info in cls.info.mro[1:]: # 0 is the current class, -2 is BaseModel, -1 is object
|
|
438
|
+
if METADATA_KEY not in info.metadata:
|
|
439
|
+
continue
|
|
440
|
+
|
|
441
|
+
superclass_fields = []
|
|
442
|
+
# Each class depends on the set of fields in its ancestors
|
|
443
|
+
ctx.api.add_plugin_dependency(make_wildcard_trigger(get_fullname(info)))
|
|
444
|
+
|
|
445
|
+
for name, data in info.metadata[METADATA_KEY]['fields'].items():
|
|
446
|
+
if name not in known_fields:
|
|
447
|
+
field = PydanticModelField.deserialize(info, data)
|
|
448
|
+
known_fields.add(name)
|
|
449
|
+
superclass_fields.append(field)
|
|
450
|
+
else:
|
|
451
|
+
(field,) = (a for a in all_fields if a.name == name)
|
|
452
|
+
all_fields.remove(field)
|
|
453
|
+
superclass_fields.append(field)
|
|
454
|
+
all_fields = superclass_fields + all_fields
|
|
455
|
+
return all_fields
|
|
456
|
+
|
|
457
|
+
def add_initializer(self, fields: List['PydanticModelField'], config: 'ModelConfigData', is_settings: bool) -> None:
|
|
458
|
+
"""
|
|
459
|
+
Adds a fields-aware `__init__` method to the class.
|
|
460
|
+
|
|
461
|
+
The added `__init__` will be annotated with types vs. all `Any` depending on the plugin settings.
|
|
462
|
+
"""
|
|
463
|
+
ctx = self._ctx
|
|
464
|
+
typed = self.plugin_config.init_typed
|
|
465
|
+
use_alias = config.allow_population_by_field_name is not True
|
|
466
|
+
force_all_optional = is_settings or bool(
|
|
467
|
+
config.has_alias_generator and not config.allow_population_by_field_name
|
|
468
|
+
)
|
|
469
|
+
init_arguments = self.get_field_arguments(
|
|
470
|
+
fields, typed=typed, force_all_optional=force_all_optional, use_alias=use_alias
|
|
471
|
+
)
|
|
472
|
+
if not self.should_init_forbid_extra(fields, config):
|
|
473
|
+
var = Var('kwargs')
|
|
474
|
+
init_arguments.append(Argument(var, AnyType(TypeOfAny.explicit), None, ARG_STAR2))
|
|
475
|
+
|
|
476
|
+
if '__init__' not in ctx.cls.info.names:
|
|
477
|
+
add_method(ctx, '__init__', init_arguments, NoneType())
|
|
478
|
+
|
|
479
|
+
def add_construct_method(self, fields: List['PydanticModelField']) -> None:
|
|
480
|
+
"""
|
|
481
|
+
Adds a fully typed `construct` classmethod to the class.
|
|
482
|
+
|
|
483
|
+
Similar to the fields-aware __init__ method, but always uses the field names (not aliases),
|
|
484
|
+
and does not treat settings fields as optional.
|
|
485
|
+
"""
|
|
486
|
+
ctx = self._ctx
|
|
487
|
+
set_str = ctx.api.named_type(f'{BUILTINS_NAME}.set', [ctx.api.named_type(f'{BUILTINS_NAME}.str')])
|
|
488
|
+
optional_set_str = UnionType([set_str, NoneType()])
|
|
489
|
+
fields_set_argument = Argument(Var('_fields_set', optional_set_str), optional_set_str, None, ARG_OPT)
|
|
490
|
+
construct_arguments = self.get_field_arguments(fields, typed=True, force_all_optional=False, use_alias=False)
|
|
491
|
+
construct_arguments = [fields_set_argument] + construct_arguments
|
|
492
|
+
|
|
493
|
+
obj_type = ctx.api.named_type(f'{BUILTINS_NAME}.object')
|
|
494
|
+
self_tvar_name = '_PydanticBaseModel' # Make sure it does not conflict with other names in the class
|
|
495
|
+
tvar_fullname = ctx.cls.fullname + '.' + self_tvar_name
|
|
496
|
+
if MYPY_VERSION_TUPLE >= (1, 4):
|
|
497
|
+
tvd = TypeVarType(
|
|
498
|
+
self_tvar_name,
|
|
499
|
+
tvar_fullname,
|
|
500
|
+
-1,
|
|
501
|
+
[],
|
|
502
|
+
obj_type,
|
|
503
|
+
AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]
|
|
504
|
+
)
|
|
505
|
+
self_tvar_expr = TypeVarExpr(
|
|
506
|
+
self_tvar_name,
|
|
507
|
+
tvar_fullname,
|
|
508
|
+
[],
|
|
509
|
+
obj_type,
|
|
510
|
+
AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]
|
|
511
|
+
)
|
|
512
|
+
else:
|
|
513
|
+
tvd = TypeVarDef(self_tvar_name, tvar_fullname, -1, [], obj_type)
|
|
514
|
+
self_tvar_expr = TypeVarExpr(self_tvar_name, tvar_fullname, [], obj_type)
|
|
515
|
+
ctx.cls.info.names[self_tvar_name] = SymbolTableNode(MDEF, self_tvar_expr)
|
|
516
|
+
|
|
517
|
+
# Backward-compatible with TypeVarDef from Mypy 0.910.
|
|
518
|
+
if isinstance(tvd, TypeVarType):
|
|
519
|
+
self_type = tvd
|
|
520
|
+
else:
|
|
521
|
+
self_type = TypeVarType(tvd)
|
|
522
|
+
|
|
523
|
+
add_method(
|
|
524
|
+
ctx,
|
|
525
|
+
'construct',
|
|
526
|
+
construct_arguments,
|
|
527
|
+
return_type=self_type,
|
|
528
|
+
self_type=self_type,
|
|
529
|
+
tvar_def=tvd,
|
|
530
|
+
is_classmethod=True,
|
|
531
|
+
)
|
|
532
|
+
|
|
533
|
+
def set_frozen(self, fields: List['PydanticModelField'], frozen: bool) -> None:
|
|
534
|
+
"""
|
|
535
|
+
Marks all fields as properties so that attempts to set them trigger mypy errors.
|
|
536
|
+
|
|
537
|
+
This is the same approach used by the attrs and dataclasses plugins.
|
|
538
|
+
"""
|
|
539
|
+
ctx = self._ctx
|
|
540
|
+
info = ctx.cls.info
|
|
541
|
+
for field in fields:
|
|
542
|
+
sym_node = info.names.get(field.name)
|
|
543
|
+
if sym_node is not None:
|
|
544
|
+
var = sym_node.node
|
|
545
|
+
if isinstance(var, Var):
|
|
546
|
+
var.is_property = frozen
|
|
547
|
+
elif isinstance(var, PlaceholderNode) and not ctx.api.final_iteration:
|
|
548
|
+
# See https://github.com/pydantic/pydantic/issues/5191 to hit this branch for test coverage
|
|
549
|
+
ctx.api.defer()
|
|
550
|
+
else: # pragma: no cover
|
|
551
|
+
# I don't know whether it's possible to hit this branch, but I've added it for safety
|
|
552
|
+
try:
|
|
553
|
+
var_str = str(var)
|
|
554
|
+
except TypeError:
|
|
555
|
+
# This happens for PlaceholderNode; perhaps it will happen for other types in the future..
|
|
556
|
+
var_str = repr(var)
|
|
557
|
+
detail = f'sym_node.node: {var_str} (of type {var.__class__})'
|
|
558
|
+
error_unexpected_behavior(detail, ctx.api, ctx.cls)
|
|
559
|
+
else:
|
|
560
|
+
var = field.to_var(info, use_alias=False)
|
|
561
|
+
var.info = info
|
|
562
|
+
var.is_property = frozen
|
|
563
|
+
var._fullname = get_fullname(info) + '.' + get_name(var)
|
|
564
|
+
info.names[get_name(var)] = SymbolTableNode(MDEF, var)
|
|
565
|
+
|
|
566
|
+
def get_config_update(self, substmt: AssignmentStmt) -> Optional['ModelConfigData']:
|
|
567
|
+
"""
|
|
568
|
+
Determines the config update due to a single statement in the Config class definition.
|
|
569
|
+
|
|
570
|
+
Warns if a tracked config attribute is set to a value the plugin doesn't know how to interpret (e.g., an int)
|
|
571
|
+
"""
|
|
572
|
+
lhs = substmt.lvalues[0]
|
|
573
|
+
if not (isinstance(lhs, NameExpr) and lhs.name in self.tracked_config_fields):
|
|
574
|
+
return None
|
|
575
|
+
if lhs.name == 'extra':
|
|
576
|
+
if isinstance(substmt.rvalue, StrExpr):
|
|
577
|
+
forbid_extra = substmt.rvalue.value == 'forbid'
|
|
578
|
+
elif isinstance(substmt.rvalue, MemberExpr):
|
|
579
|
+
forbid_extra = substmt.rvalue.name == 'forbid'
|
|
580
|
+
else:
|
|
581
|
+
error_invalid_config_value(lhs.name, self._ctx.api, substmt)
|
|
582
|
+
return None
|
|
583
|
+
return ModelConfigData(forbid_extra=forbid_extra)
|
|
584
|
+
if lhs.name == 'alias_generator':
|
|
585
|
+
has_alias_generator = True
|
|
586
|
+
if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname == 'builtins.None':
|
|
587
|
+
has_alias_generator = False
|
|
588
|
+
return ModelConfigData(has_alias_generator=has_alias_generator)
|
|
589
|
+
if isinstance(substmt.rvalue, NameExpr) and substmt.rvalue.fullname in ('builtins.True', 'builtins.False'):
|
|
590
|
+
return ModelConfigData(**{lhs.name: substmt.rvalue.fullname == 'builtins.True'})
|
|
591
|
+
error_invalid_config_value(lhs.name, self._ctx.api, substmt)
|
|
592
|
+
return None
|
|
593
|
+
|
|
594
|
+
@staticmethod
|
|
595
|
+
def get_is_required(cls: ClassDef, stmt: AssignmentStmt, lhs: NameExpr) -> bool:
|
|
596
|
+
"""
|
|
597
|
+
Returns a boolean indicating whether the field defined in `stmt` is a required field.
|
|
598
|
+
"""
|
|
599
|
+
expr = stmt.rvalue
|
|
600
|
+
if isinstance(expr, TempNode):
|
|
601
|
+
# TempNode means annotation-only, so only non-required if Optional
|
|
602
|
+
value_type = get_proper_type(cls.info[lhs.name].type)
|
|
603
|
+
return not PydanticModelTransformer.type_has_implicit_default(value_type)
|
|
604
|
+
if isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME:
|
|
605
|
+
# The "default value" is a call to `Field`; at this point, the field is
|
|
606
|
+
# only required if default is Ellipsis (i.e., `field_name: Annotation = Field(...)`) or if default_factory
|
|
607
|
+
# is specified.
|
|
608
|
+
for arg, name in zip(expr.args, expr.arg_names):
|
|
609
|
+
# If name is None, then this arg is the default because it is the only positional argument.
|
|
610
|
+
if name is None or name == 'default':
|
|
611
|
+
return arg.__class__ is EllipsisExpr
|
|
612
|
+
if name == 'default_factory':
|
|
613
|
+
return False
|
|
614
|
+
# In this case, default and default_factory are not specified, so we need to look at the annotation
|
|
615
|
+
value_type = get_proper_type(cls.info[lhs.name].type)
|
|
616
|
+
return not PydanticModelTransformer.type_has_implicit_default(value_type)
|
|
617
|
+
# Only required if the "default value" is Ellipsis (i.e., `field_name: Annotation = ...`)
|
|
618
|
+
return isinstance(expr, EllipsisExpr)
|
|
619
|
+
|
|
620
|
+
@staticmethod
|
|
621
|
+
def type_has_implicit_default(type_: Optional[ProperType]) -> bool:
|
|
622
|
+
"""
|
|
623
|
+
Returns True if the passed type will be given an implicit default value.
|
|
624
|
+
|
|
625
|
+
In pydantic v1, this is the case for Optional types and Any (with default value None).
|
|
626
|
+
"""
|
|
627
|
+
if isinstance(type_, AnyType):
|
|
628
|
+
# Annotated as Any
|
|
629
|
+
return True
|
|
630
|
+
if isinstance(type_, UnionType) and any(
|
|
631
|
+
isinstance(item, NoneType) or isinstance(item, AnyType) for item in type_.items
|
|
632
|
+
):
|
|
633
|
+
# Annotated as Optional, or otherwise having NoneType or AnyType in the union
|
|
634
|
+
return True
|
|
635
|
+
return False
|
|
636
|
+
|
|
637
|
+
@staticmethod
|
|
638
|
+
def get_alias_info(stmt: AssignmentStmt) -> Tuple[Optional[str], bool]:
|
|
639
|
+
"""
|
|
640
|
+
Returns a pair (alias, has_dynamic_alias), extracted from the declaration of the field defined in `stmt`.
|
|
641
|
+
|
|
642
|
+
`has_dynamic_alias` is True if and only if an alias is provided, but not as a string literal.
|
|
643
|
+
If `has_dynamic_alias` is True, `alias` will be None.
|
|
644
|
+
"""
|
|
645
|
+
expr = stmt.rvalue
|
|
646
|
+
if isinstance(expr, TempNode):
|
|
647
|
+
# TempNode means annotation-only
|
|
648
|
+
return None, False
|
|
649
|
+
|
|
650
|
+
if not (
|
|
651
|
+
isinstance(expr, CallExpr) and isinstance(expr.callee, RefExpr) and expr.callee.fullname == FIELD_FULLNAME
|
|
652
|
+
):
|
|
653
|
+
# Assigned value is not a call to pydantic.fields.Field
|
|
654
|
+
return None, False
|
|
655
|
+
|
|
656
|
+
for i, arg_name in enumerate(expr.arg_names):
|
|
657
|
+
if arg_name != 'alias':
|
|
658
|
+
continue
|
|
659
|
+
arg = expr.args[i]
|
|
660
|
+
if isinstance(arg, StrExpr):
|
|
661
|
+
return arg.value, False
|
|
662
|
+
else:
|
|
663
|
+
return None, True
|
|
664
|
+
return None, False
|
|
665
|
+
|
|
666
|
+
def get_field_arguments(
|
|
667
|
+
self, fields: List['PydanticModelField'], typed: bool, force_all_optional: bool, use_alias: bool
|
|
668
|
+
) -> List[Argument]:
|
|
669
|
+
"""
|
|
670
|
+
Helper function used during the construction of the `__init__` and `construct` method signatures.
|
|
671
|
+
|
|
672
|
+
Returns a list of mypy Argument instances for use in the generated signatures.
|
|
673
|
+
"""
|
|
674
|
+
info = self._ctx.cls.info
|
|
675
|
+
arguments = [
|
|
676
|
+
field.to_argument(info, typed=typed, force_optional=force_all_optional, use_alias=use_alias)
|
|
677
|
+
for field in fields
|
|
678
|
+
if not (use_alias and field.has_dynamic_alias)
|
|
679
|
+
]
|
|
680
|
+
return arguments
|
|
681
|
+
|
|
682
|
+
def should_init_forbid_extra(self, fields: List['PydanticModelField'], config: 'ModelConfigData') -> bool:
|
|
683
|
+
"""
|
|
684
|
+
Indicates whether the generated `__init__` should get a `**kwargs` at the end of its signature
|
|
685
|
+
|
|
686
|
+
We disallow arbitrary kwargs if the extra config setting is "forbid", or if the plugin config says to,
|
|
687
|
+
*unless* a required dynamic alias is present (since then we can't determine a valid signature).
|
|
688
|
+
"""
|
|
689
|
+
if not config.allow_population_by_field_name:
|
|
690
|
+
if self.is_dynamic_alias_present(fields, bool(config.has_alias_generator)):
|
|
691
|
+
return False
|
|
692
|
+
if config.forbid_extra:
|
|
693
|
+
return True
|
|
694
|
+
return self.plugin_config.init_forbid_extra
|
|
695
|
+
|
|
696
|
+
@staticmethod
|
|
697
|
+
def is_dynamic_alias_present(fields: List['PydanticModelField'], has_alias_generator: bool) -> bool:
|
|
698
|
+
"""
|
|
699
|
+
Returns whether any fields on the model have a "dynamic alias", i.e., an alias that cannot be
|
|
700
|
+
determined during static analysis.
|
|
701
|
+
"""
|
|
702
|
+
for field in fields:
|
|
703
|
+
if field.has_dynamic_alias:
|
|
704
|
+
return True
|
|
705
|
+
if has_alias_generator:
|
|
706
|
+
for field in fields:
|
|
707
|
+
if field.alias is None:
|
|
708
|
+
return True
|
|
709
|
+
return False
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
class PydanticModelField:
|
|
713
|
+
def __init__(
|
|
714
|
+
self, name: str, is_required: bool, alias: Optional[str], has_dynamic_alias: bool, line: int, column: int
|
|
715
|
+
):
|
|
716
|
+
self.name = name
|
|
717
|
+
self.is_required = is_required
|
|
718
|
+
self.alias = alias
|
|
719
|
+
self.has_dynamic_alias = has_dynamic_alias
|
|
720
|
+
self.line = line
|
|
721
|
+
self.column = column
|
|
722
|
+
|
|
723
|
+
def to_var(self, info: TypeInfo, use_alias: bool) -> Var:
|
|
724
|
+
name = self.name
|
|
725
|
+
if use_alias and self.alias is not None:
|
|
726
|
+
name = self.alias
|
|
727
|
+
return Var(name, info[self.name].type)
|
|
728
|
+
|
|
729
|
+
def to_argument(self, info: TypeInfo, typed: bool, force_optional: bool, use_alias: bool) -> Argument:
|
|
730
|
+
if typed and info[self.name].type is not None:
|
|
731
|
+
type_annotation = info[self.name].type
|
|
732
|
+
else:
|
|
733
|
+
type_annotation = AnyType(TypeOfAny.explicit)
|
|
734
|
+
return Argument(
|
|
735
|
+
variable=self.to_var(info, use_alias),
|
|
736
|
+
type_annotation=type_annotation,
|
|
737
|
+
initializer=None,
|
|
738
|
+
kind=ARG_NAMED_OPT if force_optional or not self.is_required else ARG_NAMED,
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
def serialize(self) -> JsonDict:
|
|
742
|
+
return self.__dict__
|
|
743
|
+
|
|
744
|
+
@classmethod
|
|
745
|
+
def deserialize(cls, info: TypeInfo, data: JsonDict) -> 'PydanticModelField':
|
|
746
|
+
return cls(**data)
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
class ModelConfigData:
|
|
750
|
+
def __init__(
|
|
751
|
+
self,
|
|
752
|
+
forbid_extra: Optional[bool] = None,
|
|
753
|
+
allow_mutation: Optional[bool] = None,
|
|
754
|
+
frozen: Optional[bool] = None,
|
|
755
|
+
orm_mode: Optional[bool] = None,
|
|
756
|
+
allow_population_by_field_name: Optional[bool] = None,
|
|
757
|
+
has_alias_generator: Optional[bool] = None,
|
|
758
|
+
):
|
|
759
|
+
self.forbid_extra = forbid_extra
|
|
760
|
+
self.allow_mutation = allow_mutation
|
|
761
|
+
self.frozen = frozen
|
|
762
|
+
self.orm_mode = orm_mode
|
|
763
|
+
self.allow_population_by_field_name = allow_population_by_field_name
|
|
764
|
+
self.has_alias_generator = has_alias_generator
|
|
765
|
+
|
|
766
|
+
def set_values_dict(self) -> Dict[str, Any]:
|
|
767
|
+
return {k: v for k, v in self.__dict__.items() if v is not None}
|
|
768
|
+
|
|
769
|
+
def update(self, config: Optional['ModelConfigData']) -> None:
|
|
770
|
+
if config is None:
|
|
771
|
+
return
|
|
772
|
+
for k, v in config.set_values_dict().items():
|
|
773
|
+
setattr(self, k, v)
|
|
774
|
+
|
|
775
|
+
def setdefault(self, key: str, value: Any) -> None:
|
|
776
|
+
if getattr(self, key) is None:
|
|
777
|
+
setattr(self, key, value)
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
ERROR_ORM = ErrorCode('pydantic-orm', 'Invalid from_orm call', 'Pydantic')
|
|
781
|
+
ERROR_CONFIG = ErrorCode('pydantic-config', 'Invalid config value', 'Pydantic')
|
|
782
|
+
ERROR_ALIAS = ErrorCode('pydantic-alias', 'Dynamic alias disallowed', 'Pydantic')
|
|
783
|
+
ERROR_UNEXPECTED = ErrorCode('pydantic-unexpected', 'Unexpected behavior', 'Pydantic')
|
|
784
|
+
ERROR_UNTYPED = ErrorCode('pydantic-field', 'Untyped field disallowed', 'Pydantic')
|
|
785
|
+
ERROR_FIELD_DEFAULTS = ErrorCode('pydantic-field', 'Invalid Field defaults', 'Pydantic')
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
def error_from_orm(model_name: str, api: CheckerPluginInterface, context: Context) -> None:
|
|
789
|
+
api.fail(f'"{model_name}" does not have orm_mode=True', context, code=ERROR_ORM)
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
def error_invalid_config_value(name: str, api: SemanticAnalyzerPluginInterface, context: Context) -> None:
|
|
793
|
+
api.fail(f'Invalid value for "Config.{name}"', context, code=ERROR_CONFIG)
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
def error_required_dynamic_aliases(api: SemanticAnalyzerPluginInterface, context: Context) -> None:
|
|
797
|
+
api.fail('Required dynamic aliases disallowed', context, code=ERROR_ALIAS)
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
def error_unexpected_behavior(
|
|
801
|
+
detail: str, api: Union[CheckerPluginInterface, SemanticAnalyzerPluginInterface], context: Context
|
|
802
|
+
) -> None: # pragma: no cover
|
|
803
|
+
# Can't think of a good way to test this, but I confirmed it renders as desired by adding to a non-error path
|
|
804
|
+
link = 'https://github.com/pydantic/pydantic/issues/new/choose'
|
|
805
|
+
full_message = f'The pydantic mypy plugin ran into unexpected behavior: {detail}\n'
|
|
806
|
+
full_message += f'Please consider reporting this bug at {link} so we can try to fix it!'
|
|
807
|
+
api.fail(full_message, context, code=ERROR_UNEXPECTED)
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
def error_untyped_fields(api: SemanticAnalyzerPluginInterface, context: Context) -> None:
|
|
811
|
+
api.fail('Untyped fields disallowed', context, code=ERROR_UNTYPED)
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
def error_default_and_default_factory_specified(api: CheckerPluginInterface, context: Context) -> None:
|
|
815
|
+
api.fail('Field default and default_factory cannot be specified together', context, code=ERROR_FIELD_DEFAULTS)
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
def add_method(
|
|
819
|
+
ctx: ClassDefContext,
|
|
820
|
+
name: str,
|
|
821
|
+
args: List[Argument],
|
|
822
|
+
return_type: Type,
|
|
823
|
+
self_type: Optional[Type] = None,
|
|
824
|
+
tvar_def: Optional[TypeVarDef] = None,
|
|
825
|
+
is_classmethod: bool = False,
|
|
826
|
+
is_new: bool = False,
|
|
827
|
+
# is_staticmethod: bool = False,
|
|
828
|
+
) -> None:
|
|
829
|
+
"""
|
|
830
|
+
Adds a new method to a class.
|
|
831
|
+
|
|
832
|
+
This can be dropped if/when https://github.com/python/mypy/issues/7301 is merged
|
|
833
|
+
"""
|
|
834
|
+
info = ctx.cls.info
|
|
835
|
+
|
|
836
|
+
# First remove any previously generated methods with the same name
|
|
837
|
+
# to avoid clashes and problems in the semantic analyzer.
|
|
838
|
+
if name in info.names:
|
|
839
|
+
sym = info.names[name]
|
|
840
|
+
if sym.plugin_generated and isinstance(sym.node, FuncDef):
|
|
841
|
+
ctx.cls.defs.body.remove(sym.node) # pragma: no cover
|
|
842
|
+
|
|
843
|
+
self_type = self_type or fill_typevars(info)
|
|
844
|
+
if is_classmethod or is_new:
|
|
845
|
+
first = [Argument(Var('_cls'), TypeType.make_normalized(self_type), None, ARG_POS)]
|
|
846
|
+
# elif is_staticmethod:
|
|
847
|
+
# first = []
|
|
848
|
+
else:
|
|
849
|
+
self_type = self_type or fill_typevars(info)
|
|
850
|
+
first = [Argument(Var('__pydantic_self__'), self_type, None, ARG_POS)]
|
|
851
|
+
args = first + args
|
|
852
|
+
arg_types, arg_names, arg_kinds = [], [], []
|
|
853
|
+
for arg in args:
|
|
854
|
+
assert arg.type_annotation, 'All arguments must be fully typed.'
|
|
855
|
+
arg_types.append(arg.type_annotation)
|
|
856
|
+
arg_names.append(get_name(arg.variable))
|
|
857
|
+
arg_kinds.append(arg.kind)
|
|
858
|
+
|
|
859
|
+
function_type = ctx.api.named_type(f'{BUILTINS_NAME}.function')
|
|
860
|
+
signature = CallableType(arg_types, arg_kinds, arg_names, return_type, function_type)
|
|
861
|
+
if tvar_def:
|
|
862
|
+
signature.variables = [tvar_def]
|
|
863
|
+
|
|
864
|
+
func = FuncDef(name, args, Block([PassStmt()]))
|
|
865
|
+
func.info = info
|
|
866
|
+
func.type = set_callable_name(signature, func)
|
|
867
|
+
func.is_class = is_classmethod
|
|
868
|
+
# func.is_static = is_staticmethod
|
|
869
|
+
func._fullname = get_fullname(info) + '.' + name
|
|
870
|
+
func.line = info.line
|
|
871
|
+
|
|
872
|
+
# NOTE: we would like the plugin generated node to dominate, but we still
|
|
873
|
+
# need to keep any existing definitions so they get semantically analyzed.
|
|
874
|
+
if name in info.names:
|
|
875
|
+
# Get a nice unique name instead.
|
|
876
|
+
r_name = get_unique_redefinition_name(name, info.names)
|
|
877
|
+
info.names[r_name] = info.names[name]
|
|
878
|
+
|
|
879
|
+
if is_classmethod: # or is_staticmethod:
|
|
880
|
+
func.is_decorated = True
|
|
881
|
+
v = Var(name, func.type)
|
|
882
|
+
v.info = info
|
|
883
|
+
v._fullname = func._fullname
|
|
884
|
+
# if is_classmethod:
|
|
885
|
+
v.is_classmethod = True
|
|
886
|
+
dec = Decorator(func, [NameExpr('classmethod')], v)
|
|
887
|
+
# else:
|
|
888
|
+
# v.is_staticmethod = True
|
|
889
|
+
# dec = Decorator(func, [NameExpr('staticmethod')], v)
|
|
890
|
+
|
|
891
|
+
dec.line = info.line
|
|
892
|
+
sym = SymbolTableNode(MDEF, dec)
|
|
893
|
+
else:
|
|
894
|
+
sym = SymbolTableNode(MDEF, func)
|
|
895
|
+
sym.plugin_generated = True
|
|
896
|
+
|
|
897
|
+
info.names[name] = sym
|
|
898
|
+
info.defn.defs.body.append(func)
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
def get_fullname(x: Union[FuncBase, SymbolNode]) -> str:
|
|
902
|
+
"""
|
|
903
|
+
Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped.
|
|
904
|
+
"""
|
|
905
|
+
fn = x.fullname
|
|
906
|
+
if callable(fn): # pragma: no cover
|
|
907
|
+
return fn()
|
|
908
|
+
return fn
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
def get_name(x: Union[FuncBase, SymbolNode]) -> str:
|
|
912
|
+
"""
|
|
913
|
+
Used for compatibility with mypy 0.740; can be dropped once support for 0.740 is dropped.
|
|
914
|
+
"""
|
|
915
|
+
fn = x.name
|
|
916
|
+
if callable(fn): # pragma: no cover
|
|
917
|
+
return fn()
|
|
918
|
+
return fn
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
def parse_toml(config_file: str) -> Optional[Dict[str, Any]]:
|
|
922
|
+
if not config_file.endswith('.toml'):
|
|
923
|
+
return None
|
|
924
|
+
|
|
925
|
+
read_mode = 'rb'
|
|
926
|
+
if sys.version_info >= (3, 11):
|
|
927
|
+
import tomllib as toml_
|
|
928
|
+
else:
|
|
929
|
+
try:
|
|
930
|
+
import tomli as toml_
|
|
931
|
+
except ImportError:
|
|
932
|
+
# older versions of mypy have toml as a dependency, not tomli
|
|
933
|
+
read_mode = 'r'
|
|
934
|
+
try:
|
|
935
|
+
import toml as toml_ # type: ignore[no-redef]
|
|
936
|
+
except ImportError: # pragma: no cover
|
|
937
|
+
import warnings
|
|
938
|
+
|
|
939
|
+
warnings.warn('No TOML parser installed, cannot read configuration from `pyproject.toml`.')
|
|
940
|
+
return None
|
|
941
|
+
|
|
942
|
+
with open(config_file, read_mode) as rf:
|
|
943
|
+
return toml_.load(rf) # type: ignore[arg-type]
|