From 446c40852fdd99f775cf5cd688eff6f013150188 Mon Sep 17 00:00:00 2001 From: Giancarlo Romeo Date: Wed, 28 Aug 2024 16:56:22 +0200 Subject: [PATCH 1/2] upgrade to pydantic2 --- api/specs/storage/scripts/storage.py | 2 +- api/specs/web-server/_auth.py | 2 +- api/specs/web-server/_common.py | 4 +- api/specs/web-server/_folders.py | 2 +- .../web-server/_nih_sparc_redirections.py | 2 +- api/specs/web-server/_projects_comments.py | 2 +- api/specs/web-server/_projects_crud.py | 2 +- api/specs/web-server/_projects_states.py | 2 +- api/specs/web-server/_resource_usage.py | 2 +- api/specs/web-server/_storage.py | 2 +- packages/aws-library/requirements/_base.txt | 14 +- packages/aws-library/requirements/_test.txt | 19 +- packages/aws-library/requirements/_tools.txt | 10 - .../src/aws_library/ec2/_client.py | 2 +- .../src/aws_library/ec2/_models.py | 2 +- .../aws-library/src/aws_library/s3/_client.py | 2 +- .../src/aws_library/s3/_constants.py | 2 +- .../aws-library/src/aws_library/s3/_errors.py | 2 +- .../aws-library/src/aws_library/s3/_models.py | 2 +- .../aws-library/src/aws_library/s3/_utils.py | 2 +- .../src/aws_library/ssm/_errors.py | 2 +- packages/aws-library/tests/test_ec2_models.py | 2 +- packages/aws-library/tests/test_s3_client.py | 2 +- packages/aws-library/tests/test_s3_utils.py | 2 +- .../requirements/_base.txt | 7 +- .../requirements/_test.txt | 6 - .../requirements/_tools.txt | 10 - .../container_tasks/docker.py | 2 +- .../container_tasks/errors.py | 2 +- .../container_tasks/events.py | 2 +- .../container_tasks/io.py | 2 +- .../container_tasks/protocol.py | 2 +- .../tests/container_tasks/test_protocol.py | 2 +- .../models-library/requirements/_base.txt | 10 +- .../models-library/requirements/_test.txt | 6 - .../models-library/requirements/_tools.txt | 10 - .../scripts/validate-pg-projects.py | 4 +- .../src/models_library/aiodocker_api.py | 2 +- .../api_schemas__common/errors.py | 2 +- .../api_schemas__common/meta.py | 2 +- .../api_schemas_api_server/api_keys.py | 2 +- .../api_schemas_catalog/__init__.py | 2 +- .../service_access_rights.py | 2 +- .../api_schemas_catalog/services.py | 2 +- .../api_schemas_catalog/services_ports.py | 2 +- .../services_specifications.py | 2 +- .../api_schemas_clusters_keeper/__init__.py | 2 +- .../api_schemas_clusters_keeper/clusters.py | 2 +- .../ec2_instances.py | 2 +- .../api_schemas_directorv2/clusters.py | 6 +- .../api_schemas_directorv2/comp_tasks.py | 2 +- .../dynamic_services.py | 2 +- .../dynamic_services_service.py | 2 +- .../api_schemas_directorv2/errors.py | 2 +- .../api_schemas_directorv2/health.py | 2 +- .../api_schemas_directorv2/notifications.py | 2 +- .../api_schemas_directorv2/services.py | 4 +- .../api_schemas_dynamic_scheduler/__init__.py | 2 +- .../dynamic_services.py | 2 +- .../api_schemas_dynamic_sidecar/containers.py | 2 +- .../api_schemas_dynamic_sidecar/telemetry.py | 2 +- .../api_schemas_efs_guardian/__init__.py | 2 +- .../api_schemas_invitations/invitations.py | 2 +- .../api_schemas_long_running_tasks/base.py | 8 +- .../api_schemas_long_running_tasks/tasks.py | 2 +- .../api_schemas_payments/__init__.py | 2 +- .../api_schemas_payments/errors.py | 2 +- .../__init__.py | 2 +- .../credit_transactions.py | 2 +- .../pricing_plans.py | 2 +- .../service_runs.py | 2 +- .../src/models_library/api_schemas_storage.py | 4 +- .../api_schemas_webserver/__init__.py | 2 +- .../api_schemas_webserver/_base.py | 2 +- .../api_schemas_webserver/activity.py | 2 +- .../api_schemas_webserver/auth.py | 2 +- .../api_schemas_webserver/catalog.py | 4 +- .../api_schemas_webserver/clusters.py | 2 +- .../api_schemas_webserver/computations.py | 2 +- .../api_schemas_webserver/folders.py | 2 +- .../api_schemas_webserver/groups.py | 9 +- .../api_schemas_webserver/permalinks.py | 2 +- .../api_schemas_webserver/product.py | 2 +- .../api_schemas_webserver/projects.py | 2 +- .../projects_metadata.py | 2 +- .../api_schemas_webserver/projects_nodes.py | 2 +- .../api_schemas_webserver/projects_ports.py | 2 +- .../api_schemas_webserver/resource_usage.py | 2 +- .../users_preferences.py | 2 +- .../api_schemas_webserver/wallets.py | 2 +- .../src/models_library/app_diagnostics.py | 2 +- .../src/models_library/basic_types.py | 3 +- .../src/models_library/boot_options.py | 2 +- .../src/models_library/callbacks_mapping.py | 2 +- .../src/models_library/clusters.py | 4 +- .../src/models_library/docker.py | 2 +- .../src/models_library/emails.py | 2 +- .../src/models_library/errors_classes.py | 2 +- .../src/models_library/folders.py | 2 +- .../function_services_catalog/_settings.py | 2 +- .../services/iter_sensitivity.py | 2 +- .../generated_models/docker_rest_api.py | 2 +- .../src/models_library/generics.py | 2 +- .../src/models_library/groups.py | 4 +- .../src/models_library/healthchecks.py | 2 +- .../src/models_library/invitations.py | 2 +- .../osparc_variable_identifier.py | 4 +- .../src/models_library/payments.py | 2 +- .../src/models_library/products.py | 2 +- .../src/models_library/progress_bar.py | 2 +- .../src/models_library/projects.py | 2 +- .../src/models_library/projects_access.py | 4 +- .../src/models_library/projects_comments.py | 2 +- .../src/models_library/projects_networks.py | 2 +- .../src/models_library/projects_nodes.py | 2 +- .../src/models_library/projects_nodes_io.py | 2 +- .../src/models_library/projects_nodes_ui.py | 4 +- .../src/models_library/projects_pipeline.py | 2 +- .../src/models_library/projects_state.py | 2 +- .../src/models_library/projects_ui.py | 4 +- .../models_library/rabbitmq_basic_types.py | 2 +- .../src/models_library/rabbitmq_messages.py | 2 +- .../src/models_library/resource_tracker.py | 2 +- .../src/models_library/rest_filters.py | 2 +- .../src/models_library/rest_ordering.py | 2 +- .../src/models_library/rest_pagination.py | 4 +- .../models_library/rest_pagination_utils.py | 2 +- .../src/models_library/rpc_pagination.py | 2 +- .../models_library/service_settings_labels.py | 2 +- .../service_settings_nat_rule.py | 2 +- .../src/models_library/services_access.py | 2 +- .../src/models_library/services_authoring.py | 2 +- .../src/models_library/services_base.py | 2 +- .../src/models_library/services_creation.py | 2 +- .../src/models_library/services_history.py | 2 +- .../src/models_library/services_io.py | 2 +- .../services_metadata_editable.py | 2 +- .../services_metadata_published.py | 2 +- .../src/models_library/services_resources.py | 2 +- .../src/models_library/services_types.py | 2 +- .../src/models_library/services_ui.py | 4 +- .../src/models_library/sidecar_volumes.py | 2 +- .../src/models_library/user_preferences.py | 4 +- .../src/models_library/users.py | 2 +- .../utils/_original_fastapi_encoders.py | 4 +- .../utils/json_serialization.py | 4 +- .../src/models_library/utils/nodes.py | 2 +- .../utils/pydantic_tools_extension.py | 4 +- .../src/models_library/utils/services_io.py | 2 +- .../utils/specs_substitution.py | 4 +- .../src/models_library/wallets.py | 2 +- .../tests/test__models_examples.py | 2 +- .../tests/test__models_fit_schemas.py | 2 +- .../tests/test__pydantic_models.py | 4 +- .../tests/test__pydantic_models_and_enums.py | 2 +- .../test_api_schemas_webserver_projects.py | 2 +- .../models-library/tests/test_basic_types.py | 4 +- .../tests/test_callbacks_mapping.py | 2 +- .../models-library/tests/test_clusters.py | 2 +- packages/models-library/tests/test_docker.py | 2 +- packages/models-library/tests/test_emails.py | 2 +- packages/models-library/tests/test_errors.py | 2 +- .../tests/test_errors_classes.py | 2 +- .../models-library/tests/test_generics.py | 2 +- .../tests/test_osparc_variable_identifier.py | 2 +- .../tests/test_project_networks.py | 2 +- .../tests/test_project_nodes_io.py | 2 +- .../tests/test_rabbit_messages.py | 2 +- .../tests/test_resource_tracker.py | 2 +- .../tests/test_rest_pagination.py | 2 +- .../tests/test_service_resources.py | 2 +- .../tests/test_service_settings_labels.py | 4 +- .../tests/test_service_settings_nat_rule.py | 2 +- .../tests/test_user_preferences.py | 2 +- .../tests/test_utils_common_validators.py | 2 +- .../tests/test_utils_fastapi_encoders.py | 2 +- .../tests/test_utils_json_serialization.py | 2 +- .../models-library/tests/test_utils_nodes.py | 2 +- .../test_utils_pydantic_tools_extension.py | 2 +- .../tests/test_utils_service_io.py | 2 +- .../tests/test_utils_specs_substitution.py | 2 +- .../requirements/_base.txt | 7 +- .../requirements/_test.txt | 7 - .../requirements/_tools.txt | 10 - .../notifications-library/tests/conftest.py | 2 +- .../tests/email/conftest.py | 2 +- .../tests/email/test_email_events.py | 4 +- .../tests/with_db/conftest.py | 2 +- .../postgres-database/requirements/_base.txt | 7 +- .../postgres-database/requirements/_test.txt | 7 - .../postgres-database/requirements/_tools.txt | 10 - .../utils_folders.py | 4 +- .../utils_projects_metadata.py | 4 +- .../utils_projects_nodes.py | 4 +- .../tests/test_utils_folders.py | 2 +- .../src/pytest_simcore/aws_ec2_service.py | 2 +- .../src/pytest_simcore/aws_server.py | 2 +- .../src/pytest_simcore/faker_payments_data.py | 2 +- .../src/pytest_simcore/faker_products_data.py | 2 +- .../src/pytest_simcore/faker_projects_data.py | 2 +- .../src/pytest_simcore/faker_users_data.py | 2 +- .../src/pytest_simcore/file_extra.py | 2 +- .../helpers/httpx_calls_capture_models.py | 2 +- .../helpers/httpx_calls_capture_openapi.py | 2 +- .../helpers/httpx_calls_capture_parameters.py | 2 +- .../helpers/httpx_client_base_dev.py | 2 +- .../helpers/parametrizations.py | 2 +- .../src/pytest_simcore/helpers/s3.py | 2 +- .../src/pytest_simcore/httpbin_service.py | 2 +- .../src/pytest_simcore/httpx_calls_capture.py | 2 +- .../hypothesis_type_strategies.py | 2 +- .../src/pytest_simcore/pydantic_models.py | 2 +- .../services_api_mocks_for_aiohttp_clients.py | 2 +- .../pytest_simcore/simcore_dask_service.py | 2 +- .../pytest_simcore/simcore_storage_service.py | 2 +- .../requirements/_base.txt | 11 +- .../requirements/_test.txt | 9 - .../requirements/_tools.txt | 11 - .../_compose_spec_model_autogenerated.py | 2 +- .../src/service_integration/cli/_config.py | 2 +- .../src/service_integration/errors.py | 2 +- .../src/service_integration/oci_image_spec.py | 6 +- .../src/service_integration/osparc_config.py | 10 +- .../src/service_integration/settings.py | 2 +- .../src/service_integration/versioning.py | 2 +- .../tests/test_osparc_image_specs.py | 2 +- .../service-library/requirements/_aiohttp.txt | 4 +- .../service-library/requirements/_base.txt | 14 +- .../service-library/requirements/_fastapi.txt | 9 +- .../service-library/requirements/_test.txt | 17 - .../service-library/requirements/_tools.txt | 10 - .../servicelib/aiohttp/application_setup.py | 2 +- .../src/servicelib/aiohttp/docker_utils.py | 2 +- .../aiohttp/long_running_tasks/_constants.py | 2 +- .../aiohttp/long_running_tasks/_routes.py | 2 +- .../aiohttp/long_running_tasks/_server.py | 2 +- .../servicelib/aiohttp/requests_validation.py | 2 +- .../src/servicelib/background_task.py | 2 +- .../deferred_tasks/_base_deferred_handler.py | 2 +- .../deferred_tasks/_deferred_manager.py | 2 +- .../src/servicelib/deferred_tasks/_models.py | 2 +- .../deferred_tasks/_redis_task_tracker.py | 2 +- .../deferred_tasks/_task_schedule.py | 2 +- .../deferred_tasks/_worker_tracker.py | 2 +- .../src/servicelib/docker_utils.py | 2 +- .../src/servicelib/error_codes.py | 4 +- .../src/servicelib/exception_utils.py | 2 +- .../src/servicelib/fastapi/docker_utils.py | 2 +- .../src/servicelib/fastapi/errors.py | 2 +- .../servicelib/fastapi/http_client_thin.py | 2 +- .../fastapi/long_running_tasks/_client.py | 2 +- .../long_running_tasks/_context_manager.py | 2 +- .../fastapi/long_running_tasks/_server.py | 2 +- .../src/servicelib/file_utils.py | 2 +- .../servicelib/long_running_tasks/_errors.py | 2 +- .../servicelib/long_running_tasks/_models.py | 2 +- .../servicelib/long_running_tasks/_task.py | 2 +- .../src/servicelib/progress_bar.py | 2 +- .../src/servicelib/rabbitmq/_client.py | 2 +- .../src/servicelib/rabbitmq/_client_rpc.py | 2 +- .../src/servicelib/rabbitmq/_constants.py | 2 +- .../src/servicelib/rabbitmq/_errors.py | 2 +- .../src/servicelib/rabbitmq/_models.py | 2 +- .../src/servicelib/rabbitmq/_utils.py | 2 +- .../rpc_interfaces/catalog/services.py | 2 +- .../dynamic_scheduler/errors.py | 2 +- .../dynamic_scheduler/services.py | 2 +- .../efs_guardian/efs_manager.py | 2 +- .../resource_usage_tracker/errors.py | 2 +- .../resource_usage_tracker/pricing_plans.py | 2 +- .../resource_usage_tracker/pricing_units.py | 2 +- .../resource_usage_tracker/service_runs.py | 2 +- .../service-library/src/servicelib/redis.py | 4 +- .../src/servicelib/sequences_utils.py | 2 +- .../service-library/src/servicelib/utils.py | 2 +- .../src/servicelib/utils_meta.py | 2 +- .../src/servicelib/utils_secrets.py | 2 +- .../aiohttp/long_running_tasks/conftest.py | 2 +- .../test_long_running_tasks.py | 2 +- ...st_long_running_tasks_with_task_context.py | 2 +- .../tests/aiohttp/test_docker_utils.py | 2 +- .../tests/aiohttp/test_requests_validation.py | 2 +- .../tests/deferred_tasks/example_app.py | 2 +- .../test__base_deferred_handler.py | 2 +- .../test__redis_task_tracker.py | 2 +- .../tests/deferred_tasks/test__utils.py | 2 +- .../deferred_tasks/test_deferred_tasks.py | 2 +- .../service-library/tests/fastapi/conftest.py | 2 +- .../test_long_running_tasks.py | 2 +- ...test_long_running_tasks_context_manager.py | 2 +- .../tests/fastapi/test_docker_utils.py | 2 +- .../tests/fastapi/test_exceptions_utils.py | 2 +- .../tests/fastapi/test_http_client_thin.py | 2 +- .../tests/fastapi/test_rabbitmq.py | 2 +- .../rabbitmq/test_rabbitmq_connection.py | 2 +- .../tests/rabbitmq/test_rabbitmq_rpc.py | 2 +- .../tests/rabbitmq/test_rabbitmq_utils.py | 2 +- .../tests/test_archiving_utils.py | 2 +- .../tests/test_exception_utils.py | 2 +- .../tests/test_progress_bar.py | 2 +- .../tests/test_utils_secrets.py | 2 +- .../settings-library/requirements/_base.txt | 7 +- .../settings-library/requirements/_test.txt | 6 - .../settings-library/requirements/_tools.txt | 10 - .../src/settings_library/application.py | 2 +- .../src/settings_library/aws_s3_cli.py | 2 +- .../src/settings_library/base.py | 8 +- .../src/settings_library/basic_types.py | 2 +- .../src/settings_library/catalog.py | 2 +- .../src/settings_library/comp_services.py | 4 +- .../src/settings_library/director_v2.py | 2 +- .../src/settings_library/docker_registry.py | 2 +- .../src/settings_library/ec2.py | 2 +- .../src/settings_library/efs.py | 2 +- .../src/settings_library/email.py | 6 +- .../settings_library/http_client_request.py | 2 +- .../src/settings_library/node_ports.py | 2 +- .../src/settings_library/postgres.py | 2 +- .../src/settings_library/prometheus.py | 2 +- .../src/settings_library/r_clone.py | 2 +- .../src/settings_library/rabbit.py | 6 +- .../src/settings_library/redis.py | 6 +- .../resource_usage_tracker.py | 2 +- .../src/settings_library/s3.py | 2 +- .../src/settings_library/ssm.py | 2 +- .../src/settings_library/storage.py | 2 +- .../src/settings_library/tracing.py | 2 +- .../src/settings_library/twilio.py | 2 +- .../src/settings_library/utils_cli.py | 4 +- .../src/settings_library/utils_encoders.py | 4 +- .../src/settings_library/utils_service.py | 6 +- .../src/settings_library/webserver.py | 2 +- packages/settings-library/tests/conftest.py | 2 +- .../tests/test__models_examples.py | 2 +- .../tests/test__pydantic_settings.py | 4 +- packages/settings-library/tests/test_base.py | 4 +- .../tests/test_base_w_postgres.py | 2 +- packages/settings-library/tests/test_email.py | 2 +- .../settings-library/tests/test_utils_cli.py | 2 +- .../tests/test_utils_logging.py | 2 +- .../tests/test_utils_service.py | 4 +- packages/simcore-sdk/requirements/_base.txt | 12 +- packages/simcore-sdk/requirements/_test.txt | 24 +- packages/simcore-sdk/requirements/_tools.txt | 10 - .../src/simcore_sdk/node_data/data_manager.py | 2 +- .../node_ports_common/_filemanager.py | 2 +- .../node_ports_common/aws_s3_cli.py | 4 +- .../node_ports_common/aws_s3_cli_utils.py | 2 +- .../node_ports_common/file_io_utils.py | 2 +- .../node_ports_common/filemanager.py | 2 +- .../simcore_sdk/node_ports_common/r_clone.py | 4 +- .../node_ports_common/r_clone_utils.py | 2 +- .../node_ports_common/storage_client.py | 4 +- .../src/simcore_sdk/node_ports_v2/links.py | 10 +- .../simcore_sdk/node_ports_v2/nodeports_v2.py | 4 +- .../src/simcore_sdk/node_ports_v2/port.py | 4 +- .../simcore_sdk/node_ports_v2/port_utils.py | 4 +- .../node_ports_v2/port_validation.py | 10 +- .../node_ports_v2/ports_mapping.py | 2 +- .../simcore-sdk/tests/integration/conftest.py | 2 +- .../test_node_data_data_manager.py | 2 +- .../test_node_ports_common_aws_s3_cli.py | 2 +- .../test_node_ports_common_filemanager.py | 2 +- .../test_node_ports_common_r_clone.py | 2 +- .../test_node_ports_common_file_io_utils.py | 2 +- .../tests/unit/test_node_ports_v2_links.py | 9 +- .../tests/unit/test_node_ports_v2_port.py | 4 +- .../unit/test_node_ports_v2_port_mapping.py | 18 +- .../test_node_ports_v2_port_validation.py | 4 +- .../tests/unit/test_storage_client.py | 2 +- requirements/constraints.txt | 3 +- scripts/demo-meta/osparc_webapi.py | 31 +- scripts/maintenance/clean_projects_of_user.py | 12 +- .../autoscaled_monitor/constants.py | 2 +- .../autoscaled_monitor/core.py | 2 +- .../autoscaled_monitor/dask.py | 2 +- .../autoscaled_monitor/db.py | 2 +- .../autoscaled_monitor/models.py | 2 +- .../autoscaled_monitor/ssh.py | 2 +- scripts/maintenance/create_user.py | 4 +- .../import_projects_as_template.py | 7 +- .../maintenance/migrate_project/src/models.py | 5 +- scripts/release/monitor_release/models.py | 2 +- scripts/release/monitor_release/settings.py | 4 +- services/agent/requirements/_base.txt | 22 +- services/agent/requirements/_test.txt | 19 +- services/agent/requirements/_tools.txt | 12 +- .../simcore_service_agent/core/settings.py | 2 +- .../modules/task_monitor.py | 10 +- .../modules/volumes_cleanup/_s3.py | 2 +- services/agent/tests/conftest.py | 2 +- .../tests/unit/test_modules_task_monitor.py | 2 +- .../unit/test_modules_volumes_cleanup_s3.py | 2 +- services/api-server/requirements/_base.txt | 331 ++++++++++++++++-- services/api-server/requirements/_test.txt | 15 - services/api-server/requirements/_tools.txt | 10 - .../api/dependencies/authentication.py | 2 +- .../api/dependencies/files.py | 2 +- .../api/dependencies/rabbitmq.py | 2 +- .../api/routes/files.py | 2 +- .../api/routes/solvers.py | 4 +- .../api/routes/solvers_jobs.py | 2 +- .../api/routes/solvers_jobs_getters.py | 4 +- .../api/routes/studies_jobs.py | 2 +- .../core/_prometheus_instrumentation.py | 2 +- .../core/health_checker.py | 2 +- .../core/settings.py | 4 +- .../db/repositories/api_keys.py | 2 +- .../db/repositories/users.py | 2 +- .../exceptions/handlers/_validation_errors.py | 2 +- .../exceptions/service_errors_utils.py | 2 +- .../models/api_resources.py | 4 +- .../models/basic_types.py | 2 +- .../models/domain/groups.py | 2 +- .../models/pagination.py | 4 +- .../models/schemas/errors.py | 2 +- .../models/schemas/files.py | 2 +- .../models/schemas/jobs.py | 2 +- .../models/schemas/meta.py | 2 +- .../models/schemas/profiles.py | 2 +- .../models/schemas/solvers.py | 2 +- .../models/schemas/studies.py | 2 +- .../services/catalog.py | 2 +- .../services/director_v2.py | 2 +- .../services/jobs.py | 2 +- .../services/log_streaming.py | 2 +- .../services/solver_job_models_converters.py | 2 +- .../services/solver_job_outputs.py | 2 +- .../services/storage.py | 2 +- .../services/study_job_models_converters.py | 2 +- .../services/webserver.py | 2 +- .../tests/unit/_with_db/conftest.py | 2 +- .../tests/unit/_with_db/test_product.py | 2 +- .../test_api_routers_solvers_jobs.py | 2 +- .../test_api_routers_solvers_jobs_delete.py | 2 +- .../test_api_routers_solvers_jobs_logs.py | 2 +- .../test_api_routers_solvers_jobs_metadata.py | 2 +- .../test_api_routers_solvers_jobs_read.py | 2 +- .../test_api_routers_studies_jobs_metadata.py | 2 +- .../api_studies/test_api_routes_studies.py | 2 +- .../test_api_routes_studies_jobs.py | 2 +- .../unit/captures/test__mocks_captures.py | 2 +- services/api-server/tests/unit/conftest.py | 2 +- .../api-server/tests/unit/test_api_files.py | 2 +- .../api-server/tests/unit/test_api_health.py | 2 +- .../tests/unit/test_api_solver_jobs.py | 2 +- .../api-server/tests/unit/test_api_solvers.py | 2 +- .../api-server/tests/unit/test_api_wallets.py | 2 +- services/api-server/tests/unit/test_models.py | 2 +- .../tests/unit/test_models_schemas_files.py | 2 +- .../tests/unit/test_services_rabbitmq.py | 2 +- ...t_services_solver_job_models_converters.py | 2 +- .../unit/test_utils_http_calls_capture.py | 2 +- services/autoscaling/requirements/_base.txt | 31 +- services/autoscaling/requirements/_test.txt | 26 +- services/autoscaling/requirements/_tools.txt | 10 - .../simcore_service_autoscaling/api/health.py | 2 +- .../simcore_service_autoscaling/constants.py | 2 +- .../core/settings.py | 2 +- .../auto_scaling_mode_computational.py | 2 +- .../modules/buffer_machines_pool_core.py | 2 +- .../modules/dask.py | 2 +- .../utils/buffer_machines_pool_core.py | 2 +- .../utils/utils_docker.py | 2 +- services/autoscaling/tests/unit/conftest.py | 2 +- .../tests/unit/test_core_settings.py | 2 +- .../autoscaling/tests/unit/test_models.py | 2 +- ...test_modules_auto_scaling_computational.py | 2 +- .../unit/test_modules_auto_scaling_dynamic.py | 2 +- .../unit/test_modules_buffer_machine_core.py | 2 +- .../tests/unit/test_modules_dask.py | 2 +- .../unit/test_utils_auto_scaling_core.py | 2 +- .../test_utils_buffer_machines_pool_core.py | 2 +- .../unit/test_utils_computational_scaling.py | 2 +- .../tests/unit/test_utils_docker.py | 2 +- .../autoscaling/tests/unit/test_utils_ec2.py | 2 +- .../tests/unit/test_utils_rabbitmq.py | 2 +- services/catalog/requirements/_base.txt | 39 ++- services/catalog/requirements/_test.txt | 15 - services/catalog/requirements/_tools.txt | 10 - .../api/dependencies/services.py | 2 +- .../simcore_service_catalog/api/rest/_meta.py | 2 +- .../api/rest/_services.py | 4 +- .../api/rest/_services_resources.py | 2 +- .../api/rpc/_services.py | 2 +- .../simcore_service_catalog/core/settings.py | 2 +- .../db/repositories/groups.py | 4 +- .../db/repositories/projects.py | 2 +- .../db/repositories/services.py | 2 +- .../exceptions/handlers/_validation_error.py | 2 +- .../models/services_db.py | 4 +- .../services/access_rights.py | 2 +- .../services/compatibility.py | 2 +- .../services/manifest.py | 2 +- .../services/services_api.py | 2 +- services/catalog/tests/unit/conftest.py | 2 +- .../catalog/tests/unit/with_dbs/conftest.py | 2 +- .../with_dbs/test_api_rest_services__list.py | 2 +- .../test_api_rest_services_access_rights.py | 2 +- .../test_api_rest_services_resources.py | 2 +- .../tests/unit/with_dbs/test_api_rpc.py | 2 +- .../unit/with_dbs/test_db_repositories.py | 2 +- .../with_dbs/test_services_access_rights.py | 2 +- .../clusters-keeper/requirements/_base.txt | 31 +- .../clusters-keeper/requirements/_test.txt | 27 +- .../clusters-keeper/requirements/_tools.txt | 10 - .../simcore_service_clusters_keeper/_meta.py | 2 +- .../api/health.py | 2 +- .../core/errors.py | 2 +- .../core/settings.py | 2 +- .../modules/clusters_management_core.py | 2 +- .../modules/dask.py | 2 +- .../utils/dask.py | 2 +- .../utils/ec2.py | 2 +- .../tests/unit/test_core_settings.py | 2 +- .../tests/unit/test_modules_dask.py | 2 +- .../tests/unit/test_utils_clusters.py | 2 +- services/dask-sidecar/requirements/_base.txt | 16 +- services/dask-sidecar/requirements/_test.txt | 23 +- services/dask-sidecar/requirements/_tools.txt | 10 - .../computational_sidecar/core.py | 4 +- .../computational_sidecar/docker_utils.py | 2 +- .../computational_sidecar/errors.py | 2 +- .../computational_sidecar/models.py | 2 +- .../file_utils.py | 4 +- .../simcore_service_dask_sidecar/settings.py | 2 +- .../src/simcore_service_dask_sidecar/utils.py | 2 +- services/dask-sidecar/tests/unit/conftest.py | 2 +- .../tests/unit/test_file_utils.py | 2 +- .../dask-sidecar/tests/unit/test_models.py | 2 +- .../dask-sidecar/tests/unit/test_tasks.py | 2 +- .../datcore-adapter/requirements/_base.txt | 25 +- .../datcore-adapter/requirements/_test.txt | 10 - .../datcore-adapter/requirements/_tools.txt | 10 - .../simcore_service_datcore_adapter/_meta.py | 2 +- .../api/errors/validation_error.py | 6 +- .../api/routes/files.py | 2 +- .../core/settings.py | 4 +- .../models/domains/files.py | 2 +- .../models/domains/user.py | 2 +- .../models/schemas/datasets.py | 2 +- .../tests/unit/test_route_datasets.py | 6 +- .../tests/unit/test_route_files.py | 2 +- services/director-v2/requirements/_base.txt | 46 +-- services/director-v2/requirements/_test.txt | 15 - services/director-v2/requirements/_tools.txt | 10 - .../api/errors/validation_error.py | 6 +- .../api/routes/computations.py | 2 +- .../api/routes/dynamic_scheduler.py | 2 +- .../api/routes/dynamic_services.py | 2 +- .../cli/_close_and_save_service.py | 2 +- .../simcore_service_director_v2/cli/_core.py | 2 +- .../dynamic_services_settings/__init__.py | 2 +- .../dynamic_services_settings/egress_proxy.py | 2 +- .../core/dynamic_services_settings/proxy.py | 2 +- .../dynamic_services_settings/scheduler.py | 2 +- .../core/dynamic_services_settings/sidecar.py | 2 +- .../core/errors.py | 2 +- .../core/settings.py | 2 +- .../models/comp_pipelines.py | 2 +- .../models/comp_runs.py | 2 +- .../models/comp_tasks.py | 2 +- .../models/dynamic_services_scheduler.py | 2 +- .../models/pricing.py | 2 +- .../modules/catalog.py | 2 +- .../modules/comp_scheduler/base_scheduler.py | 2 +- .../modules/dask_client.py | 4 +- .../modules/dask_clients_pool.py | 2 +- .../modules/db/repositories/clusters.py | 2 +- .../modules/db/repositories/comp_runs.py | 2 +- .../db/repositories/comp_tasks/_utils.py | 2 +- .../modules/db/repositories/users.py | 2 +- .../dynamic_sidecar/api_client/_public.py | 2 +- .../dynamic_sidecar/api_client/_thin.py | 2 +- .../dynamic_sidecar/docker_compose_specs.py | 2 +- .../docker_service_specs/proxy.py | 2 +- .../docker_service_specs/sidecar.py | 2 +- .../docker_service_specs/volume_remover.py | 2 +- .../modules/dynamic_sidecar/errors.py | 2 +- .../scheduler/_core/_events_user_services.py | 2 +- .../scheduler/_core/_scheduler.py | 2 +- .../modules/osparc_variables/_api_auth_rpc.py | 2 +- .../modules/osparc_variables/substitutions.py | 2 +- .../modules/projects_networks.py | 2 +- .../modules/resource_usage_tracker_client.py | 2 +- .../utils/base_distributed_identifier.py | 2 +- .../utils/comp_scheduler.py | 2 +- .../utils/computations.py | 2 +- .../simcore_service_director_v2/utils/dask.py | 2 +- .../utils/dask_client_utils.py | 2 +- .../utils/osparc_variables.py | 2 +- .../utils/rabbitmq.py | 2 +- .../tests/helpers/shared_comp_utils.py | 4 +- .../tests/integration/02/conftest.py | 2 +- ...t_dynamic_sidecar_nodeports_integration.py | 2 +- .../director-v2/tests/integration/02/utils.py | 2 +- services/director-v2/tests/unit/conftest.py | 2 +- .../tests/unit/test_core_settings.py | 2 +- .../tests/unit/test_models_clusters.py | 2 +- .../tests/unit/test_models_comp_pipelines.py | 2 +- .../tests/unit/test_models_comp_runs.py | 2 +- .../tests/unit/test_models_comp_tasks.py | 2 +- ...dels_schemas_dynamic_services_scheduler.py | 2 +- .../tests/unit/test_modules_dask_client.py | 4 +- .../unit/test_modules_dask_clients_pool.py | 2 +- ...s_db_repositories_services_environments.py | 2 +- ...dules_dynamic_sidecar_client_api_public.py | 2 +- ...modules_dynamic_sidecar_client_api_thin.py | 2 +- ...ic_sidecar_docker_compose_egress_config.py | 2 +- ...es_dynamic_sidecar_docker_compose_specs.py | 2 +- ...car_docker_service_specs_volume_remover.py | 2 +- .../test_modules_dynamic_sidecar_scheduler.py | 2 +- ...s_dynamic_sidecar_scheduler_core_events.py | 2 +- .../tests/unit/test_modules_notifier.py | 2 +- .../unit/test_modules_osparc_variables.py | 2 +- .../unit/test_modules_project_networks.py | 2 +- .../director-v2/tests/unit/test_utils_db.py | 2 +- .../unit/test_utils_distributed_identifier.py | 2 +- .../tests/unit/with_dbs/conftest.py | 2 +- .../unit/with_dbs/test_api_route_clusters.py | 2 +- .../test_api_route_clusters_details.py | 2 +- .../with_dbs/test_api_route_computations.py | 2 +- .../test_api_route_computations_tasks.py | 2 +- ...t_modules_comp_scheduler_dask_scheduler.py | 2 +- .../tests/unit/with_dbs/test_utils_dask.py | 6 +- .../services_common.py | 2 +- .../dynamic-scheduler/requirements/_base.txt | 27 +- .../dynamic-scheduler/requirements/_test.txt | 13 - .../dynamic-scheduler/requirements/_tools.txt | 11 - .../core/errors.py | 2 +- .../core/settings.py | 2 +- .../models/schemas/meta.py | 2 +- .../tests/unit/test__model_examples.py | 2 +- .../dynamic-sidecar/requirements/_base.txt | 31 +- .../dynamic-sidecar/requirements/_test.txt | 13 - .../dynamic-sidecar/requirements/_tools.txt | 10 - .../api/containers.py | 2 +- .../api/containers_extension.py | 2 +- .../api/volumes.py | 2 +- .../core/docker_utils.py | 2 +- .../core/errors.py | 2 +- .../core/external_dependencies.py | 2 +- .../core/registry.py | 2 +- .../core/reserved_space.py | 2 +- .../core/settings.py | 2 +- .../core/storage.py | 2 +- .../models/schemas/application_health.py | 6 +- .../models/schemas/containers.py | 2 +- .../models/shared_store.py | 2 +- .../_logging_event_handler.py | 2 +- .../modules/container_utils.py | 2 +- .../modules/inputs.py | 2 +- .../modules/long_running_tasks.py | 2 +- .../modules/nodeports.py | 2 +- .../modules/outputs/_directory_utils.py | 2 +- .../modules/outputs/_event_filter.py | 2 +- .../modules/outputs/_event_handler.py | 2 +- .../modules/outputs/_manager.py | 4 +- .../modules/prometheus_metrics.py | 2 +- .../modules/resource_tracking/_core.py | 2 +- .../modules/resource_tracking/_models.py | 2 +- .../modules/service_liveness.py | 2 +- .../modules/user_services_preferences/_db.py | 2 +- .../user_services_preferences/_errors.py | 2 +- .../user_services_preferences/_packaging.py | 2 +- .../_user_preference.py | 2 +- services/dynamic-sidecar/tests/conftest.py | 2 +- .../test_modules_long_running_tasks.py | 2 +- .../test_modules_user_services_preferences.py | 2 +- .../test_api_containers_long_running_tasks.py | 2 +- .../tests/unit/test_api_prometheus_metrics.py | 2 +- .../unit/test_api_workflow_service_metrics.py | 2 +- .../tests/unit/test_core_docker_utils.py | 2 +- .../tests/unit/test_core_reserved_space.py | 2 +- .../tests/unit/test_models_shared_store.py | 2 +- .../test_modules_outputs_directory_utils.py | 2 +- .../unit/test_modules_outputs_event_filter.py | 2 +- .../test_modules_outputs_event_handler.py | 2 +- .../unit/test_modules_outputs_manager.py | 2 +- .../unit/test_modules_outputs_watcher.py | 2 +- .../unit/test_modules_prometheus_metrics.py | 2 +- ...test_modules_system_monitor__disk_usage.py | 2 +- .../test_modules_system_monitor__notifier.py | 2 +- ...er_services_preferences_user_preference.py | 2 +- services/efs-guardian/requirements/_base.txt | 31 +- services/efs-guardian/requirements/_test.txt | 27 +- services/efs-guardian/requirements/_tools.txt | 10 - .../src/simcore_service_efs_guardian/_meta.py | 2 +- .../core/settings.py | 2 +- services/invitations/requirements/_base.txt | 25 +- services/invitations/requirements/_test.txt | 14 - services/invitations/requirements/_tools.txt | 11 - .../simcore_service_invitations/api/_meta.py | 2 +- .../src/simcore_service_invitations/cli.py | 2 +- .../core/settings.py | 2 +- .../services/invitations.py | 2 +- .../tests/unit/test__model_examples.py | 2 +- .../tests/unit/test_invitations.py | 2 +- services/migration/requirements/_test.txt | 7 - services/migration/requirements/_tools.txt | 10 - .../requirements/_base.txt | 12 +- .../requirements/_test.txt | 11 - .../requirements/_tools.txt | 10 - .../osparc_gateway_server/backend/models.py | 2 +- .../osparc_gateway_server/backend/settings.py | 2 +- services/payments/requirements/_base.txt | 198 +++++++++-- services/payments/requirements/_test.txt | 15 - services/payments/requirements/_tools.txt | 10 - .../scripts/example_payment_gateway.py | 2 +- .../api/rpc/_payments.py | 2 +- .../api/rpc/_payments_methods.py | 2 +- .../simcore_service_payments/core/errors.py | 2 +- .../simcore_service_payments/core/settings.py | 2 +- .../db/auto_recharge_repo.py | 2 +- .../db/payments_methods_repo.py | 2 +- .../db/payments_transactions_repo.py | 2 +- .../simcore_service_payments/models/auth.py | 2 +- .../src/simcore_service_payments/models/db.py | 2 +- .../models/payments_gateway.py | 2 +- .../models/schemas/acknowledgements.py | 2 +- .../models/schemas/auth.py | 2 +- .../models/schemas/meta.py | 2 +- .../simcore_service_payments/models/stripe.py | 2 +- .../services/auto_recharge_process_message.py | 2 +- .../services/notifier_email.py | 2 +- .../services/payments.py | 2 +- .../services/payments_gateway.py | 4 +- .../services/payments_methods.py | 2 +- services/payments/tests/conftest.py | 2 +- .../api/test__one_time_payment_workflows.py | 2 +- .../api/test__payment_method_workflows.py | 2 +- .../payments/tests/unit/api/test_rest_auth.py | 2 +- services/payments/tests/unit/conftest.py | 2 +- .../tests/unit/test__model_examples.py | 2 +- .../payments/tests/unit/test_rpc_payments.py | 2 +- .../tests/unit/test_rpc_payments_methods.py | 2 +- .../tests/unit/test_services_notifier.py | 2 +- .../unit/test_services_notifier_email.py | 2 +- .../tests/unit/test_services_payments.py | 2 +- .../test_services_payments__get_invoice.py | 2 +- .../requirements/_base.txt | 33 +- .../requirements/_test.txt | 27 +- .../requirements/_tools.txt | 10 - .../_meta.py | 2 +- .../api/rest/_meta.py | 2 +- .../api/rpc/_resource_tracker.py | 2 +- .../core/settings.py | 2 +- .../resource_tracker_credit_transactions.py | 2 +- .../models/resource_tracker_pricing_plans.py | 2 +- .../resource_tracker_pricing_unit_costs.py | 2 +- .../models/resource_tracker_pricing_units.py | 2 +- .../models/resource_tracker_service_runs.py | 2 +- .../db/repositories/resource_tracker.py | 2 +- .../resource_tracker_background_task.py | 2 +- .../resource_tracker_process_messages.py | 2 +- .../resource_tracker_utils.py | 2 +- .../services/resource_tracker_service_runs.py | 2 +- ...i_resource_tracker_service_runs__export.py | 2 +- services/storage/requirements/_base.txt | 12 +- services/storage/requirements/_test.txt | 26 +- services/storage/requirements/_tools.txt | 10 - .../src/simcore_service_storage/constants.py | 2 +- .../datcore_adapter/datcore_adapter.py | 2 +- .../datcore_adapter_settings.py | 2 +- .../simcore_service_storage/datcore_dsm.py | 2 +- .../simcore_service_storage/db_projects.py | 2 +- .../simcore_service_storage/dsm_factory.py | 2 +- .../src/simcore_service_storage/exceptions.py | 2 +- .../simcore_service_storage/handlers_files.py | 2 +- .../src/simcore_service_storage/models.py | 2 +- .../src/simcore_service_storage/s3_utils.py | 2 +- .../src/simcore_service_storage/settings.py | 2 +- .../simcore_service_storage/simcore_s3_dsm.py | 2 +- .../simcore_s3_dsm_utils.py | 2 +- .../simcore_service_storage/utils_handlers.py | 2 +- services/storage/tests/conftest.py | 2 +- .../storage/tests/fixtures/data_models.py | 2 +- services/storage/tests/unit/test_dsm.py | 2 +- .../storage/tests/unit/test_dsm_dsmcleaner.py | 2 +- .../storage/tests/unit/test_dsm_soft_links.py | 2 +- .../tests/unit/test_handlers_datasets.py | 2 +- .../storage/tests/unit/test_handlers_files.py | 2 +- .../unit/test_handlers_files_metadata.py | 2 +- .../tests/unit/test_handlers_simcore_s3.py | 2 +- services/storage/tests/unit/test_models.py | 2 +- .../storage/tests/unit/test_simcore_s3_dsm.py | 2 +- services/storage/tests/unit/test_utils.py | 2 +- .../storage/tests/unit/test_utils_handlers.py | 2 +- services/web/server/requirements/_base.txt | 10 +- services/web/server/requirements/_test.txt | 3 - services/web/server/requirements/_tools.txt | 8 - .../activity/_handlers.py | 2 +- .../announcements/_models.py | 2 +- .../announcements/_redis.py | 2 +- .../api_keys/_handlers.py | 2 +- .../application_settings.py | 6 +- .../application_settings_utils.py | 2 +- .../simcore_service_webserver/catalog/_api.py | 2 +- .../catalog/_handlers.py | 2 +- .../catalog/client.py | 2 +- .../clusters/_handlers.py | 2 +- .../_db_comp_tasks_listening_task.py | 2 +- .../diagnostics/_handlers.py | 2 +- .../diagnostics/settings.py | 2 +- .../director_v2/_api_utils.py | 2 +- .../director_v2/_core_computations.py | 4 +- .../director_v2/_core_dynamic_services.py | 4 +- .../director_v2/_handlers.py | 4 +- .../director_v2/_models.py | 4 +- .../director_v2/settings.py | 2 +- .../dynamic_scheduler/api.py | 2 +- .../dynamic_scheduler/settings.py | 2 +- .../email/_handlers.py | 2 +- .../exporter/_formatter/_sds.py | 2 +- .../_formatter/xlsx/code_description.py | 2 +- .../_formatter/xlsx/core/xlsx_base.py | 2 +- .../_formatter/xlsx/dataset_description.py | 2 +- .../exporter/_formatter/xlsx/utils.py | 2 +- .../exporter/settings.py | 2 +- .../folders/_folders_api.py | 2 +- .../folders/_folders_handlers.py | 2 +- .../folders/_groups_api.py | 2 +- .../folders/_groups_handlers.py | 2 +- .../garbage_collector/settings.py | 2 +- .../groups/_classifiers.py | 2 +- .../simcore_service_webserver/groups/_db.py | 2 +- .../groups/_handlers.py | 2 +- .../invitations/_client.py | 2 +- .../invitations/_core.py | 2 +- .../invitations/settings.py | 2 +- .../login/_2fa_api.py | 2 +- .../login/_2fa_handlers.py | 2 +- .../login/_auth_handlers.py | 2 +- .../login/_models.py | 2 +- .../login/_registration.py | 2 +- .../login/_registration_api.py | 2 +- .../login/_registration_handlers.py | 2 +- .../login/handlers_change.py | 2 +- .../login/handlers_confirmation.py | 2 +- .../login/handlers_registration.py | 2 +- .../simcore_service_webserver/login/plugin.py | 2 +- .../login/settings.py | 6 +- .../simcore_service_webserver/login/utils.py | 2 +- .../long_running_tasks.py | 2 +- .../meta_modeling/_handlers.py | 6 +- .../meta_modeling/_iterations.py | 6 +- .../meta_modeling/_results.py | 2 +- .../_rabbitmq_exclusive_queue_consumers.py | 2 +- .../payments/_autorecharge_db.py | 2 +- .../payments/_methods_api.py | 2 +- .../payments/_methods_db.py | 2 +- .../payments/_onetime_api.py | 2 +- .../payments/_onetime_db.py | 2 +- .../payments/_rpc.py | 2 +- .../payments/_tasks.py | 2 +- .../payments/settings.py | 2 +- .../products/_events.py | 2 +- .../products/_handlers.py | 2 +- .../products/_invitations_handlers.py | 2 +- .../products/_model.py | 2 +- .../projects/_comments_api.py | 2 +- .../projects/_comments_db.py | 4 +- .../projects/_comments_handlers.py | 2 +- .../projects/_common_models.py | 2 +- .../projects/_crud_api_create.py | 2 +- .../projects/_crud_api_read.py | 2 +- .../projects/_crud_handlers.py | 2 +- .../projects/_crud_handlers_models.py | 2 +- .../projects/_db_utils.py | 2 +- .../projects/_folders_handlers.py | 2 +- .../projects/_groups_api.py | 2 +- .../projects/_groups_db.py | 2 +- .../projects/_groups_handlers.py | 2 +- .../projects/_metadata_api.py | 2 +- .../projects/_metadata_db.py | 2 +- .../projects/_nodes_api.py | 2 +- .../projects/_nodes_handlers.py | 2 +- .../projects/_ports_api.py | 2 +- .../projects/_ports_handlers.py | 2 +- .../_projects_nodes_pricing_unit_handlers.py | 4 +- .../projects/_states_handlers.py | 2 +- .../projects/_wallets_handlers.py | 2 +- .../simcore_service_webserver/projects/db.py | 4 +- .../projects/models.py | 2 +- .../projects/projects_api.py | 2 +- .../projects/settings.py | 2 +- .../projects/utils.py | 2 +- .../resource_manager/settings.py | 2 +- .../resource_usage/_client.py | 2 +- .../_pricing_plans_admin_handlers.py | 2 +- .../resource_usage/_pricing_plans_handlers.py | 2 +- .../resource_usage/_service_runs_api.py | 2 +- .../resource_usage/_service_runs_handlers.py | 2 +- .../rest/_handlers.py | 2 +- .../scicrunch/_resolver.py | 6 +- .../scicrunch/_rest.py | 2 +- .../scicrunch/models.py | 2 +- .../scicrunch/service_client.py | 2 +- .../scicrunch/settings.py | 2 +- .../security/_authz_db.py | 2 +- .../session/access_policies.py | 2 +- .../session/settings.py | 8 +- .../socketio/models.py | 2 +- .../statics/settings.py | 2 +- .../storage/_handlers.py | 2 +- .../simcore_service_webserver/storage/api.py | 2 +- .../storage/schemas.py | 2 +- .../storage/settings.py | 2 +- .../studies_dispatcher/_catalog.py | 2 +- .../studies_dispatcher/_core.py | 2 +- .../studies_dispatcher/_models.py | 2 +- .../studies_dispatcher/_projects.py | 2 +- .../_projects_permalinks.py | 2 +- .../studies_dispatcher/_redirects_handlers.py | 2 +- .../studies_dispatcher/_rest_handlers.py | 4 +- .../studies_dispatcher/_users.py | 2 +- .../studies_dispatcher/settings.py | 4 +- .../tags/_handlers.py | 2 +- .../simcore_service_webserver/users/_api.py | 2 +- .../users/_handlers.py | 2 +- .../users/_notifications.py | 2 +- .../users/_notifications_handlers.py | 2 +- .../users/_preferences_api.py | 2 +- .../users/_preferences_handlers.py | 2 +- .../users/_preferences_models.py | 2 +- .../users/_schemas.py | 2 +- .../users/_tokens_handlers.py | 2 +- .../simcore_service_webserver/users/api.py | 2 +- .../users/schemas.py | 2 +- .../users/settings.py | 2 +- .../utils_aiohttp.py | 4 +- .../version_control/_core.py | 2 +- .../version_control/_handlers.py | 2 +- .../version_control/_handlers_base.py | 2 +- .../version_control/db.py | 2 +- .../version_control/models.py | 11 +- .../simcore_service_webserver/wallets/_api.py | 2 +- .../simcore_service_webserver/wallets/_db.py | 2 +- .../wallets/_events.py | 2 +- .../wallets/_groups_api.py | 2 +- .../wallets/_groups_db.py | 2 +- .../wallets/_groups_handlers.py | 2 +- .../wallets/_handlers.py | 2 +- .../isolated/test_application_settings.py | 2 +- .../unit/isolated/test_login_settings.py | 2 +- .../unit/isolated/test_products_model.py | 2 +- .../unit/isolated/test_projects__nodes_api.py | 2 +- .../test_projects__nodes_resources.py | 2 +- .../tests/unit/isolated/test_security_api.py | 2 +- .../unit/isolated/test_statics_settings.py | 2 +- .../unit/isolated/test_storage_schemas.py | 2 +- .../isolated/test_studies_dispatcher_core.py | 6 +- .../test_studies_dispatcher_models.py | 2 +- .../test_studies_dispatcher_settings.py | 2 +- .../tests/unit/isolated/test_users_models.py | 2 +- .../tests/unit/isolated/test_utils_aiohttp.py | 2 +- .../unit/isolated/test_utils_rate_limiting.py | 2 +- .../test_studies_dispatcher_handlers.py | 2 +- .../unit/with_dbs/01/test_api_keys_rpc.py | 2 +- .../01/test_catalog_handlers__pricing_plan.py | 2 +- .../01/test_catalog_handlers__services.py | 2 +- ...st_catalog_handlers__services_resources.py | 2 +- .../server/tests/unit/with_dbs/02/conftest.py | 2 +- .../unit/with_dbs/02/test_announcements.py | 2 +- .../unit/with_dbs/02/test_project_lock.py | 2 +- .../02/test_projects_cancellations.py | 2 +- .../02/test_projects_crud_handlers.py | 2 +- .../02/test_projects_crud_handlers__clone.py | 2 +- ...s_crud_handlers__list_with_query_params.py | 2 +- .../02/test_projects_metadata_handlers.py | 2 +- .../02/test_projects_nodes_handler.py | 2 +- ...st_projects_nodes_pricing_unit_handlers.py | 2 +- .../02/test_projects_ports_handlers.py | 2 +- .../02/test_projects_wallet_handlers.py | 2 +- ...login_handlers_registration_invitations.py | 2 +- .../test_products__invitations_handlers.py | 2 +- .../03/login/test_login_2fa_resend.py | 2 +- .../test_meta_modeling_results.py | 2 +- .../with_dbs/03/products/test_products_rpc.py | 2 +- .../test_admin_pricing_plans.py | 2 +- .../03/resource_usage/test_pricing_plans.py | 2 +- .../test_usage_services__export.py | 2 +- .../tests/unit/with_dbs/03/test_email.py | 2 +- .../unit/with_dbs/03/test_storage_handlers.py | 2 +- .../with_dbs/03/test_users__notifications.py | 2 +- .../03/test_users__preferences_api.py | 4 +- .../version_control/test_version_control.py | 2 +- .../test_version_control_handlers.py | 2 +- .../with_dbs/03/wallets/payments/conftest.py | 2 +- .../03/wallets/payments/test_payments.py | 2 +- .../wallets/payments/test_payments_methods.py | 2 +- .../03/wallets/payments/test_payments_rpc.py | 2 +- .../server/tests/unit/with_dbs/conftest.py | 2 +- tests/e2e-playwright/tests/conftest.py | 27 +- .../tests/jupyterlabs/conftest.py | 2 +- .../tests/jupyterlabs/test_jupyterlab.py | 2 +- .../test_resource_usage_tracker.py | 2 +- .../e2e-playwright/tests/sim4life/conftest.py | 2 +- tests/performance/locust_files/locustfile.py | 4 +- .../locust_files/metamodeling/workflow.py | 4 +- .../locust_files/platform_ping_test.py | 4 +- tests/performance/locust_settings.py | 4 +- 1002 files changed, 1904 insertions(+), 2017 deletions(-) diff --git a/api/specs/storage/scripts/storage.py b/api/specs/storage/scripts/storage.py index 24c0b06a48e..fa27c6f0fad 100644 --- a/api/specs/storage/scripts/storage.py +++ b/api/specs/storage/scripts/storage.py @@ -26,7 +26,7 @@ from models_library.projects_nodes import NodeID from models_library.projects_nodes_io import LocationID, StorageFileID from models_library.users import UserID -from pydantic import AnyUrl, ByteSize +from pydantic.v1 import AnyUrl, ByteSize from servicelib.long_running_tasks._models import TaskGet, TaskId, TaskStatus from settings_library.s3 import S3Settings from simcore_service_storage._meta import API_VTAG diff --git a/api/specs/web-server/_auth.py b/api/specs/web-server/_auth.py index 9214d5f60fd..cb7bc4307e8 100644 --- a/api/specs/web-server/_auth.py +++ b/api/specs/web-server/_auth.py @@ -15,7 +15,7 @@ UnregisterCheck, ) from models_library.generics import Envelope -from pydantic import BaseModel, Field, confloat +from pydantic.v1 import BaseModel, Field, confloat from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.login._2fa_handlers import Resend2faBody from simcore_service_webserver.login._auth_handlers import ( diff --git a/api/specs/web-server/_common.py b/api/specs/web-server/_common.py index f3dcd66bc5c..4678d2f1b25 100644 --- a/api/specs/web-server/_common.py +++ b/api/specs/web-server/_common.py @@ -10,8 +10,8 @@ import yaml from fastapi import FastAPI from models_library.basic_types import LogLevel -from pydantic import BaseModel, Field -from pydantic.fields import FieldInfo +from pydantic.v1 import BaseModel, Field +from pydantic.v1.fields import FieldInfo from servicelib.fastapi.openapi import override_fastapi_openapi_method CURRENT_DIR = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent diff --git a/api/specs/web-server/_folders.py b/api/specs/web-server/_folders.py index db5ca1416f7..ef97a4ce51f 100644 --- a/api/specs/web-server/_folders.py +++ b/api/specs/web-server/_folders.py @@ -17,7 +17,7 @@ ) from models_library.generics import Envelope from models_library.rest_pagination import PageQueryParameters -from pydantic import Json +from pydantic.v1 import Json from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.folders._folders_handlers import FoldersPathParams from simcore_service_webserver.folders._groups_api import FolderGroupGet diff --git a/api/specs/web-server/_nih_sparc_redirections.py b/api/specs/web-server/_nih_sparc_redirections.py index df1693e2877..9f5b3298786 100644 --- a/api/specs/web-server/_nih_sparc_redirections.py +++ b/api/specs/web-server/_nih_sparc_redirections.py @@ -12,7 +12,7 @@ from fastapi.responses import RedirectResponse from models_library.projects import ProjectID from models_library.services import ServiceKey, ServiceKeyVersion -from pydantic import HttpUrl, PositiveInt +from pydantic.v1 import HttpUrl, PositiveInt router = APIRouter( prefix="", # NOTE: no API vtag! diff --git a/api/specs/web-server/_projects_comments.py b/api/specs/web-server/_projects_comments.py index 9f1ac0f1bd2..6113afa2442 100644 --- a/api/specs/web-server/_projects_comments.py +++ b/api/specs/web-server/_projects_comments.py @@ -15,7 +15,7 @@ from models_library.generics import Envelope from models_library.projects import ProjectID from models_library.projects_comments import CommentID, ProjectsCommentsAPI -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.projects._comments_handlers import ( _ProjectCommentsBodyParams, diff --git a/api/specs/web-server/_projects_crud.py b/api/specs/web-server/_projects_crud.py index 1b6030cc061..051f0b90c33 100644 --- a/api/specs/web-server/_projects_crud.py +++ b/api/specs/web-server/_projects_crud.py @@ -28,7 +28,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.rest_pagination import Page -from pydantic import Json +from pydantic.v1 import Json from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.projects._common_models import ProjectPathParams from simcore_service_webserver.projects._crud_handlers import ProjectCreateParams diff --git a/api/specs/web-server/_projects_states.py b/api/specs/web-server/_projects_states.py index 0c737062285..99f69c51a54 100644 --- a/api/specs/web-server/_projects_states.py +++ b/api/specs/web-server/_projects_states.py @@ -10,7 +10,7 @@ from models_library.api_schemas_webserver.projects import ProjectGet from models_library.generics import Envelope from models_library.projects_state import ProjectState -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.aiohttp import status from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.director_v2.exceptions import DirectorServiceError diff --git a/api/specs/web-server/_resource_usage.py b/api/specs/web-server/_resource_usage.py index c60ab4f36b5..11f3960b17a 100644 --- a/api/specs/web-server/_resource_usage.py +++ b/api/specs/web-server/_resource_usage.py @@ -34,7 +34,7 @@ ) from models_library.rest_pagination import DEFAULT_NUMBER_OF_ITEMS_PER_PAGE from models_library.wallets import WalletID -from pydantic import Json, NonNegativeInt +from pydantic.v1 import Json, NonNegativeInt from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.resource_usage._pricing_plans_admin_handlers import ( _GetPricingPlanPathParams, diff --git a/api/specs/web-server/_storage.py b/api/specs/web-server/_storage.py index 61326395e23..9a8053c05f0 100644 --- a/api/specs/web-server/_storage.py +++ b/api/specs/web-server/_storage.py @@ -19,7 +19,7 @@ ) from models_library.generics import Envelope from models_library.projects_nodes_io import LocationID -from pydantic import AnyUrl, ByteSize +from pydantic.v1 import AnyUrl, ByteSize from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.storage.schemas import DatasetMetaData, FileMetaData diff --git a/packages/aws-library/requirements/_base.txt b/packages/aws-library/requirements/_base.txt index ccbecd13ec0..8fcaae37c23 100644 --- a/packages/aws-library/requirements/_base.txt +++ b/packages/aws-library/requirements/_base.txt @@ -32,6 +32,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.4.0 # via # fast-depends @@ -41,10 +43,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==24.2.0 # via # aiohttp @@ -65,8 +63,6 @@ dnspython==2.6.1 # via email-validator email-validator==2.2.0 # via pydantic -exceptiongroup==1.2.2 - # via anyio fast-depends==2.4.8 # via faststream faststream==0.5.18 @@ -110,7 +106,7 @@ orjson==3.10.7 # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in pamqp==3.3.0 # via aiormq -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -125,6 +121,8 @@ pydantic==1.10.17 # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/_base.in # fast-depends +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.7.2 @@ -201,9 +199,9 @@ types-python-dateutil==2.9.0.20240821 typing-extensions==4.12.2 # via # aiodebug - # anyio # faststream # pydantic + # pydantic-core # typer # types-aiobotocore # types-aiobotocore-ec2 diff --git a/packages/aws-library/requirements/_test.txt b/packages/aws-library/requirements/_test.txt index 16dfce7ed1e..e3459e1651f 100644 --- a/packages/aws-library/requirements/_test.txt +++ b/packages/aws-library/requirements/_test.txt @@ -1,3 +1,7 @@ +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic antlr4-python3-runtime==4.13.2 # via moto appdirs==1.4.4 @@ -58,10 +62,6 @@ cryptography==43.0.0 # moto docker==7.1.0 # via moto -exceptiongroup==1.2.2 - # via - # -c requirements/_base.txt - # pytest faker==27.0.0 # via -r requirements/_test.in flask==3.0.3 @@ -155,11 +155,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pytest==8.3.2 @@ -246,10 +250,6 @@ sympy==1.13.2 # via cfn-lint termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest types-aioboto3==13.1.1 # via -r requirements/_test.in types-aiobotocore==2.13.2 @@ -276,6 +276,7 @@ typing-extensions==4.12.2 # flexparser # pint # pydantic + # pydantic-core # types-aioboto3 # types-aiobotocore urllib3==2.2.2 diff --git a/packages/aws-library/requirements/_tools.txt b/packages/aws-library/requirements/_tools.txt index a581984c3c4..1c9b94efc3e 100644 --- a/packages/aws-library/requirements/_tools.txt +++ b/packages/aws-library/requirements/_tools.txt @@ -72,22 +72,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/aws-library/src/aws_library/ec2/_client.py b/packages/aws-library/src/aws_library/ec2/_client.py index 14094939dde..d2b93660226 100644 --- a/packages/aws-library/src/aws_library/ec2/_client.py +++ b/packages/aws-library/src/aws_library/ec2/_client.py @@ -8,7 +8,7 @@ import botocore.exceptions from aiobotocore.session import ClientCreatorContext from aiocache import cached # type: ignore[import-untyped] -from pydantic import ByteSize, PositiveInt +from pydantic.v1 import ByteSize, PositiveInt from servicelib.logging_utils import log_context from settings_library.ec2 import EC2Settings from types_aiobotocore_ec2 import EC2Client diff --git a/packages/aws-library/src/aws_library/ec2/_models.py b/packages/aws-library/src/aws_library/ec2/_models.py index fed1f3ea46a..059d153d873 100644 --- a/packages/aws-library/src/aws_library/ec2/_models.py +++ b/packages/aws-library/src/aws_library/ec2/_models.py @@ -6,7 +6,7 @@ import sh # type: ignore[import-untyped] from models_library.docker import DockerGenericTag -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, ConstrainedStr, diff --git a/packages/aws-library/src/aws_library/s3/_client.py b/packages/aws-library/src/aws_library/s3/_client.py index 986e3cae55e..527aa740996 100644 --- a/packages/aws-library/src/aws_library/s3/_client.py +++ b/packages/aws-library/src/aws_library/s3/_client.py @@ -14,7 +14,7 @@ from botocore.client import Config from models_library.api_schemas_storage import ETag, S3BucketName, UploadedPart from models_library.basic_types import SHA256Str -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.logging_utils import log_catch, log_context from servicelib.utils import limited_gather from settings_library.s3 import S3Settings diff --git a/packages/aws-library/src/aws_library/s3/_constants.py b/packages/aws-library/src/aws_library/s3/_constants.py index cc246e8d0ba..a989a6b17bd 100644 --- a/packages/aws-library/src/aws_library/s3/_constants.py +++ b/packages/aws-library/src/aws_library/s3/_constants.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as # NOTE: AWS S3 upload limits https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html MULTIPART_UPLOADS_MIN_TOTAL_SIZE: Final[ByteSize] = parse_obj_as(ByteSize, "100MiB") diff --git a/packages/aws-library/src/aws_library/s3/_errors.py b/packages/aws-library/src/aws_library/s3/_errors.py index f297b04b64d..58c419e0127 100644 --- a/packages/aws-library/src/aws_library/s3/_errors.py +++ b/packages/aws-library/src/aws_library/s3/_errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class S3RuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/packages/aws-library/src/aws_library/s3/_models.py b/packages/aws-library/src/aws_library/s3/_models.py index 63e7ad15699..0aa170546e3 100644 --- a/packages/aws-library/src/aws_library/s3/_models.py +++ b/packages/aws-library/src/aws_library/s3/_models.py @@ -4,7 +4,7 @@ from models_library.api_schemas_storage import ETag from models_library.basic_types import SHA256Str -from pydantic import AnyUrl, BaseModel, ByteSize +from pydantic.v1 import AnyUrl, BaseModel, ByteSize from types_aiobotocore_s3.type_defs import HeadObjectOutputTypeDef, ObjectTypeDef S3ObjectKey: TypeAlias = str diff --git a/packages/aws-library/src/aws_library/s3/_utils.py b/packages/aws-library/src/aws_library/s3/_utils.py index 00a1bcc59bb..20297dbd1b8 100644 --- a/packages/aws-library/src/aws_library/s3/_utils.py +++ b/packages/aws-library/src/aws_library/s3/_utils.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as _MULTIPART_MAX_NUMBER_OF_PARTS: Final[int] = 10000 diff --git a/packages/aws-library/src/aws_library/ssm/_errors.py b/packages/aws-library/src/aws_library/ssm/_errors.py index 32300d08d29..3d969043fb6 100644 --- a/packages/aws-library/src/aws_library/ssm/_errors.py +++ b/packages/aws-library/src/aws_library/ssm/_errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class SSMRuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/packages/aws-library/tests/test_ec2_models.py b/packages/aws-library/tests/test_ec2_models.py index f7c114932be..358d7f851a4 100644 --- a/packages/aws-library/tests/test_ec2_models.py +++ b/packages/aws-library/tests/test_ec2_models.py @@ -6,7 +6,7 @@ import pytest from aws_library.ec2._models import AWSTagKey, AWSTagValue, EC2InstanceData, Resources from faker import Faker -from pydantic import ByteSize, ValidationError, parse_obj_as +from pydantic.v1 import ByteSize, ValidationError, parse_obj_as @pytest.mark.parametrize( diff --git a/packages/aws-library/tests/test_s3_client.py b/packages/aws-library/tests/test_s3_client.py index ba7c9366dca..e5c35411ca6 100644 --- a/packages/aws-library/tests/test_s3_client.py +++ b/packages/aws-library/tests/test_s3_client.py @@ -32,7 +32,7 @@ from models_library.api_schemas_storage import S3BucketName, UploadedPart from models_library.basic_types import SHA256Str from moto.server import ThreadedMotoServer -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from pytest_benchmark.plugin import BenchmarkFixture from pytest_simcore.helpers.logging_tools import log_context from pytest_simcore.helpers.parametrizations import ( diff --git a/packages/aws-library/tests/test_s3_utils.py b/packages/aws-library/tests/test_s3_utils.py index 5354da8bc66..1875523a545 100644 --- a/packages/aws-library/tests/test_s3_utils.py +++ b/packages/aws-library/tests/test_s3_utils.py @@ -10,7 +10,7 @@ _MULTIPART_UPLOADS_TARGET_MAX_PART_SIZE, compute_num_file_chunks, ) -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.parametrizations import byte_size_ids diff --git a/packages/dask-task-models-library/requirements/_base.txt b/packages/dask-task-models-library/requirements/_base.txt index 327a04c5678..d11fbd11ec5 100644 --- a/packages/dask-task-models-library/requirements/_base.txt +++ b/packages/dask-task-models-library/requirements/_base.txt @@ -1,3 +1,5 @@ +annotated-types==0.7.0 + # via pydantic arrow==1.3.0 # via -r requirements/../../../packages/models-library/requirements/_base.in attrs==24.2.0 @@ -65,7 +67,7 @@ partd==1.4.2 # via dask psutil==6.0.0 # via distributed -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt @@ -73,6 +75,8 @@ pydantic==1.10.17 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/_base.in +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich python-dateutil==2.9.0.post0 @@ -118,6 +122,7 @@ types-python-dateutil==2.9.0.20240821 typing-extensions==4.12.2 # via # pydantic + # pydantic-core # typer urllib3==2.2.2 # via diff --git a/packages/dask-task-models-library/requirements/_test.txt b/packages/dask-task-models-library/requirements/_test.txt index aa7e91d4d23..521d13265d9 100644 --- a/packages/dask-task-models-library/requirements/_test.txt +++ b/packages/dask-task-models-library/requirements/_test.txt @@ -4,8 +4,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in flexcache==0.3 @@ -67,10 +65,6 @@ six==1.16.0 # python-dateutil termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest typing-extensions==4.12.2 # via # -c requirements/_base.txt diff --git a/packages/dask-task-models-library/requirements/_tools.txt b/packages/dask-task-models-library/requirements/_tools.txt index b76f8083592..b9ee0a3c96d 100644 --- a/packages/dask-task-models-library/requirements/_tools.txt +++ b/packages/dask-task-models-library/requirements/_tools.txt @@ -70,22 +70,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/docker.py b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/docker.py index 4e9d36df3fb..417d4cde8c7 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/docker.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/docker.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Extra, SecretStr +from pydantic.v1 import BaseModel, Extra, SecretStr class DockerBasicAuth(BaseModel): diff --git a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py index f4060531f7f..00247a247d7 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/errors.py @@ -1,7 +1,7 @@ """ Dask task exceptions """ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class TaskValueError(PydanticErrorMixin, ValueError): diff --git a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/events.py b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/events.py index 1455c00cbff..a274683a7b0 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/events.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/events.py @@ -4,7 +4,7 @@ import dask.typing from distributed.worker import get_worker -from pydantic import BaseModel, Extra, validator +from pydantic.v1 import BaseModel, Extra, validator from .protocol import TaskOwner diff --git a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py index 887397d4227..236e55550c9 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py @@ -6,7 +6,7 @@ from models_library.basic_regex import MIME_TYPE_RE from models_library.generics import DictModel from models_library.services_types import ServicePortKey -from pydantic import ( +from pydantic.v1 import ( AnyUrl, BaseModel, Extra, diff --git a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/protocol.py b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/protocol.py index 00f89d96d94..eb3433cf2c7 100644 --- a/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/protocol.py +++ b/packages/dask-task-models-library/src/dask_task_models_library/container_tasks/protocol.py @@ -6,7 +6,7 @@ from models_library.projects_nodes_io import NodeID from models_library.services_resources import BootMode from models_library.users import UserID -from pydantic import AnyUrl, BaseModel, root_validator +from pydantic.v1 import AnyUrl, BaseModel, root_validator from settings_library.s3 import S3Settings from .docker import DockerBasicAuth diff --git a/packages/dask-task-models-library/tests/container_tasks/test_protocol.py b/packages/dask-task-models-library/tests/container_tasks/test_protocol.py index d17202adabd..2ad2441c7d2 100644 --- a/packages/dask-task-models-library/tests/container_tasks/test_protocol.py +++ b/packages/dask-task-models-library/tests/container_tasks/test_protocol.py @@ -4,7 +4,7 @@ TaskOwner, ) from faker import Faker -from pydantic import ValidationError +from pydantic.v1 import ValidationError @pytest.mark.parametrize("model_cls", [TaskOwner, ContainerTaskParameters]) diff --git a/packages/models-library/requirements/_base.txt b/packages/models-library/requirements/_base.txt index f900e7715f0..da43d3f3802 100644 --- a/packages/models-library/requirements/_base.txt +++ b/packages/models-library/requirements/_base.txt @@ -1,3 +1,5 @@ +annotated-types==0.7.0 + # via pydantic arrow==1.3.0 # via -r requirements/_base.in attrs==24.2.0 @@ -18,10 +20,12 @@ orjson==3.10.7 # via # -c requirements/../../../requirements/constraints.txt # -r requirements/_base.in -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -r requirements/_base.in +pydantic-core==2.20.1 + # via pydantic python-dateutil==2.9.0.post0 # via arrow referencing==0.35.1 @@ -37,4 +41,6 @@ six==1.16.0 types-python-dateutil==2.9.0.20240821 # via arrow typing-extensions==4.12.2 - # via pydantic + # via + # pydantic + # pydantic-core diff --git a/packages/models-library/requirements/_test.txt b/packages/models-library/requirements/_test.txt index 9457e941448..1cdf223883d 100644 --- a/packages/models-library/requirements/_test.txt +++ b/packages/models-library/requirements/_test.txt @@ -8,8 +8,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in flexcache==0.3 @@ -87,10 +85,6 @@ six==1.16.0 # python-dateutil termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest types-jsonschema==4.23.0.20240813 # via -r requirements/_test.in types-pyyaml==6.0.12.20240808 diff --git a/packages/models-library/requirements/_tools.txt b/packages/models-library/requirements/_tools.txt index 0ea376ae45a..0efdb113971 100644 --- a/packages/models-library/requirements/_tools.txt +++ b/packages/models-library/requirements/_tools.txt @@ -78,14 +78,6 @@ setuptools==73.0.1 # via pip-tools shellingham==1.5.4 # via typer -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typer==0.12.4 @@ -94,8 +86,6 @@ typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy # typer virtualenv==20.26.3 diff --git a/packages/models-library/scripts/validate-pg-projects.py b/packages/models-library/scripts/validate-pg-projects.py index e74b438698d..26b317b7773 100755 --- a/packages/models-library/scripts/validate-pg-projects.py +++ b/packages/models-library/scripts/validate-pg-projects.py @@ -4,8 +4,8 @@ import typer from models_library.projects import ProjectAtDB -from pydantic import Json, ValidationError, validator -from pydantic.main import Extra +from pydantic.v1 import Json, ValidationError, validator +from pydantic.v1.main import Extra class ProjectFromCsv(ProjectAtDB): diff --git a/packages/models-library/src/models_library/aiodocker_api.py b/packages/models-library/src/models_library/aiodocker_api.py index 757036f31e8..e145fcbc5b0 100644 --- a/packages/models-library/src/models_library/aiodocker_api.py +++ b/packages/models-library/src/models_library/aiodocker_api.py @@ -1,4 +1,4 @@ -from pydantic import Field, validator +from pydantic.v1 import Field, validator from .generated_models.docker_rest_api import ( ContainerSpec, diff --git a/packages/models-library/src/models_library/api_schemas__common/errors.py b/packages/models-library/src/models_library/api_schemas__common/errors.py index 92ed48088d0..c09a0f780a9 100644 --- a/packages/models-library/src/models_library/api_schemas__common/errors.py +++ b/packages/models-library/src/models_library/api_schemas__common/errors.py @@ -1,7 +1,7 @@ import http from typing import Any -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..basic_types import IDStr from ..utils.pydantic_tools_extension import NOT_REQUIRED diff --git a/packages/models-library/src/models_library/api_schemas__common/meta.py b/packages/models-library/src/models_library/api_schemas__common/meta.py index 8cd2db53ae6..0261a05caae 100644 --- a/packages/models-library/src/models_library/api_schemas__common/meta.py +++ b/packages/models-library/src/models_library/api_schemas__common/meta.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..basic_types import VersionStr diff --git a/packages/models-library/src/models_library/api_schemas_api_server/api_keys.py b/packages/models-library/src/models_library/api_schemas_api_server/api_keys.py index d828fc6507d..3d81e3e495b 100644 --- a/packages/models-library/src/models_library/api_schemas_api_server/api_keys.py +++ b/packages/models-library/src/models_library/api_schemas_api_server/api_keys.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field, SecretStr +from pydantic.v1 import BaseModel, Field, SecretStr class ApiKey(BaseModel): diff --git a/packages/models-library/src/models_library/api_schemas_catalog/__init__.py b/packages/models-library/src/models_library/api_schemas_catalog/__init__.py index 84d761729a4..4367c7b26c2 100644 --- a/packages/models-library/src/models_library/api_schemas_catalog/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_catalog/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_catalog/service_access_rights.py b/packages/models-library/src/models_library/api_schemas_catalog/service_access_rights.py index c56edcd7cf9..340f1b142bb 100644 --- a/packages/models-library/src/models_library/api_schemas_catalog/service_access_rights.py +++ b/packages/models-library/src/models_library/api_schemas_catalog/service_access_rights.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..services import ServiceKey, ServiceVersion from ..users import GroupID diff --git a/packages/models-library/src/models_library/api_schemas_catalog/services.py b/packages/models-library/src/models_library/api_schemas_catalog/services.py index 7accfc20a66..a825bae0714 100644 --- a/packages/models-library/src/models_library/api_schemas_catalog/services.py +++ b/packages/models-library/src/models_library/api_schemas_catalog/services.py @@ -2,7 +2,7 @@ from typing import Any, ClassVar, TypeAlias from models_library.rpc_pagination import PageRpc -from pydantic import BaseModel, Extra, Field, HttpUrl, NonNegativeInt +from pydantic.v1 import BaseModel, Extra, Field, HttpUrl, NonNegativeInt from ..boot_options import BootOptions from ..emails import LowerCaseEmailStr diff --git a/packages/models-library/src/models_library/api_schemas_catalog/services_ports.py b/packages/models-library/src/models_library/api_schemas_catalog/services_ports.py index ada65d69e28..f587caa7834 100644 --- a/packages/models-library/src/models_library/api_schemas_catalog/services_ports.py +++ b/packages/models-library/src/models_library/api_schemas_catalog/services_ports.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar, Literal -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..basic_regex import PUBLIC_VARIABLE_NAME_RE from ..services import ServiceInput, ServiceOutput diff --git a/packages/models-library/src/models_library/api_schemas_catalog/services_specifications.py b/packages/models-library/src/models_library/api_schemas_catalog/services_specifications.py index aaa2b0489ae..4f578742f2f 100644 --- a/packages/models-library/src/models_library/api_schemas_catalog/services_specifications.py +++ b/packages/models-library/src/models_library/api_schemas_catalog/services_specifications.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..generated_models.docker_rest_api import ServiceSpec as DockerServiceSpec diff --git a/packages/models-library/src/models_library/api_schemas_clusters_keeper/__init__.py b/packages/models-library/src/models_library/api_schemas_clusters_keeper/__init__.py index b6570d01c89..c00eb9ff981 100644 --- a/packages/models-library/src/models_library/api_schemas_clusters_keeper/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_clusters_keeper/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_clusters_keeper/clusters.py b/packages/models-library/src/models_library/api_schemas_clusters_keeper/clusters.py index 587220d5720..55ed3416016 100644 --- a/packages/models-library/src/models_library/api_schemas_clusters_keeper/clusters.py +++ b/packages/models-library/src/models_library/api_schemas_clusters_keeper/clusters.py @@ -1,7 +1,7 @@ import datetime from enum import auto -from pydantic import AnyUrl, BaseModel +from pydantic.v1 import AnyUrl, BaseModel from ..clusters import ClusterAuthentication from ..users import UserID diff --git a/packages/models-library/src/models_library/api_schemas_clusters_keeper/ec2_instances.py b/packages/models-library/src/models_library/api_schemas_clusters_keeper/ec2_instances.py index 057c02e1815..888f40256c2 100644 --- a/packages/models-library/src/models_library/api_schemas_clusters_keeper/ec2_instances.py +++ b/packages/models-library/src/models_library/api_schemas_clusters_keeper/ec2_instances.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from pydantic import ByteSize, NonNegativeFloat +from pydantic.v1 import ByteSize, NonNegativeFloat @dataclass(frozen=True) diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/clusters.py b/packages/models-library/src/models_library/api_schemas_directorv2/clusters.py index ca06a39b129..ad4891c951d 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/clusters.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/clusters.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar, TypeAlias -from pydantic import ( +from pydantic.v1 import ( AnyHttpUrl, BaseModel, Field, @@ -9,8 +9,8 @@ root_validator, validator, ) -from pydantic.networks import AnyUrl -from pydantic.types import ByteSize, PositiveFloat +from pydantic.v1.networks import AnyUrl +from pydantic.v1.types import ByteSize, PositiveFloat from ..clusters import ( CLUSTER_ADMIN_RIGHTS, diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/comp_tasks.py b/packages/models-library/src/models_library/api_schemas_directorv2/comp_tasks.py index cb8dab74d65..5d9543ad912 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/comp_tasks.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/comp_tasks.py @@ -1,7 +1,7 @@ from typing import Any, TypeAlias from models_library.basic_types import IDStr -from pydantic import AnyHttpUrl, AnyUrl, BaseModel, Field, validator +from pydantic.v1 import AnyHttpUrl, AnyUrl, BaseModel, Field, validator from ..clusters import ClusterID from ..projects import ProjectID diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services.py b/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services.py index 3515c38a5d7..eeb01122891 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar, TypeAlias -from pydantic import BaseModel, ByteSize, Field +from pydantic.v1 import BaseModel, ByteSize, Field from ..resource_tracker import HardwareInfo, PricingInfo from ..services import ServicePortKey diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services_service.py b/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services_service.py index 281589614ab..19f6e05238e 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services_service.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/dynamic_services_service.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Any, ClassVar -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..basic_types import PortInt from ..projects import ProjectID diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/errors.py b/packages/models-library/src/models_library/api_schemas_directorv2/errors.py index ecf33eefd14..275b6dc7847 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/errors.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/errors.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field class Error(BaseModel): diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/health.py b/packages/models-library/src/models_library/api_schemas_directorv2/health.py index 1f578888b18..472342d914c 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/health.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/health.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel +from pydantic.v1 import BaseModel class HealthCheckGet(BaseModel): diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/notifications.py b/packages/models-library/src/models_library/api_schemas_directorv2/notifications.py index b0bbe171912..9d5c5f2b843 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/notifications.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/notifications.py @@ -1,6 +1,6 @@ from models_library.projects_nodes_io import NodeID from models_library.wallets import WalletID -from pydantic import BaseModel +from pydantic.v1 import BaseModel class ServiceNoMoreCredits(BaseModel): diff --git a/packages/models-library/src/models_library/api_schemas_directorv2/services.py b/packages/models-library/src/models_library/api_schemas_directorv2/services.py index 6e429be4d50..f6067b07b77 100644 --- a/packages/models-library/src/models_library/api_schemas_directorv2/services.py +++ b/packages/models-library/src/models_library/api_schemas_directorv2/services.py @@ -1,7 +1,7 @@ from typing import Any, ClassVar -from pydantic import BaseModel, Field, validator -from pydantic.types import ByteSize, NonNegativeInt +from pydantic.v1 import BaseModel, Field, validator +from pydantic.v1.types import ByteSize, NonNegativeInt from ..service_settings_labels import ContainerSpec diff --git a/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/__init__.py b/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/__init__.py index 5631d38e5f9..29192de8d9c 100644 --- a/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/dynamic_services.py b/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/dynamic_services.py index 48ef3c48445..59fd0e52404 100644 --- a/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/dynamic_services.py +++ b/packages/models-library/src/models_library/api_schemas_dynamic_scheduler/dynamic_services.py @@ -7,7 +7,7 @@ from models_library.services_resources import ServiceResourcesDictHelpers from models_library.users import UserID from models_library.wallets import WalletInfo -from pydantic import BaseModel +from pydantic.v1 import BaseModel class DynamicServiceStart(DynamicServiceCreate): diff --git a/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/containers.py b/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/containers.py index 26fddb502e3..15fee376613 100644 --- a/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/containers.py +++ b/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/containers.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar, TypeAlias -from pydantic import BaseModel, NonNegativeFloat +from pydantic.v1 import BaseModel, NonNegativeFloat class ActivityInfo(BaseModel): diff --git a/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/telemetry.py b/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/telemetry.py index 22d151221d8..e1e1970309c 100644 --- a/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/telemetry.py +++ b/packages/models-library/src/models_library/api_schemas_dynamic_sidecar/telemetry.py @@ -3,7 +3,7 @@ from typing import Protocol from models_library.projects_nodes_io import NodeID -from pydantic import BaseModel, ByteSize, Field +from pydantic.v1 import BaseModel, ByteSize, Field class SDiskUsageProtocol(Protocol): diff --git a/packages/models-library/src/models_library/api_schemas_efs_guardian/__init__.py b/packages/models-library/src/models_library/api_schemas_efs_guardian/__init__.py index 50793febaf9..9ea4f5f7ec2 100644 --- a/packages/models-library/src/models_library/api_schemas_efs_guardian/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_efs_guardian/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_invitations/invitations.py b/packages/models-library/src/models_library/api_schemas_invitations/invitations.py index e25aee7c804..e201d50a1d8 100644 --- a/packages/models-library/src/models_library/api_schemas_invitations/invitations.py +++ b/packages/models-library/src/models_library/api_schemas_invitations/invitations.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel, Field, HttpUrl +from pydantic.v1 import BaseModel, Field, HttpUrl from ..invitations import InvitationContent, InvitationInputs from ..products import ProductName diff --git a/packages/models-library/src/models_library/api_schemas_long_running_tasks/base.py b/packages/models-library/src/models_library/api_schemas_long_running_tasks/base.py index 1995d8c3849..d70f10f13f2 100644 --- a/packages/models-library/src/models_library/api_schemas_long_running_tasks/base.py +++ b/packages/models-library/src/models_library/api_schemas_long_running_tasks/base.py @@ -1,7 +1,13 @@ import logging from typing import TypeAlias -from pydantic import BaseModel, ConstrainedFloat, Field, validate_arguments, validator +from pydantic.v1 import ( + BaseModel, + ConstrainedFloat, + Field, + validate_arguments, + validator, +) _logger = logging.getLogger(__name__) diff --git a/packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py b/packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py index dd0e0c0a72b..3bbbd3e5718 100644 --- a/packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py +++ b/packages/models-library/src/models_library/api_schemas_long_running_tasks/tasks.py @@ -2,7 +2,7 @@ from datetime import datetime from typing import Any -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from .base import TaskId, TaskProgress diff --git a/packages/models-library/src/models_library/api_schemas_payments/__init__.py b/packages/models-library/src/models_library/api_schemas_payments/__init__.py index 30d68367ded..b42640184fd 100644 --- a/packages/models-library/src/models_library/api_schemas_payments/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_payments/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_payments/errors.py b/packages/models-library/src/models_library/api_schemas_payments/errors.py index eaeba92aab1..623c3cf818a 100644 --- a/packages/models-library/src/models_library/api_schemas_payments/errors.py +++ b/packages/models-library/src/models_library/api_schemas_payments/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class _BaseRpcApiError(PydanticErrorMixin, ValueError): diff --git a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/__init__.py b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/__init__.py index 295897e5b1d..eba3374e509 100644 --- a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/credit_transactions.py b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/credit_transactions.py index edb308ff39a..e50935d6d56 100644 --- a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/credit_transactions.py +++ b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/credit_transactions.py @@ -1,7 +1,7 @@ from datetime import datetime from decimal import Decimal -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from ..products import ProductName from ..resource_tracker import CreditTransactionId diff --git a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py index 9c3ca4ba2b1..1dc9fb21bc1 100644 --- a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py +++ b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/pricing_plans.py @@ -2,7 +2,7 @@ from decimal import Decimal from typing import Any, ClassVar -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..resource_tracker import ( HardwareInfo, diff --git a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/service_runs.py b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/service_runs.py index 0ec5a1dc2ff..cd264a7d861 100644 --- a/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/service_runs.py +++ b/packages/models-library/src/models_library/api_schemas_resource_usage_tracker/service_runs.py @@ -2,7 +2,7 @@ from decimal import Decimal from typing import NamedTuple -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from ..projects import ProjectID from ..projects_nodes_io import NodeID diff --git a/packages/models-library/src/models_library/api_schemas_storage.py b/packages/models-library/src/models_library/api_schemas_storage.py index 29e341456bc..8eafab3c9c1 100644 --- a/packages/models-library/src/models_library/api_schemas_storage.py +++ b/packages/models-library/src/models_library/api_schemas_storage.py @@ -13,7 +13,7 @@ from typing import Any, ClassVar, TypeAlias from uuid import UUID -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, ConstrainedStr, @@ -23,7 +23,7 @@ root_validator, validator, ) -from pydantic.networks import AnyUrl +from pydantic.v1.networks import AnyUrl from .basic_regex import DATCORE_DATASET_NAME_RE, S3_BUCKET_NAME_RE from .basic_types import SHA256Str diff --git a/packages/models-library/src/models_library/api_schemas_webserver/__init__.py b/packages/models-library/src/models_library/api_schemas_webserver/__init__.py index f30e0f0790d..669c8f41e10 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/__init__.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/__init__.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq_basic_types import RPCNamespace diff --git a/packages/models-library/src/models_library/api_schemas_webserver/_base.py b/packages/models-library/src/models_library/api_schemas_webserver/_base.py index 9856a4743e9..7e8a55fc4af 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/_base.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/_base.py @@ -5,7 +5,7 @@ from typing import Any -from pydantic import BaseModel, Extra +from pydantic.v1 import BaseModel, Extra from ..utils.change_case import snake_to_camel diff --git a/packages/models-library/src/models_library/api_schemas_webserver/activity.py b/packages/models-library/src/models_library/api_schemas_webserver/activity.py index 85761df0303..098abe5a42f 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/activity.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/activity.py @@ -1,6 +1,6 @@ from typing import TypeAlias -from pydantic import BaseModel, Field, PositiveFloat +from pydantic.v1 import BaseModel, Field, PositiveFloat from ..projects_nodes_io import NodeID diff --git a/packages/models-library/src/models_library/api_schemas_webserver/auth.py b/packages/models-library/src/models_library/api_schemas_webserver/auth.py index d9f2754171d..50fe50540d0 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/auth.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/auth.py @@ -1,7 +1,7 @@ from datetime import timedelta from typing import Any, ClassVar -from pydantic import BaseModel, Field, SecretStr +from pydantic.v1 import BaseModel, Field, SecretStr from ..emails import LowerCaseEmailStr from ._base import InputSchema diff --git a/packages/models-library/src/models_library/api_schemas_webserver/catalog.py b/packages/models-library/src/models_library/api_schemas_webserver/catalog.py index 172575a8f92..35bb1144553 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/catalog.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/catalog.py @@ -1,7 +1,7 @@ from typing import Any, ClassVar, TypeAlias -from pydantic import Extra, Field -from pydantic.main import BaseModel +from pydantic.v1 import Extra, Field +from pydantic.v1.main import BaseModel from ..api_schemas_catalog import services as api_schemas_catalog_services from ..services_io import ServiceInput, ServiceOutput diff --git a/packages/models-library/src/models_library/api_schemas_webserver/clusters.py b/packages/models-library/src/models_library/api_schemas_webserver/clusters.py index b1b89746238..38155fa2476 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/clusters.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/clusters.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Extra +from pydantic.v1 import BaseModel, Extra from ..api_schemas_directorv2 import clusters as directorv2_clusters from ..clusters import ClusterID diff --git a/packages/models-library/src/models_library/api_schemas_webserver/computations.py b/packages/models-library/src/models_library/api_schemas_webserver/computations.py index 278cc747c51..dad8080a1d5 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/computations.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/computations.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..clusters import ClusterID diff --git a/packages/models-library/src/models_library/api_schemas_webserver/folders.py b/packages/models-library/src/models_library/api_schemas_webserver/folders.py index e971b1f8c73..5b7791a41e0 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/folders.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/folders.py @@ -6,7 +6,7 @@ from models_library.projects_access import AccessRights from models_library.users import GroupID from models_library.utils.common_validators import null_or_none_str_to_none_validator -from pydantic import Extra, PositiveInt, validator +from pydantic.v1 import Extra, PositiveInt, validator from ._base import InputSchema, OutputSchema diff --git a/packages/models-library/src/models_library/api_schemas_webserver/groups.py b/packages/models-library/src/models_library/api_schemas_webserver/groups.py index e0b6d3fbb37..473c06938f4 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/groups.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/groups.py @@ -1,7 +1,14 @@ from contextlib import suppress from typing import Any, ClassVar -from pydantic import AnyUrl, BaseModel, Field, ValidationError, parse_obj_as, validator +from pydantic.v1 import ( + AnyUrl, + BaseModel, + Field, + ValidationError, + parse_obj_as, + validator, +) from ..emails import LowerCaseEmailStr diff --git a/packages/models-library/src/models_library/api_schemas_webserver/permalinks.py b/packages/models-library/src/models_library/api_schemas_webserver/permalinks.py index f409d9d70df..90f2ac05ce5 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/permalinks.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/permalinks.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, HttpUrl +from pydantic.v1 import BaseModel, HttpUrl class ProjectPermalink(BaseModel): diff --git a/packages/models-library/src/models_library/api_schemas_webserver/product.py b/packages/models-library/src/models_library/api_schemas_webserver/product.py index 1d13a03a2bf..2cf53990ec0 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/product.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/product.py @@ -1,7 +1,7 @@ from datetime import datetime from typing import Any, ClassVar -from pydantic import ConstrainedInt, Field, HttpUrl, NonNegativeInt, PositiveInt +from pydantic.v1 import ConstrainedInt, Field, HttpUrl, NonNegativeInt, PositiveInt from ..basic_types import IDStr, NonNegativeDecimal from ..emails import LowerCaseEmailStr diff --git a/packages/models-library/src/models_library/api_schemas_webserver/projects.py b/packages/models-library/src/models_library/api_schemas_webserver/projects.py index 651445ee433..495b1d67785 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/projects.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/projects.py @@ -7,7 +7,7 @@ from typing import Any, Literal, TypeAlias -from pydantic import Field, validator +from pydantic.v1 import Field, validator from ..api_schemas_long_running_tasks.tasks import TaskGet from ..basic_types import ( diff --git a/packages/models-library/src/models_library/api_schemas_webserver/projects_metadata.py b/packages/models-library/src/models_library/api_schemas_webserver/projects_metadata.py index c108dcd2fc2..0beed8f63c1 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/projects_metadata.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/projects_metadata.py @@ -1,6 +1,6 @@ from typing import TypeAlias -from pydantic import Field, StrictBool, StrictFloat, StrictInt +from pydantic.v1 import Field, StrictBool, StrictFloat, StrictInt from ..projects import ProjectID from ._base import InputSchema, OutputSchema diff --git a/packages/models-library/src/models_library/api_schemas_webserver/projects_nodes.py b/packages/models-library/src/models_library/api_schemas_webserver/projects_nodes.py index 25a6f5fb0dd..c964b03ee99 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/projects_nodes.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/projects_nodes.py @@ -1,7 +1,7 @@ # mypy: disable-error-code=truthy-function from typing import Any, ClassVar, Literal, TypeAlias -from pydantic import Field +from pydantic.v1 import Field from ..api_schemas_directorv2.dynamic_services import RetrieveDataOut from ..basic_types import PortInt diff --git a/packages/models-library/src/models_library/api_schemas_webserver/projects_ports.py b/packages/models-library/src/models_library/api_schemas_webserver/projects_ports.py index df38c862900..dd55a5d1510 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/projects_ports.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/projects_ports.py @@ -1,6 +1,6 @@ from typing import Any -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..projects_nodes_io import NodeID from ._base import InputSchemaWithoutCamelCase, OutputSchema diff --git a/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py b/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py index fa150f9ffc6..02c371986ea 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/resource_usage.py @@ -1,7 +1,7 @@ from datetime import datetime from decimal import Decimal -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..projects import ProjectID from ..projects_nodes_io import NodeID diff --git a/packages/models-library/src/models_library/api_schemas_webserver/users_preferences.py b/packages/models-library/src/models_library/api_schemas_webserver/users_preferences.py index e5789cafbdd..470244603f9 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/users_preferences.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/users_preferences.py @@ -1,6 +1,6 @@ from typing import Any, TypeAlias -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..user_preferences import PreferenceIdentifier from ._base import InputSchema, OutputSchema diff --git a/packages/models-library/src/models_library/api_schemas_webserver/wallets.py b/packages/models-library/src/models_library/api_schemas_webserver/wallets.py index af0aa61ac80..727883f2c08 100644 --- a/packages/models-library/src/models_library/api_schemas_webserver/wallets.py +++ b/packages/models-library/src/models_library/api_schemas_webserver/wallets.py @@ -2,7 +2,7 @@ from decimal import Decimal from typing import Any, ClassVar, Literal, TypeAlias -from pydantic import Field, HttpUrl, validator +from pydantic.v1 import Field, HttpUrl, validator from ..basic_types import AmountDecimal, IDStr, NonNegativeDecimal from ..users import GroupID diff --git a/packages/models-library/src/models_library/app_diagnostics.py b/packages/models-library/src/models_library/app_diagnostics.py index ce8c9331eae..aac993f0f31 100644 --- a/packages/models-library/src/models_library/app_diagnostics.py +++ b/packages/models-library/src/models_library/app_diagnostics.py @@ -1,6 +1,6 @@ from typing import Any -from pydantic import AnyUrl, BaseModel, Field +from pydantic.v1 import AnyUrl, BaseModel, Field class AppStatusCheck(BaseModel): diff --git a/packages/models-library/src/models_library/basic_types.py b/packages/models-library/src/models_library/basic_types.py index 18788e188a8..532b340e453 100644 --- a/packages/models-library/src/models_library/basic_types.py +++ b/packages/models-library/src/models_library/basic_types.py @@ -2,8 +2,7 @@ from enum import StrEnum from typing import Final, TypeAlias - -from pydantic import ( +from pydantic.v1 import ( ConstrainedDecimal, ConstrainedInt, ConstrainedStr, diff --git a/packages/models-library/src/models_library/boot_options.py b/packages/models-library/src/models_library/boot_options.py index ec1aabd546b..f1a66fdb5d3 100644 --- a/packages/models-library/src/models_library/boot_options.py +++ b/packages/models-library/src/models_library/boot_options.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from typing_extensions import TypedDict from .basic_types import EnvVarKey diff --git a/packages/models-library/src/models_library/callbacks_mapping.py b/packages/models-library/src/models_library/callbacks_mapping.py index 9e4e88214ce..c38dc6c5b8c 100644 --- a/packages/models-library/src/models_library/callbacks_mapping.py +++ b/packages/models-library/src/models_library/callbacks_mapping.py @@ -1,7 +1,7 @@ from collections.abc import Sequence from typing import Any, ClassVar, Final -from pydantic import BaseModel, Extra, Field, NonNegativeFloat, validator +from pydantic.v1 import BaseModel, Extra, Field, NonNegativeFloat, validator INACTIVITY_TIMEOUT_CAP: Final[NonNegativeFloat] = 5 TIMEOUT_MIN: Final[NonNegativeFloat] = 1 diff --git a/packages/models-library/src/models_library/clusters.py b/packages/models-library/src/models_library/clusters.py index c51598b06ee..89812fcffd1 100644 --- a/packages/models-library/src/models_library/clusters.py +++ b/packages/models-library/src/models_library/clusters.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Any, ClassVar, Final, Literal, TypeAlias -from pydantic import ( +from pydantic.v1 import ( AnyUrl, BaseModel, Extra, @@ -12,7 +12,7 @@ root_validator, validator, ) -from pydantic.types import NonNegativeInt +from pydantic.v1.types import NonNegativeInt from .users import GroupID from .utils.common_validators import create_enums_pre_validator diff --git a/packages/models-library/src/models_library/docker.py b/packages/models-library/src/models_library/docker.py index 732dfc08197..254baf76250 100644 --- a/packages/models-library/src/models_library/docker.py +++ b/packages/models-library/src/models_library/docker.py @@ -2,7 +2,7 @@ import re from typing import Any, ClassVar, Final -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, ConstrainedStr, diff --git a/packages/models-library/src/models_library/emails.py b/packages/models-library/src/models_library/emails.py index 80996eed76f..01cf73ea0f8 100644 --- a/packages/models-library/src/models_library/emails.py +++ b/packages/models-library/src/models_library/emails.py @@ -1,4 +1,4 @@ -from pydantic import EmailStr +from pydantic.v1 import EmailStr class LowerCaseEmailStr(EmailStr): diff --git a/packages/models-library/src/models_library/errors_classes.py b/packages/models-library/src/models_library/errors_classes.py index dab24fb4009..26be3fa92d9 100644 --- a/packages/models-library/src/models_library/errors_classes.py +++ b/packages/models-library/src/models_library/errors_classes.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class _DefaultDict(dict): diff --git a/packages/models-library/src/models_library/folders.py b/packages/models-library/src/models_library/folders.py index f8d8377d8c3..6ea3964b9a6 100644 --- a/packages/models-library/src/models_library/folders.py +++ b/packages/models-library/src/models_library/folders.py @@ -1,5 +1,5 @@ from typing import TypeAlias -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt FolderID: TypeAlias = PositiveInt diff --git a/packages/models-library/src/models_library/function_services_catalog/_settings.py b/packages/models-library/src/models_library/function_services_catalog/_settings.py index 3ca4260d8ce..4fefabb3204 100644 --- a/packages/models-library/src/models_library/function_services_catalog/_settings.py +++ b/packages/models-library/src/models_library/function_services_catalog/_settings.py @@ -1,7 +1,7 @@ import json import os -from pydantic import BaseSettings +from pydantic.v1 import BaseSettings # Expects env var: FUNCTION_SERVICES_AUTHORS='{"OM":{"name": ...}, "EN":{...} }' try: diff --git a/packages/models-library/src/models_library/function_services_catalog/services/iter_sensitivity.py b/packages/models-library/src/models_library/function_services_catalog/services/iter_sensitivity.py index f0199389885..abb2a366e69 100644 --- a/packages/models-library/src/models_library/function_services_catalog/services/iter_sensitivity.py +++ b/packages/models-library/src/models_library/function_services_catalog/services/iter_sensitivity.py @@ -2,7 +2,7 @@ from copy import deepcopy from typing import Any -from pydantic import schema_of +from pydantic.v1 import schema_of from ...projects_nodes import OutputID, OutputsDict from ...services import ServiceMetaDataPublished, ServiceType diff --git a/packages/models-library/src/models_library/generated_models/docker_rest_api.py b/packages/models-library/src/models_library/generated_models/docker_rest_api.py index 835141ea037..f7b67ec0c75 100644 --- a/packages/models-library/src/models_library/generated_models/docker_rest_api.py +++ b/packages/models-library/src/models_library/generated_models/docker_rest_api.py @@ -8,7 +8,7 @@ from enum import Enum from typing import Any -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field class Model(BaseModel): diff --git a/packages/models-library/src/models_library/generics.py b/packages/models-library/src/models_library/generics.py index 50d6f339810..143fbc8a892 100644 --- a/packages/models-library/src/models_library/generics.py +++ b/packages/models-library/src/models_library/generics.py @@ -1,7 +1,7 @@ from collections.abc import ItemsView, Iterable, Iterator, KeysView, ValuesView from typing import Any, Generic, TypeVar -from pydantic.generics import GenericModel +from pydantic.v1.generics import GenericModel DictKey = TypeVar("DictKey") DictValue = TypeVar("DictValue") diff --git a/packages/models-library/src/models_library/groups.py b/packages/models-library/src/models_library/groups.py index 3be5d1663c8..752745ed146 100644 --- a/packages/models-library/src/models_library/groups.py +++ b/packages/models-library/src/models_library/groups.py @@ -1,8 +1,8 @@ import enum from typing import Any, ClassVar, Final -from pydantic import BaseModel, Field, validator -from pydantic.types import PositiveInt +from pydantic.v1 import BaseModel, Field, validator +from pydantic.v1.types import PositiveInt from .utils.common_validators import create_enums_pre_validator diff --git a/packages/models-library/src/models_library/healthchecks.py b/packages/models-library/src/models_library/healthchecks.py index 6e78b31a5dd..b87e04b0e85 100644 --- a/packages/models-library/src/models_library/healthchecks.py +++ b/packages/models-library/src/models_library/healthchecks.py @@ -8,7 +8,7 @@ from datetime import timedelta from typing import TypeAlias -from pydantic import BaseModel +from pydantic.v1 import BaseModel class IsResponsive(BaseModel): diff --git a/packages/models-library/src/models_library/invitations.py b/packages/models-library/src/models_library/invitations.py index e9f33015944..4c3370e9b5d 100644 --- a/packages/models-library/src/models_library/invitations.py +++ b/packages/models-library/src/models_library/invitations.py @@ -1,7 +1,7 @@ from datetime import datetime, timezone from typing import Final -from pydantic import BaseModel, EmailStr, Field, PositiveInt, validator +from pydantic.v1 import BaseModel, EmailStr, Field, PositiveInt, validator from .products import ProductName diff --git a/packages/models-library/src/models_library/osparc_variable_identifier.py b/packages/models-library/src/models_library/osparc_variable_identifier.py index 71e4779b2ad..6d85a72b44e 100644 --- a/packages/models-library/src/models_library/osparc_variable_identifier.py +++ b/packages/models-library/src/models_library/osparc_variable_identifier.py @@ -1,8 +1,8 @@ from copy import deepcopy from typing import Any, TypeVar -from pydantic import BaseModel, Field -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import BaseModel, Field +from pydantic.v1.errors import PydanticErrorMixin from .utils.string_substitution import OSPARC_IDENTIFIER_PREFIX diff --git a/packages/models-library/src/models_library/payments.py b/packages/models-library/src/models_library/payments.py index 7a4ec846575..1b2a2fbd82e 100644 --- a/packages/models-library/src/models_library/payments.py +++ b/packages/models-library/src/models_library/payments.py @@ -1,7 +1,7 @@ from decimal import Decimal from typing import Any, ClassVar, TypeAlias -from pydantic import BaseModel, Field, validator +from pydantic.v1 import BaseModel, Field, validator from .emails import LowerCaseEmailStr from .products import StripePriceID, StripeTaxRateID diff --git a/packages/models-library/src/models_library/products.py b/packages/models-library/src/models_library/products.py index c38281d9f6a..9f3dd267dd2 100644 --- a/packages/models-library/src/models_library/products.py +++ b/packages/models-library/src/models_library/products.py @@ -1,7 +1,7 @@ from decimal import Decimal from typing import Any, ClassVar, TypeAlias -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field ProductName: TypeAlias = str StripePriceID: TypeAlias = str diff --git a/packages/models-library/src/models_library/progress_bar.py b/packages/models-library/src/models_library/progress_bar.py index 788331b103e..8a711ed0c6f 100644 --- a/packages/models-library/src/models_library/progress_bar.py +++ b/packages/models-library/src/models_library/progress_bar.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar, Literal, TypeAlias -from pydantic import BaseModel +from pydantic.v1 import BaseModel from .basic_types import IDStr diff --git a/packages/models-library/src/models_library/projects.py b/packages/models-library/src/models_library/projects.py index 5a4063b2b7d..b38b214bb85 100644 --- a/packages/models-library/src/models_library/projects.py +++ b/packages/models-library/src/models_library/projects.py @@ -8,7 +8,7 @@ from typing import Any, Final, TypeAlias from uuid import UUID -from pydantic import BaseModel, ConstrainedStr, Extra, Field, validator +from pydantic.v1 import BaseModel, ConstrainedStr, Extra, Field, validator from .basic_regex import DATE_RE, UUID_RE_BASE from .basic_types import HttpUrlWithCustomMinLength diff --git a/packages/models-library/src/models_library/projects_access.py b/packages/models-library/src/models_library/projects_access.py index 1b800c6b0ae..138b07507e7 100644 --- a/packages/models-library/src/models_library/projects_access.py +++ b/packages/models-library/src/models_library/projects_access.py @@ -5,8 +5,8 @@ from enum import Enum from typing import Any, ClassVar -from pydantic import BaseModel, Extra, Field -from pydantic.types import PositiveInt +from pydantic.v1 import BaseModel, Extra, Field +from pydantic.v1.types import PositiveInt from .basic_types import IDStr from .users import FirstNameStr, LastNameStr diff --git a/packages/models-library/src/models_library/projects_comments.py b/packages/models-library/src/models_library/projects_comments.py index 234ec638a4a..ec34f3c848e 100644 --- a/packages/models-library/src/models_library/projects_comments.py +++ b/packages/models-library/src/models_library/projects_comments.py @@ -1,7 +1,7 @@ from datetime import datetime from typing import TypeAlias -from pydantic import BaseModel, Extra, Field, PositiveInt +from pydantic.v1 import BaseModel, Extra, Field, PositiveInt from .projects import ProjectID from .users import UserID diff --git a/packages/models-library/src/models_library/projects_networks.py b/packages/models-library/src/models_library/projects_networks.py index e0775ccb5d5..be2017b308d 100644 --- a/packages/models-library/src/models_library/projects_networks.py +++ b/packages/models-library/src/models_library/projects_networks.py @@ -1,7 +1,7 @@ import re from typing import Any, ClassVar, Final -from pydantic import BaseModel, ConstrainedStr, Field +from pydantic.v1 import BaseModel, ConstrainedStr, Field from .generics import DictModel from .projects import ProjectID diff --git a/packages/models-library/src/models_library/projects_nodes.py b/packages/models-library/src/models_library/projects_nodes.py index 318f7149ab4..99b49b7ea3d 100644 --- a/packages/models-library/src/models_library/projects_nodes.py +++ b/packages/models-library/src/models_library/projects_nodes.py @@ -5,7 +5,7 @@ from copy import deepcopy from typing import Any, ClassVar, TypeAlias, Union -from pydantic import ( +from pydantic.v1 import ( BaseModel, ConstrainedStr, Extra, diff --git a/packages/models-library/src/models_library/projects_nodes_io.py b/packages/models-library/src/models_library/projects_nodes_io.py index b2d88485489..48098532bb5 100644 --- a/packages/models-library/src/models_library/projects_nodes_io.py +++ b/packages/models-library/src/models_library/projects_nodes_io.py @@ -12,7 +12,7 @@ from uuid import UUID from models_library.basic_types import KeyIDStr -from pydantic import ( +from pydantic.v1 import ( AnyUrl, BaseModel, ConstrainedStr, diff --git a/packages/models-library/src/models_library/projects_nodes_ui.py b/packages/models-library/src/models_library/projects_nodes_ui.py index aa55332ccba..6e39f7ccfd6 100644 --- a/packages/models-library/src/models_library/projects_nodes_ui.py +++ b/packages/models-library/src/models_library/projects_nodes_ui.py @@ -2,8 +2,8 @@ Models node UI (legacy model, use instead projects.ui.py) """ -from pydantic import BaseModel, Extra, Field -from pydantic.color import Color +from pydantic.v1 import BaseModel, Extra, Field +from pydantic.v1.color import Color class Position(BaseModel): diff --git a/packages/models-library/src/models_library/projects_pipeline.py b/packages/models-library/src/models_library/projects_pipeline.py index 2139d182043..de90bf7c5e7 100644 --- a/packages/models-library/src/models_library/projects_pipeline.py +++ b/packages/models-library/src/models_library/projects_pipeline.py @@ -3,7 +3,7 @@ from uuid import UUID import arrow -from pydantic import BaseModel, Field, PositiveInt +from pydantic.v1 import BaseModel, Field, PositiveInt from .clusters import ClusterID from .projects_nodes import NodeState diff --git a/packages/models-library/src/models_library/projects_state.py b/packages/models-library/src/models_library/projects_state.py index 38c68d5d4a4..988d5317e3d 100644 --- a/packages/models-library/src/models_library/projects_state.py +++ b/packages/models-library/src/models_library/projects_state.py @@ -5,7 +5,7 @@ from enum import Enum, unique from typing import Any, ClassVar -from pydantic import BaseModel, Extra, Field, validator +from pydantic.v1 import BaseModel, Extra, Field, validator from .projects_access import Owner diff --git a/packages/models-library/src/models_library/projects_ui.py b/packages/models-library/src/models_library/projects_ui.py index 154007a2a6d..370fd7f596b 100644 --- a/packages/models-library/src/models_library/projects_ui.py +++ b/packages/models-library/src/models_library/projects_ui.py @@ -4,8 +4,8 @@ from typing import Any, ClassVar, Literal, TypedDict -from pydantic import BaseModel, Extra, Field, validator -from pydantic.color import Color +from pydantic.v1 import BaseModel, Extra, Field, validator +from pydantic.v1.color import Color from .projects_nodes_io import NodeID, NodeIDStr from .projects_nodes_ui import Marker, Position diff --git a/packages/models-library/src/models_library/rabbitmq_basic_types.py b/packages/models-library/src/models_library/rabbitmq_basic_types.py index 022b66b9a9d..52bf2a04eca 100644 --- a/packages/models-library/src/models_library/rabbitmq_basic_types.py +++ b/packages/models-library/src/models_library/rabbitmq_basic_types.py @@ -1,7 +1,7 @@ import re from typing import Final -from pydantic import ConstrainedStr, parse_obj_as +from pydantic.v1 import ConstrainedStr, parse_obj_as REGEX_RABBIT_QUEUE_ALLOWED_SYMBOLS: Final[str] = r"^[\w\-\.]*$" diff --git a/packages/models-library/src/models_library/rabbitmq_messages.py b/packages/models-library/src/models_library/rabbitmq_messages.py index 07dab962281..a7ed23f1781 100644 --- a/packages/models-library/src/models_library/rabbitmq_messages.py +++ b/packages/models-library/src/models_library/rabbitmq_messages.py @@ -6,7 +6,7 @@ from typing import Any, Literal, TypeAlias import arrow -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from .products import ProductName from .progress_bar import ProgressReport diff --git a/packages/models-library/src/models_library/resource_tracker.py b/packages/models-library/src/models_library/resource_tracker.py index 13c92e161ed..d0f096af69d 100644 --- a/packages/models-library/src/models_library/resource_tracker.py +++ b/packages/models-library/src/models_library/resource_tracker.py @@ -4,7 +4,7 @@ from enum import IntEnum, auto from typing import Any, ClassVar, NamedTuple, TypeAlias -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, Extra, diff --git a/packages/models-library/src/models_library/rest_filters.py b/packages/models-library/src/models_library/rest_filters.py index b675968e559..755727682ab 100644 --- a/packages/models-library/src/models_library/rest_filters.py +++ b/packages/models-library/src/models_library/rest_filters.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel class Filters(BaseModel): diff --git a/packages/models-library/src/models_library/rest_ordering.py b/packages/models-library/src/models_library/rest_ordering.py index c8a791343ee..f6c9b5bbf36 100644 --- a/packages/models-library/src/models_library/rest_ordering.py +++ b/packages/models-library/src/models_library/rest_ordering.py @@ -1,6 +1,6 @@ from enum import Enum -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from .basic_types import IDStr diff --git a/packages/models-library/src/models_library/rest_pagination.py b/packages/models-library/src/models_library/rest_pagination.py index 89c90cb1c2d..92c14d0cdfb 100644 --- a/packages/models-library/src/models_library/rest_pagination.py +++ b/packages/models-library/src/models_library/rest_pagination.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar, Final, Generic, TypeVar -from pydantic import ( +from pydantic.v1 import ( AnyHttpUrl, BaseModel, ConstrainedInt, @@ -11,7 +11,7 @@ parse_obj_as, validator, ) -from pydantic.generics import GenericModel +from pydantic.v1.generics import GenericModel from .utils.common_validators import none_to_empty_list_pre_validator diff --git a/packages/models-library/src/models_library/rest_pagination_utils.py b/packages/models-library/src/models_library/rest_pagination_utils.py index ec9cedf0a54..6c104bd5239 100644 --- a/packages/models-library/src/models_library/rest_pagination_utils.py +++ b/packages/models-library/src/models_library/rest_pagination_utils.py @@ -1,7 +1,7 @@ from math import ceil from typing import Any, Protocol, TypedDict, Union, runtime_checkable -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from .rest_pagination import PageLinks, PageMetaInfoLimitOffset diff --git a/packages/models-library/src/models_library/rpc_pagination.py b/packages/models-library/src/models_library/rpc_pagination.py index 34eeb997990..9057078fdb9 100644 --- a/packages/models-library/src/models_library/rpc_pagination.py +++ b/packages/models-library/src/models_library/rpc_pagination.py @@ -2,7 +2,7 @@ from math import ceil from typing import Any, ClassVar, Generic -from pydantic import Extra, Field +from pydantic.v1 import Extra, Field from .rest_pagination import ( DEFAULT_NUMBER_OF_ITEMS_PER_PAGE, diff --git a/packages/models-library/src/models_library/service_settings_labels.py b/packages/models-library/src/models_library/service_settings_labels.py index 95bc13a0b09..a7860aa44c5 100644 --- a/packages/models-library/src/models_library/service_settings_labels.py +++ b/packages/models-library/src/models_library/service_settings_labels.py @@ -5,7 +5,7 @@ from pathlib import Path from typing import Any, ClassVar, Literal, TypeAlias -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, Extra, diff --git a/packages/models-library/src/models_library/service_settings_nat_rule.py b/packages/models-library/src/models_library/service_settings_nat_rule.py index bcdf0604eec..e0bb64c75e7 100644 --- a/packages/models-library/src/models_library/service_settings_nat_rule.py +++ b/packages/models-library/src/models_library/service_settings_nat_rule.py @@ -1,7 +1,7 @@ from collections.abc import Generator from typing import Any, ClassVar, Final -from pydantic import BaseModel, Extra, Field, parse_obj_as, validator +from pydantic.v1 import BaseModel, Extra, Field, parse_obj_as, validator from .basic_types import PortInt from .osparc_variable_identifier import OsparcVariableIdentifier, raise_if_unresolved diff --git a/packages/models-library/src/models_library/services_access.py b/packages/models-library/src/models_library/services_access.py index 8bc6786c695..19b08df248a 100644 --- a/packages/models-library/src/models_library/services_access.py +++ b/packages/models-library/src/models_library/services_access.py @@ -2,7 +2,7 @@ """ -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from .users import GroupID from .utils.change_case import snake_to_camel diff --git a/packages/models-library/src/models_library/services_authoring.py b/packages/models-library/src/models_library/services_authoring.py index 18673319f46..4a1e761a394 100644 --- a/packages/models-library/src/models_library/services_authoring.py +++ b/packages/models-library/src/models_library/services_authoring.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel, Field, HttpUrl +from pydantic.v1 import BaseModel, Field, HttpUrl from .emails import LowerCaseEmailStr diff --git a/packages/models-library/src/models_library/services_base.py b/packages/models-library/src/models_library/services_base.py index a83cd21e127..106e297a6dd 100644 --- a/packages/models-library/src/models_library/services_base.py +++ b/packages/models-library/src/models_library/services_base.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field, HttpUrl, validator +from pydantic.v1 import BaseModel, Field, HttpUrl, validator from .services_types import ServiceKey, ServiceVersion from .utils.common_validators import empty_str_to_none_pre_validator diff --git a/packages/models-library/src/models_library/services_creation.py b/packages/models-library/src/models_library/services_creation.py index e2102efe075..12af173c2cf 100644 --- a/packages/models-library/src/models_library/services_creation.py +++ b/packages/models-library/src/models_library/services_creation.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel +from pydantic.v1 import BaseModel from .services import ServiceKey, ServiceVersion from .services_resources import ServiceResourcesDict diff --git a/packages/models-library/src/models_library/services_history.py b/packages/models-library/src/models_library/services_history.py index 70f4e513c15..bb822c8c84c 100644 --- a/packages/models-library/src/models_library/services_history.py +++ b/packages/models-library/src/models_library/services_history.py @@ -1,7 +1,7 @@ from datetime import datetime from typing import Any, ClassVar, TypeAlias -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from .services_types import ServiceKey, ServiceVersion from .utils.change_case import snake_to_camel diff --git a/packages/models-library/src/models_library/services_io.py b/packages/models-library/src/models_library/services_io.py index 52c09fa241d..838fccd5c79 100644 --- a/packages/models-library/src/models_library/services_io.py +++ b/packages/models-library/src/models_library/services_io.py @@ -1,7 +1,7 @@ import re from typing import Any, ClassVar -from pydantic import ( +from pydantic.v1 import ( BaseModel, ConstrainedStr, Extra, diff --git a/packages/models-library/src/models_library/services_metadata_editable.py b/packages/models-library/src/models_library/services_metadata_editable.py index 32e7456d98f..8b4da053e4a 100644 --- a/packages/models-library/src/models_library/services_metadata_editable.py +++ b/packages/models-library/src/models_library/services_metadata_editable.py @@ -2,7 +2,7 @@ from datetime import datetime from typing import Any, ClassVar -from pydantic import Field, HttpUrl +from pydantic.v1 import Field, HttpUrl from .services_base import ServiceBaseDisplay from .services_constants import LATEST_INTEGRATION_VERSION diff --git a/packages/models-library/src/models_library/services_metadata_published.py b/packages/models-library/src/models_library/services_metadata_published.py index 5d3cb23d8f1..144bb3c6b88 100644 --- a/packages/models-library/src/models_library/services_metadata_published.py +++ b/packages/models-library/src/models_library/services_metadata_published.py @@ -1,7 +1,7 @@ from datetime import datetime from typing import Any, ClassVar, Final, TypeAlias -from pydantic import Extra, Field, NonNegativeInt +from pydantic.v1 import Extra, Field, NonNegativeInt from .basic_types import SemanticVersionStr from .boot_options import BootOption, BootOptions diff --git a/packages/models-library/src/models_library/services_resources.py b/packages/models-library/src/models_library/services_resources.py index 7fe4f268f8c..afbf64fa47e 100644 --- a/packages/models-library/src/models_library/services_resources.py +++ b/packages/models-library/src/models_library/services_resources.py @@ -2,7 +2,7 @@ from enum import auto from typing import Any, ClassVar, Final, TypeAlias -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, Field, diff --git a/packages/models-library/src/models_library/services_types.py b/packages/models-library/src/models_library/services_types.py index 366d8bc00c2..ded8b800444 100644 --- a/packages/models-library/src/models_library/services_types.py +++ b/packages/models-library/src/models_library/services_types.py @@ -2,7 +2,7 @@ from uuid import uuid4 import arrow -from pydantic import ConstrainedStr +from pydantic.v1 import ConstrainedStr from .basic_regex import PROPERTY_KEY_RE, SIMPLE_VERSION_RE from .services_regex import ( diff --git a/packages/models-library/src/models_library/services_ui.py b/packages/models-library/src/models_library/services_ui.py index 22196693334..e3ba54300b0 100644 --- a/packages/models-library/src/models_library/services_ui.py +++ b/packages/models-library/src/models_library/services_ui.py @@ -1,7 +1,7 @@ from enum import Enum -from pydantic import BaseModel, Extra, Field -from pydantic.types import PositiveInt +from pydantic.v1 import BaseModel, Extra, Field +from pydantic.v1.types import PositiveInt class WidgetType(str, Enum): diff --git a/packages/models-library/src/models_library/sidecar_volumes.py b/packages/models-library/src/models_library/sidecar_volumes.py index 0e9bcf16c0b..eeb4b3b321f 100644 --- a/packages/models-library/src/models_library/sidecar_volumes.py +++ b/packages/models-library/src/models_library/sidecar_volumes.py @@ -2,7 +2,7 @@ from enum import auto import arrow -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from .utils.enums import StrAutoEnum diff --git a/packages/models-library/src/models_library/user_preferences.py b/packages/models-library/src/models_library/user_preferences.py index 14d6b4e53f8..5aefa7770ee 100644 --- a/packages/models-library/src/models_library/user_preferences.py +++ b/packages/models-library/src/models_library/user_preferences.py @@ -1,8 +1,8 @@ from enum import auto from typing import Annotated, Any, ClassVar, TypeAlias -from pydantic import BaseModel, Field -from pydantic.main import ModelMetaclass +from pydantic.v1 import BaseModel, Field +from pydantic.v1.main import ModelMetaclass from .services import ServiceKey, ServiceVersion from .utils.enums import StrAutoEnum diff --git a/packages/models-library/src/models_library/users.py b/packages/models-library/src/models_library/users.py index 31ca948a1b8..730de8c8448 100644 --- a/packages/models-library/src/models_library/users.py +++ b/packages/models-library/src/models_library/users.py @@ -1,6 +1,6 @@ from typing import TypeAlias -from pydantic import BaseModel, ConstrainedStr, Field, PositiveInt +from pydantic.v1 import BaseModel, ConstrainedStr, Field, PositiveInt UserID: TypeAlias = PositiveInt GroupID: TypeAlias = PositiveInt diff --git a/packages/models-library/src/models_library/utils/_original_fastapi_encoders.py b/packages/models-library/src/models_library/utils/_original_fastapi_encoders.py index 6f49b02a5ba..89b78f8a545 100644 --- a/packages/models-library/src/models_library/utils/_original_fastapi_encoders.py +++ b/packages/models-library/src/models_library/utils/_original_fastapi_encoders.py @@ -10,8 +10,8 @@ from types import GeneratorType from typing import Any -from pydantic import BaseModel -from pydantic.json import ENCODERS_BY_TYPE +from pydantic.v1 import BaseModel +from pydantic.v1.json import ENCODERS_BY_TYPE SetIntStr = set[int | str] DictIntStrAny = dict[int | str, Any] diff --git a/packages/models-library/src/models_library/utils/json_serialization.py b/packages/models-library/src/models_library/utils/json_serialization.py index cc87c686041..6a23b11fcdf 100644 --- a/packages/models-library/src/models_library/utils/json_serialization.py +++ b/packages/models-library/src/models_library/utils/json_serialization.py @@ -7,8 +7,8 @@ from typing import Any, Final, NamedTuple import orjson -from pydantic.json import ENCODERS_BY_TYPE, pydantic_encoder -from pydantic.types import ConstrainedFloat +from pydantic.v1.json import ENCODERS_BY_TYPE, pydantic_encoder +from pydantic.v1.types import ConstrainedFloat class SeparatorTuple(NamedTuple): diff --git a/packages/models-library/src/models_library/utils/nodes.py b/packages/models-library/src/models_library/utils/nodes.py index 1def98ec507..49f6b0ee063 100644 --- a/packages/models-library/src/models_library/utils/nodes.py +++ b/packages/models-library/src/models_library/utils/nodes.py @@ -5,7 +5,7 @@ from copy import deepcopy from typing import Any -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..projects import Project from ..projects_nodes_io import NodeID, PortLink, UUIDStr diff --git a/packages/models-library/src/models_library/utils/pydantic_tools_extension.py b/packages/models-library/src/models_library/utils/pydantic_tools_extension.py index 08e70fb92aa..9e2a7565005 100644 --- a/packages/models-library/src/models_library/utils/pydantic_tools_extension.py +++ b/packages/models-library/src/models_library/utils/pydantic_tools_extension.py @@ -1,8 +1,8 @@ import functools from typing import Final, TypeVar -from pydantic import Field, ValidationError -from pydantic.tools import parse_obj_as +from pydantic.v1 import Field, ValidationError +from pydantic.v1.tools import parse_obj_as T = TypeVar("T") diff --git a/packages/models-library/src/models_library/utils/services_io.py b/packages/models-library/src/models_library/utils/services_io.py index 2f862a79262..86a16bd7418 100644 --- a/packages/models-library/src/models_library/utils/services_io.py +++ b/packages/models-library/src/models_library/utils/services_io.py @@ -2,7 +2,7 @@ from copy import deepcopy from typing import Any, Literal -from pydantic import schema_of +from pydantic.v1 import schema_of from ..services import ServiceInput, ServiceOutput from ..services_regex import PROPERTY_TYPE_TO_PYTHON_TYPE_MAP diff --git a/packages/models-library/src/models_library/utils/specs_substitution.py b/packages/models-library/src/models_library/utils/specs_substitution.py index f12968136f6..89243043a0b 100644 --- a/packages/models-library/src/models_library/utils/specs_substitution.py +++ b/packages/models-library/src/models_library/utils/specs_substitution.py @@ -1,7 +1,7 @@ from typing import Any, NamedTuple, TypeAlias, cast -from pydantic import StrictBool, StrictFloat, StrictInt -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import StrictBool, StrictFloat, StrictInt +from pydantic.v1.errors import PydanticErrorMixin from .json_serialization import json_dumps, json_loads from .string_substitution import ( diff --git a/packages/models-library/src/models_library/wallets.py b/packages/models-library/src/models_library/wallets.py index 08651353daa..787781edaff 100644 --- a/packages/models-library/src/models_library/wallets.py +++ b/packages/models-library/src/models_library/wallets.py @@ -3,7 +3,7 @@ from enum import auto from typing import Any, ClassVar, TypeAlias -from pydantic import BaseModel, Field, PositiveInt +from pydantic.v1 import BaseModel, Field, PositiveInt from .utils.enums import StrAutoEnum diff --git a/packages/models-library/tests/test__models_examples.py b/packages/models-library/tests/test__models_examples.py index 12809db713b..d42b109a617 100644 --- a/packages/models-library/tests/test__models_examples.py +++ b/packages/models-library/tests/test__models_examples.py @@ -3,7 +3,7 @@ import models_library import pytest -from pydantic import BaseModel +from pydantic.v1 import BaseModel from pytest_simcore.pydantic_models import walk_model_examples_in_package diff --git a/packages/models-library/tests/test__models_fit_schemas.py b/packages/models-library/tests/test__models_fit_schemas.py index 31952e7108f..403dc93e33c 100644 --- a/packages/models-library/tests/test__models_fit_schemas.py +++ b/packages/models-library/tests/test__models_fit_schemas.py @@ -8,7 +8,7 @@ import pytest from models_library.projects import Project from models_library.services import ServiceMetaDataPublished -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel @pytest.mark.skip(reason="waiting for PC PR") diff --git a/packages/models-library/tests/test__pydantic_models.py b/packages/models-library/tests/test__pydantic_models.py index 716cf9f7906..9436a9fa70b 100644 --- a/packages/models-library/tests/test__pydantic_models.py +++ b/packages/models-library/tests/test__pydantic_models.py @@ -11,8 +11,8 @@ import pytest from models_library.projects_nodes import InputTypes, OutputTypes from models_library.projects_nodes_io import SimCoreFileLink -from pydantic import BaseModel, ValidationError, schema_json_of -from pydantic.types import Json +from pydantic.v1 import BaseModel, ValidationError, schema_json_of +from pydantic.v1.types import Json # NOTE: pydantic at a glance (just a few key features): # diff --git a/packages/models-library/tests/test__pydantic_models_and_enums.py b/packages/models-library/tests/test__pydantic_models_and_enums.py index 51b4151fecb..cb9ed9ccc60 100644 --- a/packages/models-library/tests/test__pydantic_models_and_enums.py +++ b/packages/models-library/tests/test__pydantic_models_and_enums.py @@ -2,7 +2,7 @@ import pytest from models_library.utils.enums import are_equivalent_enums, enum_to_dict -from pydantic import BaseModel, ValidationError, parse_obj_as +from pydantic.v1 import BaseModel, ValidationError, parse_obj_as # diff --git a/packages/models-library/tests/test_api_schemas_webserver_projects.py b/packages/models-library/tests/test_api_schemas_webserver_projects.py index b8e4fcbdc47..ce03d24420b 100644 --- a/packages/models-library/tests/test_api_schemas_webserver_projects.py +++ b/packages/models-library/tests/test_api_schemas_webserver_projects.py @@ -14,7 +14,7 @@ ) from models_library.generics import Envelope from models_library.rest_pagination import Page -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.simcore_webserver_projects_rest_api import ( CREATE_FROM_SERVICE, CREATE_FROM_TEMPLATE, diff --git a/packages/models-library/tests/test_basic_types.py b/packages/models-library/tests/test_basic_types.py index e2077d173d1..d45937663ba 100644 --- a/packages/models-library/tests/test_basic_types.py +++ b/packages/models-library/tests/test_basic_types.py @@ -9,8 +9,8 @@ UUIDStr, VersionTag, ) -from pydantic import ConstrainedStr, ValidationError -from pydantic.tools import parse_obj_as +from pydantic.v1 import ConstrainedStr, ValidationError +from pydantic.v1.tools import parse_obj_as class _Example(NamedTuple): diff --git a/packages/models-library/tests/test_callbacks_mapping.py b/packages/models-library/tests/test_callbacks_mapping.py index e1c0df003c6..be1ee7f5990 100644 --- a/packages/models-library/tests/test_callbacks_mapping.py +++ b/packages/models-library/tests/test_callbacks_mapping.py @@ -6,7 +6,7 @@ TIMEOUT_MIN, CallbacksMapping, ) -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as def _format_with_timeout(timeout: float) -> dict[str, Any]: diff --git a/packages/models-library/tests/test_clusters.py b/packages/models-library/tests/test_clusters.py index 258bdc006f4..9e86190b4b4 100644 --- a/packages/models-library/tests/test_clusters.py +++ b/packages/models-library/tests/test_clusters.py @@ -10,7 +10,7 @@ DEFAULT_CLUSTER_ID, Cluster, ) -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError @pytest.mark.parametrize( diff --git a/packages/models-library/tests/test_docker.py b/packages/models-library/tests/test_docker.py index 2fddd55419a..58f10ccda8a 100644 --- a/packages/models-library/tests/test_docker.py +++ b/packages/models-library/tests/test_docker.py @@ -13,7 +13,7 @@ DockerLabelKey, StandardSimcoreDockerLabels, ) -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as _faker = Faker() diff --git a/packages/models-library/tests/test_emails.py b/packages/models-library/tests/test_emails.py index 42ae8c84f1f..85ed64dc254 100644 --- a/packages/models-library/tests/test_emails.py +++ b/packages/models-library/tests/test_emails.py @@ -1,6 +1,6 @@ import pytest from models_library.emails import LowerCaseEmailStr -from pydantic import BaseModel +from pydantic.v1 import BaseModel @pytest.mark.parametrize( diff --git a/packages/models-library/tests/test_errors.py b/packages/models-library/tests/test_errors.py index 6b10f6bcbdd..f335199485d 100644 --- a/packages/models-library/tests/test_errors.py +++ b/packages/models-library/tests/test_errors.py @@ -5,7 +5,7 @@ import pytest from models_library.errors import ErrorDict -from pydantic import BaseModel, ValidationError, conint +from pydantic.v1 import BaseModel, ValidationError, conint def test_pydantic_error_dict(): diff --git a/packages/models-library/tests/test_errors_classes.py b/packages/models-library/tests/test_errors_classes.py index 4372c4eb8e5..9dafd64ab8c 100644 --- a/packages/models-library/tests/test_errors_classes.py +++ b/packages/models-library/tests/test_errors_classes.py @@ -10,7 +10,7 @@ import pytest from models_library.errors_classes import OsparcErrorMixin -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin def test_get_full_class_name(): diff --git a/packages/models-library/tests/test_generics.py b/packages/models-library/tests/test_generics.py index a1201701fd8..806bcfb221e 100644 --- a/packages/models-library/tests/test_generics.py +++ b/packages/models-library/tests/test_generics.py @@ -10,7 +10,7 @@ import pytest from faker import Faker from models_library.generics import DictModel, Envelope -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError def test_dict_base_model(): diff --git a/packages/models-library/tests/test_osparc_variable_identifier.py b/packages/models-library/tests/test_osparc_variable_identifier.py index 18b48c299bd..54ae5329582 100644 --- a/packages/models-library/tests/test_osparc_variable_identifier.py +++ b/packages/models-library/tests/test_osparc_variable_identifier.py @@ -10,7 +10,7 @@ raise_if_unresolved_osparc_variable_identifier_found, replace_osparc_variable_identifier, ) -from pydantic import BaseModel, ValidationError, parse_obj_as +from pydantic.v1 import BaseModel, ValidationError, parse_obj_as VALID_IDENTIFIERS: list[str] = [ "$OSPARC_VARIABLE_One121_", diff --git a/packages/models-library/tests/test_project_networks.py b/packages/models-library/tests/test_project_networks.py index c91f0503a8e..7ec2d4c14ee 100644 --- a/packages/models-library/tests/test_project_networks.py +++ b/packages/models-library/tests/test_project_networks.py @@ -7,7 +7,7 @@ DockerNetworkName, NetworksWithAliases, ) -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as @pytest.mark.parametrize( diff --git a/packages/models-library/tests/test_project_nodes_io.py b/packages/models-library/tests/test_project_nodes_io.py index 992c4d1f604..17dfc818820 100644 --- a/packages/models-library/tests/test_project_nodes_io.py +++ b/packages/models-library/tests/test_project_nodes_io.py @@ -12,7 +12,7 @@ SimCoreFileLink, SimcoreS3DirectoryID, ) -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as @pytest.fixture() diff --git a/packages/models-library/tests/test_rabbit_messages.py b/packages/models-library/tests/test_rabbit_messages.py index 8c95af75e67..9b41e926b9e 100644 --- a/packages/models-library/tests/test_rabbit_messages.py +++ b/packages/models-library/tests/test_rabbit_messages.py @@ -8,7 +8,7 @@ ProgressRabbitMessageProject, ProgressType, ) -from pydantic import parse_raw_as +from pydantic.v1 import parse_raw_as faker = Faker() diff --git a/packages/models-library/tests/test_resource_tracker.py b/packages/models-library/tests/test_resource_tracker.py index 5871c9b8f73..17ec7bff66f 100644 --- a/packages/models-library/tests/test_resource_tracker.py +++ b/packages/models-library/tests/test_resource_tracker.py @@ -1,6 +1,6 @@ import pytest from models_library.resource_tracker import HardwareInfo -from pydantic import ValidationError +from pydantic.v1 import ValidationError @pytest.mark.parametrize( diff --git a/packages/models-library/tests/test_rest_pagination.py b/packages/models-library/tests/test_rest_pagination.py index a9da9db2f1b..55b1b7051bb 100644 --- a/packages/models-library/tests/test_rest_pagination.py +++ b/packages/models-library/tests/test_rest_pagination.py @@ -2,7 +2,7 @@ import pytest from models_library.rest_pagination import Page, PageMetaInfoLimitOffset -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel @pytest.mark.parametrize("cls_model", [Page[str], PageMetaInfoLimitOffset]) diff --git a/packages/models-library/tests/test_service_resources.py b/packages/models-library/tests/test_service_resources.py index c119a33e898..b93ed67821b 100644 --- a/packages/models-library/tests/test_service_resources.py +++ b/packages/models-library/tests/test_service_resources.py @@ -13,7 +13,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as @pytest.mark.parametrize( diff --git a/packages/models-library/tests/test_service_settings_labels.py b/packages/models-library/tests/test_service_settings_labels.py index a564c1be88f..4d3db0199bc 100644 --- a/packages/models-library/tests/test_service_settings_labels.py +++ b/packages/models-library/tests/test_service_settings_labels.py @@ -31,8 +31,8 @@ ) from models_library.services_resources import DEFAULT_SINGLE_SERVICE_NAME from models_library.utils.string_substitution import TextTemplate -from pydantic import BaseModel, ValidationError, parse_obj_as, parse_raw_as -from pydantic.json import pydantic_encoder +from pydantic.v1 import BaseModel, ValidationError, parse_obj_as, parse_raw_as +from pydantic.v1.json import pydantic_encoder class _Parametrization(NamedTuple): diff --git a/packages/models-library/tests/test_service_settings_nat_rule.py b/packages/models-library/tests/test_service_settings_nat_rule.py index 66319e9435c..a0369d0417e 100644 --- a/packages/models-library/tests/test_service_settings_nat_rule.py +++ b/packages/models-library/tests/test_service_settings_nat_rule.py @@ -9,7 +9,7 @@ replace_osparc_variable_identifier, ) from models_library.service_settings_nat_rule import NATRule -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as SUPPORTED_TEMPLATES: set[str] = { "$OSPARC_VARIABLE_%s", diff --git a/packages/models-library/tests/test_user_preferences.py b/packages/models-library/tests/test_user_preferences.py index 272e73cf6e5..dc9d330b342 100644 --- a/packages/models-library/tests/test_user_preferences.py +++ b/packages/models-library/tests/test_user_preferences.py @@ -15,7 +15,7 @@ _AutoRegisterMeta, _BaseUserPreferenceModel, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as _SERVICE_KEY_AND_VERSION_SAMPLES: list[tuple[ServiceKey, ServiceVersion]] = [ ( diff --git a/packages/models-library/tests/test_utils_common_validators.py b/packages/models-library/tests/test_utils_common_validators.py index d7fe367ab5d..25580daff62 100644 --- a/packages/models-library/tests/test_utils_common_validators.py +++ b/packages/models-library/tests/test_utils_common_validators.py @@ -7,7 +7,7 @@ none_to_empty_str_pre_validator, null_or_none_str_to_none_validator, ) -from pydantic import BaseModel, ValidationError, validator +from pydantic.v1 import BaseModel, ValidationError, validator def test_enums_pre_validator(): diff --git a/packages/models-library/tests/test_utils_fastapi_encoders.py b/packages/models-library/tests/test_utils_fastapi_encoders.py index 6ee05a56e57..8ddff375f0f 100644 --- a/packages/models-library/tests/test_utils_fastapi_encoders.py +++ b/packages/models-library/tests/test_utils_fastapi_encoders.py @@ -10,7 +10,7 @@ import pytest from faker import Faker from models_library.utils.fastapi_encoders import servicelib_jsonable_encoder -from pydantic.json import pydantic_encoder +from pydantic.v1.json import pydantic_encoder def servicelib__json_serialization__json_dumps(obj: Any, **kwargs): diff --git a/packages/models-library/tests/test_utils_json_serialization.py b/packages/models-library/tests/test_utils_json_serialization.py index 4e3839fc6e9..2f8a843a9c8 100644 --- a/packages/models-library/tests/test_utils_json_serialization.py +++ b/packages/models-library/tests/test_utils_json_serialization.py @@ -18,7 +18,7 @@ json_dumps, json_loads, ) -from pydantic.json import pydantic_encoder +from pydantic.v1.json import pydantic_encoder def _expected_json_dumps(obj: Any, default=pydantic_encoder, **json_dumps_kwargs): diff --git a/packages/models-library/tests/test_utils_nodes.py b/packages/models-library/tests/test_utils_nodes.py index 47465ce236d..2c7c0051d96 100644 --- a/packages/models-library/tests/test_utils_nodes.py +++ b/packages/models-library/tests/test_utils_nodes.py @@ -14,7 +14,7 @@ SimcoreS3FileID, ) from models_library.utils.nodes import compute_node_hash -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as @pytest.fixture() diff --git a/packages/models-library/tests/test_utils_pydantic_tools_extension.py b/packages/models-library/tests/test_utils_pydantic_tools_extension.py index 95a50099c02..9ee07eb2eef 100644 --- a/packages/models-library/tests/test_utils_pydantic_tools_extension.py +++ b/packages/models-library/tests/test_utils_pydantic_tools_extension.py @@ -2,7 +2,7 @@ FieldNotRequired, parse_obj_or_none, ) -from pydantic import BaseModel, Field, StrictInt +from pydantic.v1 import BaseModel, Field, StrictInt class MyModel(BaseModel): diff --git a/packages/models-library/tests/test_utils_service_io.py b/packages/models-library/tests/test_utils_service_io.py index 2bf58a28869..fa5e861a364 100644 --- a/packages/models-library/tests/test_utils_service_io.py +++ b/packages/models-library/tests/test_utils_service_io.py @@ -17,7 +17,7 @@ from models_library.services import ServiceInput, ServiceOutput, ServicePortKey from models_library.utils.json_schema import jsonschema_validate_schema from models_library.utils.services_io import get_service_io_json_schema -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as example_inputs_labels = [ e for e in ServiceInput.Config.schema_extra["examples"] if e["label"] diff --git a/packages/models-library/tests/test_utils_specs_substitution.py b/packages/models-library/tests/test_utils_specs_substitution.py index 0670e56e271..e20fa5ed848 100644 --- a/packages/models-library/tests/test_utils_specs_substitution.py +++ b/packages/models-library/tests/test_utils_specs_substitution.py @@ -12,7 +12,7 @@ SpecsSubstitutionsResolver, SubstitutionValue, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as @pytest.fixture() diff --git a/packages/notifications-library/requirements/_base.txt b/packages/notifications-library/requirements/_base.txt index b7e4320e9e0..0201ebad690 100644 --- a/packages/notifications-library/requirements/_base.txt +++ b/packages/notifications-library/requirements/_base.txt @@ -4,6 +4,8 @@ aiosmtplib==3.0.2 # via -r requirements/_base.in alembic==1.13.2 # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic arrow==1.3.0 # via -r requirements/../../../packages/models-library/requirements/_base.in async-timeout==4.0.3 @@ -63,7 +65,7 @@ orjson==3.10.7 # -r requirements/../../../packages/models-library/requirements/_base.in psycopg2-binary==2.9.9 # via sqlalchemy -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -72,6 +74,8 @@ pydantic==1.10.17 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/postgres-database/requirements/_base.in # -r requirements/../../../packages/settings-library/requirements/_base.in +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich python-dateutil==2.9.0.post0 @@ -108,6 +112,7 @@ typing-extensions==4.12.2 # via # alembic # pydantic + # pydantic-core # typer yarl==1.9.4 # via -r requirements/../../../packages/postgres-database/requirements/_base.in diff --git a/packages/notifications-library/requirements/_test.txt b/packages/notifications-library/requirements/_test.txt index 48dd95db3fc..25211dd50f2 100644 --- a/packages/notifications-library/requirements/_test.txt +++ b/packages/notifications-library/requirements/_test.txt @@ -10,8 +10,6 @@ coverage==7.6.1 # pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in greenlet==3.0.3 @@ -90,11 +88,6 @@ tenacity==9.0.0 # via -r requirements/_test.in termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in typing-extensions==4.12.2 diff --git a/packages/notifications-library/requirements/_tools.txt b/packages/notifications-library/requirements/_tools.txt index 71884cfdaf4..8204f34a33c 100644 --- a/packages/notifications-library/requirements/_tools.txt +++ b/packages/notifications-library/requirements/_tools.txt @@ -71,22 +71,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/notifications-library/tests/conftest.py b/packages/notifications-library/tests/conftest.py index 4570801119a..14a8edbef28 100644 --- a/packages/notifications-library/tests/conftest.py +++ b/packages/notifications-library/tests/conftest.py @@ -12,7 +12,7 @@ from models_library.products import ProductName from notifications_library._models import ProductData, UserData from notifications_library.payments import PaymentData -from pydantic import EmailStr +from pydantic.v1 import EmailStr from pytest_simcore.helpers.typing_env import EnvVarsDict from simcore_postgres_database.models.products import Vendor diff --git a/packages/notifications-library/tests/email/conftest.py b/packages/notifications-library/tests/email/conftest.py index f0f47f0e3d2..887c7b4a527 100644 --- a/packages/notifications-library/tests/email/conftest.py +++ b/packages/notifications-library/tests/email/conftest.py @@ -1,7 +1,7 @@ from unittest.mock import MagicMock import pytest -from pydantic import EmailStr +from pydantic.v1 import EmailStr from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/packages/notifications-library/tests/email/test_email_events.py b/packages/notifications-library/tests/email/test_email_events.py index 5e3786ab234..9ae0e587062 100644 --- a/packages/notifications-library/tests/email/test_email_events.py +++ b/packages/notifications-library/tests/email/test_email_events.py @@ -44,8 +44,8 @@ from notifications_library._models import ProductData, UserData from notifications_library._render import create_render_env_from_package from notifications_library.payments import PaymentData -from pydantic import EmailStr -from pydantic.json import pydantic_encoder +from pydantic.v1 import EmailStr +from pydantic.v1.json import pydantic_encoder from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.email import SMTPSettings diff --git a/packages/notifications-library/tests/with_db/conftest.py b/packages/notifications-library/tests/with_db/conftest.py index bdd3d0f3d09..e3cebb24235 100644 --- a/packages/notifications-library/tests/with_db/conftest.py +++ b/packages/notifications-library/tests/with_db/conftest.py @@ -14,7 +14,7 @@ from models_library.products import ProductName from models_library.users import GroupID, UserID from notifications_library._templates import get_default_named_templates -from pydantic import validate_arguments +from pydantic.v1 import validate_arguments from simcore_postgres_database.models.jinja2_templates import jinja2_templates from simcore_postgres_database.models.payments_transactions import payments_transactions from simcore_postgres_database.models.products import products diff --git a/packages/postgres-database/requirements/_base.txt b/packages/postgres-database/requirements/_base.txt index aaf19732f53..f9c2f011c15 100644 --- a/packages/postgres-database/requirements/_base.txt +++ b/packages/postgres-database/requirements/_base.txt @@ -1,5 +1,7 @@ alembic==1.13.2 # via -r requirements/_base.in +annotated-types==0.7.0 + # via pydantic async-timeout==4.0.3 # via asyncpg asyncpg==0.29.0 @@ -18,10 +20,12 @@ multidict==6.0.5 # via yarl psycopg2-binary==2.9.9 # via sqlalchemy -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -r requirements/_base.in +pydantic-core==2.20.1 + # via pydantic sqlalchemy==1.4.53 # via # -c requirements/../../../requirements/constraints.txt @@ -31,5 +35,6 @@ typing-extensions==4.12.2 # via # alembic # pydantic + # pydantic-core yarl==1.9.4 # via -r requirements/_base.in diff --git a/packages/postgres-database/requirements/_test.txt b/packages/postgres-database/requirements/_test.txt index 245a367c69b..8bd80b78b95 100644 --- a/packages/postgres-database/requirements/_test.txt +++ b/packages/postgres-database/requirements/_test.txt @@ -10,8 +10,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in greenlet==3.0.3 @@ -70,11 +68,6 @@ sqlalchemy==1.4.53 # aiopg sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-docker==7.1.0.20240821 # via -r requirements/_test.in types-psycopg2==2.9.21.20240819 diff --git a/packages/postgres-database/requirements/_tools.txt b/packages/postgres-database/requirements/_tools.txt index 10d7162ab81..9247bc4b1a9 100644 --- a/packages/postgres-database/requirements/_tools.txt +++ b/packages/postgres-database/requirements/_tools.txt @@ -70,22 +70,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/postgres-database/src/simcore_postgres_database/utils_folders.py b/packages/postgres-database/src/simcore_postgres_database/utils_folders.py index e0f59cdcfd2..da68861a1fe 100644 --- a/packages/postgres-database/src/simcore_postgres_database/utils_folders.py +++ b/packages/postgres-database/src/simcore_postgres_database/utils_folders.py @@ -10,7 +10,7 @@ import sqlalchemy as sa from aiopg.sa.connection import SAConnection from aiopg.sa.result import RowProxy -from pydantic import ( +from pydantic.v1 import ( BaseModel, ConstrainedStr, Field, @@ -19,7 +19,7 @@ ValidationError, parse_obj_as, ) -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin from simcore_postgres_database.utils_ordering import OrderByDict from sqlalchemy import Column, func from sqlalchemy.dialects import postgresql diff --git a/packages/postgres-database/src/simcore_postgres_database/utils_projects_metadata.py b/packages/postgres-database/src/simcore_postgres_database/utils_projects_metadata.py index 39749b7fdbf..02ce02c660b 100644 --- a/packages/postgres-database/src/simcore_postgres_database/utils_projects_metadata.py +++ b/packages/postgres-database/src/simcore_postgres_database/utils_projects_metadata.py @@ -5,8 +5,8 @@ import sqlalchemy as sa from aiopg.sa.connection import SAConnection from aiopg.sa.result import ResultProxy, RowProxy -from pydantic import BaseModel -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import BaseModel +from pydantic.v1.errors import PydanticErrorMixin from sqlalchemy.dialects.postgresql import insert as pg_insert from .errors import ForeignKeyViolation diff --git a/packages/postgres-database/src/simcore_postgres_database/utils_projects_nodes.py b/packages/postgres-database/src/simcore_postgres_database/utils_projects_nodes.py index 09cb8a561f4..8dea957d544 100644 --- a/packages/postgres-database/src/simcore_postgres_database/utils_projects_nodes.py +++ b/packages/postgres-database/src/simcore_postgres_database/utils_projects_nodes.py @@ -5,8 +5,8 @@ import sqlalchemy from aiopg.sa.connection import SAConnection -from pydantic import BaseModel, Field -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import BaseModel, Field +from pydantic.v1.errors import PydanticErrorMixin from sqlalchemy.dialects.postgresql import insert as pg_insert from .errors import ForeignKeyViolation, UniqueViolation diff --git a/packages/postgres-database/tests/test_utils_folders.py b/packages/postgres-database/tests/test_utils_folders.py index 8c49fd9914f..29f67f17590 100644 --- a/packages/postgres-database/tests/test_utils_folders.py +++ b/packages/postgres-database/tests/test_utils_folders.py @@ -12,7 +12,7 @@ import sqlalchemy as sa from aiopg.sa.connection import SAConnection from aiopg.sa.result import RowProxy -from pydantic import BaseModel, Field, NonNegativeInt +from pydantic.v1 import BaseModel, Field, NonNegativeInt from pytest_simcore.helpers.faker_factories import random_product from simcore_postgres_database.models.folders import ( folders, diff --git a/packages/pytest-simcore/src/pytest_simcore/aws_ec2_service.py b/packages/pytest-simcore/src/pytest_simcore/aws_ec2_service.py index f971ef9b8f7..c421d26b9b9 100644 --- a/packages/pytest-simcore/src/pytest_simcore/aws_ec2_service.py +++ b/packages/pytest-simcore/src/pytest_simcore/aws_ec2_service.py @@ -13,7 +13,7 @@ from aiobotocore.session import ClientCreatorContext from aws_library.ec2 import EC2InstanceData, Resources from faker import Faker -from pydantic import ByteSize +from pydantic.v1 import ByteSize from settings_library.ec2 import EC2Settings from types_aiobotocore_ec2.client import EC2Client diff --git a/packages/pytest-simcore/src/pytest_simcore/aws_server.py b/packages/pytest-simcore/src/pytest_simcore/aws_server.py index 077fb25d51a..903386c3a9d 100644 --- a/packages/pytest-simcore/src/pytest_simcore/aws_server.py +++ b/packages/pytest-simcore/src/pytest_simcore/aws_server.py @@ -11,7 +11,7 @@ from faker import Faker from models_library.utils.fastapi_encoders import jsonable_encoder from moto.server import ThreadedMotoServer -from pydantic import AnyHttpUrl, SecretStr, parse_obj_as +from pydantic.v1 import AnyHttpUrl, SecretStr, parse_obj_as from pytest_mock.plugin import MockerFixture from settings_library.basic_types import IDStr from settings_library.ec2 import EC2Settings diff --git a/packages/pytest-simcore/src/pytest_simcore/faker_payments_data.py b/packages/pytest-simcore/src/pytest_simcore/faker_payments_data.py index 9d675c45e11..258ba4740c2 100644 --- a/packages/pytest-simcore/src/pytest_simcore/faker_payments_data.py +++ b/packages/pytest-simcore/src/pytest_simcore/faker_payments_data.py @@ -24,7 +24,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, HttpUrl, parse_obj_as +from pydantic.v1 import EmailStr, HttpUrl, parse_obj_as from simcore_postgres_database.models.payments_transactions import ( PaymentTransactionState, ) diff --git a/packages/pytest-simcore/src/pytest_simcore/faker_products_data.py b/packages/pytest-simcore/src/pytest_simcore/faker_products_data.py index f82636b6633..ba2822a9e00 100644 --- a/packages/pytest-simcore/src/pytest_simcore/faker_products_data.py +++ b/packages/pytest-simcore/src/pytest_simcore/faker_products_data.py @@ -14,7 +14,7 @@ import pytest from faker import Faker from models_library.products import ProductName, StripePriceID, StripeTaxRateID -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from .helpers.faker_factories import random_product diff --git a/packages/pytest-simcore/src/pytest_simcore/faker_projects_data.py b/packages/pytest-simcore/src/pytest_simcore/faker_projects_data.py index 643ffee8859..6698a366ae5 100644 --- a/packages/pytest-simcore/src/pytest_simcore/faker_projects_data.py +++ b/packages/pytest-simcore/src/pytest_simcore/faker_projects_data.py @@ -13,7 +13,7 @@ from faker import Faker from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as _MESSAGE = ( "If set, it overrides the fake value of `{}` fixture." diff --git a/packages/pytest-simcore/src/pytest_simcore/faker_users_data.py b/packages/pytest-simcore/src/pytest_simcore/faker_users_data.py index 6ba011db47c..8205e9e772a 100644 --- a/packages/pytest-simcore/src/pytest_simcore/faker_users_data.py +++ b/packages/pytest-simcore/src/pytest_simcore/faker_users_data.py @@ -14,7 +14,7 @@ from faker import Faker from models_library.basic_types import IDStr from models_library.users import UserID -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from .helpers.faker_factories import DEFAULT_TEST_PASSWORD, random_user diff --git a/packages/pytest-simcore/src/pytest_simcore/file_extra.py b/packages/pytest-simcore/src/pytest_simcore/file_extra.py index 99ba8cc031c..f44b4e5baf9 100644 --- a/packages/pytest-simcore/src/pytest_simcore/file_extra.py +++ b/packages/pytest-simcore/src/pytest_simcore/file_extra.py @@ -4,7 +4,7 @@ import pytest from faker import Faker -from pydantic import ByteSize +from pydantic.v1 import ByteSize from pytest_simcore.helpers.logging_tools import log_context diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_models.py b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_models.py index 60e048f56d3..1f916a8cecf 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_models.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_models.py @@ -6,7 +6,7 @@ import httpx import respx from fastapi import status -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from .httpx_calls_capture_openapi import enhance_path_description_from_openapi_spec from .httpx_calls_capture_parameters import PathDescription diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_openapi.py b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_openapi.py index fd5afaa183a..8c38e5c9e74 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_openapi.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_openapi.py @@ -5,7 +5,7 @@ import httpx import jsonref -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as from settings_library.catalog import CatalogSettings from settings_library.director_v2 import DirectorV2Settings from settings_library.storage import StorageSettings diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py index 89783d0591c..09719836d22 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_calls_capture_parameters.py @@ -1,6 +1,6 @@ from typing import Literal -from pydantic import BaseModel, Field, root_validator, validator +from pydantic.v1 import BaseModel, Field, root_validator, validator from .httpx_calls_capture_errors import OpenApiSpecError diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_client_base_dev.py b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_client_base_dev.py index d9b5bb64437..b22ed71b808 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_client_base_dev.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/httpx_client_base_dev.py @@ -6,7 +6,7 @@ from fastapi.encoders import jsonable_encoder from httpx._types import URLTypes from jsonschema import ValidationError -from pydantic import parse_file_as +from pydantic.v1 import parse_file_as from .httpx_calls_capture_errors import CaptureProcessingError from .httpx_calls_capture_models import HttpApiCallCaptureModel, get_captured_model diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/parametrizations.py b/packages/pytest-simcore/src/pytest_simcore/helpers/parametrizations.py index ed6381f5611..67eb3be616f 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/parametrizations.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/parametrizations.py @@ -1,6 +1,6 @@ import pytest from _pytest.mark.structures import ParameterSet -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as def byte_size_ids(val) -> str | None: diff --git a/packages/pytest-simcore/src/pytest_simcore/helpers/s3.py b/packages/pytest-simcore/src/pytest_simcore/helpers/s3.py index 5d7e721a832..30d1cd3f7a9 100644 --- a/packages/pytest-simcore/src/pytest_simcore/helpers/s3.py +++ b/packages/pytest-simcore/src/pytest_simcore/helpers/s3.py @@ -8,7 +8,7 @@ from aiohttp import ClientSession from aws_library.s3 import MultiPartUploadLinks from models_library.api_schemas_storage import ETag, FileUploadSchema, UploadedPart -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.aiohttp import status from servicelib.utils import limited_as_completed, logged_gather from types_aiobotocore_s3 import S3Client diff --git a/packages/pytest-simcore/src/pytest_simcore/httpbin_service.py b/packages/pytest-simcore/src/pytest_simcore/httpbin_service.py index b6c0a5aad3b..ca078aef616 100644 --- a/packages/pytest-simcore/src/pytest_simcore/httpbin_service.py +++ b/packages/pytest-simcore/src/pytest_simcore/httpbin_service.py @@ -14,7 +14,7 @@ import requests import requests.exceptions from docker.errors import APIError -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from tenacity import retry from tenacity.after import after_log from tenacity.retry import retry_if_exception_type diff --git a/packages/pytest-simcore/src/pytest_simcore/httpx_calls_capture.py b/packages/pytest-simcore/src/pytest_simcore/httpx_calls_capture.py index 5c8df1ff6c5..8273164beee 100644 --- a/packages/pytest-simcore/src/pytest_simcore/httpx_calls_capture.py +++ b/packages/pytest-simcore/src/pytest_simcore/httpx_calls_capture.py @@ -38,7 +38,7 @@ import pytest import respx import yaml -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture, MockType from pytest_simcore.helpers.docker import get_service_published_port from pytest_simcore.helpers.host import get_localhost_ip diff --git a/packages/pytest-simcore/src/pytest_simcore/hypothesis_type_strategies.py b/packages/pytest-simcore/src/pytest_simcore/hypothesis_type_strategies.py index ad80ab57774..0d6505d8010 100644 --- a/packages/pytest-simcore/src/pytest_simcore/hypothesis_type_strategies.py +++ b/packages/pytest-simcore/src/pytest_simcore/hypothesis_type_strategies.py @@ -1,6 +1,6 @@ from hypothesis import provisional from hypothesis import strategies as st -from pydantic import AnyHttpUrl, AnyUrl, HttpUrl +from pydantic.v1 import AnyHttpUrl, AnyUrl, HttpUrl # FIXME: For now it seems the pydantic hypothesis plugin does not provide strategies for these types. # therefore we currently provide it diff --git a/packages/pytest-simcore/src/pytest_simcore/pydantic_models.py b/packages/pytest-simcore/src/pytest_simcore/pydantic_models.py index 7cfbf13df11..630df0b758a 100644 --- a/packages/pytest-simcore/src/pytest_simcore/pydantic_models.py +++ b/packages/pytest-simcore/src/pytest_simcore/pydantic_models.py @@ -9,7 +9,7 @@ from typing import Any, NamedTuple import pytest -from pydantic import BaseModel +from pydantic.v1 import BaseModel def is_strict_inner(outer_cls: type, inner_cls: type) -> bool: diff --git a/packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py b/packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py index dffe3883c61..21ef0a74421 100644 --- a/packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py +++ b/packages/pytest-simcore/src/pytest_simcore/services_api_mocks_for_aiohttp_clients.py @@ -28,7 +28,7 @@ from models_library.projects_pipeline import ComputationTask from models_library.projects_state import RunningState from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.aiohttp import status from yarl import URL diff --git a/packages/pytest-simcore/src/pytest_simcore/simcore_dask_service.py b/packages/pytest-simcore/src/pytest_simcore/simcore_dask_service.py index 26f16b02a41..fc96d6c65fc 100644 --- a/packages/pytest-simcore/src/pytest_simcore/simcore_dask_service.py +++ b/packages/pytest-simcore/src/pytest_simcore/simcore_dask_service.py @@ -10,7 +10,7 @@ import pytest from distributed import Client from models_library.clusters import InternalClusterAuthentication, TLSAuthentication -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl from .helpers.docker import get_service_published_port from .helpers.host import get_localhost_ip diff --git a/packages/pytest-simcore/src/pytest_simcore/simcore_storage_service.py b/packages/pytest-simcore/src/pytest_simcore/simcore_storage_service.py index 9628d1058c9..1c64b2cd170 100644 --- a/packages/pytest-simcore/src/pytest_simcore/simcore_storage_service.py +++ b/packages/pytest-simcore/src/pytest_simcore/simcore_storage_service.py @@ -10,7 +10,7 @@ import tenacity from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimcoreS3FileID -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from pytest_mock import MockerFixture from servicelib.minio_utils import ServiceRetryPolicyUponInitialization from yarl import URL diff --git a/packages/service-integration/requirements/_base.txt b/packages/service-integration/requirements/_base.txt index 904f97c614f..4ea433fc4aa 100644 --- a/packages/service-integration/requirements/_base.txt +++ b/packages/service-integration/requirements/_base.txt @@ -1,3 +1,5 @@ +annotated-types==0.7.0 + # via pydantic arrow==1.3.0 # via # -r requirements/../../../packages/models-library/requirements/_base.in @@ -31,8 +33,6 @@ docker==7.1.0 # via -r requirements/_base.in email-validator==2.2.0 # via pydantic -exceptiongroup==1.2.2 - # via pytest idna==3.7 # via # email-validator @@ -68,11 +68,13 @@ packaging==24.1 # via pytest pluggy==1.5.0 # via pytest -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/models-library/requirements/_base.in +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pytest==8.3.2 @@ -109,8 +111,6 @@ six==1.16.0 # via python-dateutil text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via pytest typer==0.12.4 # via -r requirements/_base.in types-python-dateutil==2.9.0.20240821 @@ -118,6 +118,7 @@ types-python-dateutil==2.9.0.20240821 typing-extensions==4.12.2 # via # pydantic + # pydantic-core # typer urllib3==2.2.2 # via diff --git a/packages/service-integration/requirements/_test.txt b/packages/service-integration/requirements/_test.txt index 925a176d40c..fa704698091 100644 --- a/packages/service-integration/requirements/_test.txt +++ b/packages/service-integration/requirements/_test.txt @@ -6,10 +6,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.2 - # via - # -c requirements/_base.txt - # pytest iniconfig==2.0.0 # via # -c requirements/_base.txt @@ -48,11 +44,6 @@ rpds-py==0.20.0 # referencing termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # -c requirements/_base.txt - # coverage - # pytest types-docker==7.1.0.20240821 # via -r requirements/_test.in types-jsonschema==4.23.0.20240813 diff --git a/packages/service-integration/requirements/_tools.txt b/packages/service-integration/requirements/_tools.txt index f76d26f846f..354746f70e4 100644 --- a/packages/service-integration/requirements/_tools.txt +++ b/packages/service-integration/requirements/_tools.txt @@ -69,22 +69,11 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_base.txt - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/service-integration/src/service_integration/_compose_spec_model_autogenerated.py b/packages/service-integration/src/service_integration/_compose_spec_model_autogenerated.py index a390a469a41..806d8fa73b3 100644 --- a/packages/service-integration/src/service_integration/_compose_spec_model_autogenerated.py +++ b/packages/service-integration/src/service_integration/_compose_spec_model_autogenerated.py @@ -7,7 +7,7 @@ from enum import Enum from typing import Any -from pydantic import BaseModel, ConstrainedInt, Extra, Field, conint, constr +from pydantic.v1 import BaseModel, ConstrainedInt, Extra, Field, conint, constr # MODIFICATIONS ------------------------------------------------------------------------- # diff --git a/packages/service-integration/src/service_integration/cli/_config.py b/packages/service-integration/src/service_integration/cli/_config.py index 2f41dcb6f72..204418f4f2b 100644 --- a/packages/service-integration/src/service_integration/cli/_config.py +++ b/packages/service-integration/src/service_integration/cli/_config.py @@ -5,7 +5,7 @@ import rich import typer import yaml -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..compose_spec_model import ComposeSpecification from ..errors import InvalidLabelsError diff --git a/packages/service-integration/src/service_integration/errors.py b/packages/service-integration/src/service_integration/errors.py index 8d216b7d918..32aa329e2b4 100644 --- a/packages/service-integration/src/service_integration/errors.py +++ b/packages/service-integration/src/service_integration/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class ServiceIntegrationError(PydanticErrorMixin, RuntimeError): diff --git a/packages/service-integration/src/service_integration/oci_image_spec.py b/packages/service-integration/src/service_integration/oci_image_spec.py index e07a5e4cafc..e9f4ffad2b0 100644 --- a/packages/service-integration/src/service_integration/oci_image_spec.py +++ b/packages/service-integration/src/service_integration/oci_image_spec.py @@ -11,9 +11,9 @@ from models_library.basic_types import SHA1Str, VersionStr from models_library.utils.labels_annotations import from_labels, to_labels -from pydantic import BaseModel, Field -from pydantic.config import Extra -from pydantic.networks import AnyUrl +from pydantic.v1 import BaseModel, Field +from pydantic.v1.config import Extra +from pydantic.v1.networks import AnyUrl # # Prefix added to docker image labels using reverse DNS notations of a domain they own diff --git a/packages/service-integration/src/service_integration/osparc_config.py b/packages/service-integration/src/service_integration/osparc_config.py index 1a340729e41..0047478d256 100644 --- a/packages/service-integration/src/service_integration/osparc_config.py +++ b/packages/service-integration/src/service_integration/osparc_config.py @@ -36,11 +36,11 @@ from_labels, to_labels, ) -from pydantic import NonNegativeInt, ValidationError -from pydantic.class_validators import root_validator, validator -from pydantic.config import Extra -from pydantic.fields import Field -from pydantic.main import BaseModel +from pydantic.v1 import NonNegativeInt, ValidationError +from pydantic.v1.class_validators import root_validator, validator +from pydantic.v1.config import Extra +from pydantic.v1.fields import Field +from pydantic.v1.main import BaseModel from .compose_spec_model import ComposeSpecification from .settings import AppSettings diff --git a/packages/service-integration/src/service_integration/settings.py b/packages/service-integration/src/service_integration/settings.py index 70c971c8db9..bed05718e2d 100644 --- a/packages/service-integration/src/service_integration/settings.py +++ b/packages/service-integration/src/service_integration/settings.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, BaseSettings, Field, SecretStr +from pydantic.v1 import BaseModel, BaseSettings, Field, SecretStr class Registry(BaseModel): diff --git a/packages/service-integration/src/service_integration/versioning.py b/packages/service-integration/src/service_integration/versioning.py index 3ed56868e50..c7f41634633 100644 --- a/packages/service-integration/src/service_integration/versioning.py +++ b/packages/service-integration/src/service_integration/versioning.py @@ -5,7 +5,7 @@ from models_library.basic_regex import SEMANTIC_VERSION_RE_W_CAPTURE_GROUPS from packaging.version import Version -from pydantic import BaseModel, ConstrainedStr, Field +from pydantic.v1 import BaseModel, ConstrainedStr, Field class SemanticVersionStr(ConstrainedStr): diff --git a/packages/service-integration/tests/test_osparc_image_specs.py b/packages/service-integration/tests/test_osparc_image_specs.py index b482bc85a4c..6a3b285a964 100644 --- a/packages/service-integration/tests/test_osparc_image_specs.py +++ b/packages/service-integration/tests/test_osparc_image_specs.py @@ -7,7 +7,7 @@ import pytest import yaml -from pydantic import BaseModel +from pydantic.v1 import BaseModel from service_integration.compose_spec_model import BuildItem, Service from service_integration.osparc_config import ( DockerComposeOverwriteConfig, diff --git a/packages/service-library/requirements/_aiohttp.txt b/packages/service-library/requirements/_aiohttp.txt index cebbcc2dd9f..b0132a53002 100644 --- a/packages/service-library/requirements/_aiohttp.txt +++ b/packages/service-library/requirements/_aiohttp.txt @@ -14,9 +14,7 @@ aiosignal==1.3.1 aiozipkin==1.1.1 # via -r requirements/_aiohttp.in async-timeout==4.0.3 - # via - # aiohttp - # aiopg + # via aiopg attrs==24.2.0 # via # -r requirements/_aiohttp.in diff --git a/packages/service-library/requirements/_base.txt b/packages/service-library/requirements/_base.txt index 69daeedb073..3b6d2e8a31f 100644 --- a/packages/service-library/requirements/_base.txt +++ b/packages/service-library/requirements/_base.txt @@ -18,6 +18,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.4.0 # via # fast-depends @@ -26,10 +28,6 @@ arrow==1.3.0 # via # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==24.2.0 # via # aiohttp @@ -41,8 +39,6 @@ dnspython==2.6.1 # via email-validator email-validator==2.2.0 # via pydantic -exceptiongroup==1.2.2 - # via anyio fast-depends==2.4.8 # via faststream faststream==0.5.18 @@ -76,7 +72,7 @@ orjson==3.10.7 # -r requirements/../../../packages/models-library/requirements/_base.in pamqp==3.3.0 # via aiormq -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt @@ -85,6 +81,8 @@ pydantic==1.10.17 # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/_base.in # fast-depends +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.7.2 @@ -137,9 +135,9 @@ types-python-dateutil==2.9.0.20240821 typing-extensions==4.12.2 # via # aiodebug - # anyio # faststream # pydantic + # pydantic-core # typer yarl==1.9.4 # via diff --git a/packages/service-library/requirements/_fastapi.txt b/packages/service-library/requirements/_fastapi.txt index 9a07c682d49..2f066595b42 100644 --- a/packages/service-library/requirements/_fastapi.txt +++ b/packages/service-library/requirements/_fastapi.txt @@ -11,13 +11,8 @@ certifi==2024.7.4 # httpx click==8.1.7 # via uvicorn -exceptiongroup==1.2.2 - # via anyio fastapi==0.99.1 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/_fastapi.in # prometheus-fastapi-instrumentator h11==0.14.0 @@ -42,7 +37,7 @@ prometheus-client==0.20.0 # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/_fastapi.in -pydantic==1.10.17 +pydantic==1.10.18 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt @@ -61,9 +56,7 @@ starlette==0.27.0 # fastapi typing-extensions==4.12.2 # via - # anyio # fastapi # pydantic - # uvicorn uvicorn==0.30.6 # via -r requirements/_fastapi.in diff --git a/packages/service-library/requirements/_test.txt b/packages/service-library/requirements/_test.txt index 789fdc81902..a64640db6ad 100644 --- a/packages/service-library/requirements/_test.txt +++ b/packages/service-library/requirements/_test.txt @@ -21,11 +21,6 @@ anyio==4.4.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_aiohttp.txt - # -c requirements/_base.txt - # aiohttp attrs==24.2.0 # via # -c requirements/_aiohttp.txt @@ -52,12 +47,6 @@ coverage==7.6.1 # pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.2 - # via - # -c requirements/_base.txt - # -c requirements/_fastapi.txt - # anyio - # pytest execnet==2.1.1 # via pytest-xdist faker==27.0.0 @@ -250,11 +239,6 @@ sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in types-psycopg2==2.9.21.20240819 @@ -265,7 +249,6 @@ typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_fastapi.txt - # anyio # mypy # sqlalchemy2-stubs urllib3==2.2.2 diff --git a/packages/service-library/requirements/_tools.txt b/packages/service-library/requirements/_tools.txt index 4695266d9c8..b54db6d8f5c 100644 --- a/packages/service-library/requirements/_tools.txt +++ b/packages/service-library/requirements/_tools.txt @@ -72,22 +72,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/service-library/src/servicelib/aiohttp/application_setup.py b/packages/service-library/src/servicelib/aiohttp/application_setup.py index 4fae3acc09f..50b3232ba51 100644 --- a/packages/service-library/src/servicelib/aiohttp/application_setup.py +++ b/packages/service-library/src/servicelib/aiohttp/application_setup.py @@ -8,7 +8,7 @@ import arrow from aiohttp import web -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from .application_keys import APP_CONFIG_KEY, APP_SETTINGS_KEY diff --git a/packages/service-library/src/servicelib/aiohttp/docker_utils.py b/packages/service-library/src/servicelib/aiohttp/docker_utils.py index 636b3492616..0d14557f83c 100644 --- a/packages/service-library/src/servicelib/aiohttp/docker_utils.py +++ b/packages/service-library/src/servicelib/aiohttp/docker_utils.py @@ -2,7 +2,7 @@ import aiohttp from models_library.docker import DockerGenericTag -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as from settings_library.docker_registry import RegistrySettings from yarl import URL diff --git a/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_constants.py b/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_constants.py index 79594cb18b8..79841bf0d79 100644 --- a/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_constants.py +++ b/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_constants.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat MINUTE: Final[PositiveFloat] = 60 APP_LONG_RUNNING_TASKS_MANAGER_KEY: Final[ diff --git a/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_routes.py b/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_routes.py index 8aad57ba6ce..3d7b5ef7578 100644 --- a/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_routes.py +++ b/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_routes.py @@ -3,7 +3,7 @@ from aiohttp import web from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ...long_running_tasks._errors import TaskNotCompletedError, TaskNotFoundError from ...long_running_tasks._models import TaskGet, TaskId, TaskStatus diff --git a/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_server.py b/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_server.py index df81371cbb8..64ff63b5a71 100644 --- a/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_server.py +++ b/packages/service-library/src/servicelib/aiohttp/long_running_tasks/_server.py @@ -6,7 +6,7 @@ from aiohttp import web from models_library.utils.json_serialization import json_dumps -from pydantic import AnyHttpUrl, PositiveFloat +from pydantic.v1 import AnyHttpUrl, PositiveFloat from ...aiohttp import status from ...long_running_tasks._models import TaskGet diff --git a/packages/service-library/src/servicelib/aiohttp/requests_validation.py b/packages/service-library/src/servicelib/aiohttp/requests_validation.py index 2fd5d0e41f0..987caab7f46 100644 --- a/packages/service-library/src/servicelib/aiohttp/requests_validation.py +++ b/packages/service-library/src/servicelib/aiohttp/requests_validation.py @@ -14,7 +14,7 @@ from aiohttp import web from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Extra, ValidationError, parse_obj_as +from pydantic.v1 import BaseModel, Extra, ValidationError, parse_obj_as from ..mimetype_constants import MIMETYPE_APPLICATION_JSON from . import status diff --git a/packages/service-library/src/servicelib/background_task.py b/packages/service-library/src/servicelib/background_task.py index e7a4c665c49..9f848651f14 100644 --- a/packages/service-library/src/servicelib/background_task.py +++ b/packages/service-library/src/servicelib/background_task.py @@ -5,7 +5,7 @@ from collections.abc import AsyncIterator, Awaitable, Callable from typing import Final -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin from tenacity import TryAgain from tenacity.asyncio import AsyncRetrying from tenacity.stop import stop_after_attempt diff --git a/packages/service-library/src/servicelib/deferred_tasks/_base_deferred_handler.py b/packages/service-library/src/servicelib/deferred_tasks/_base_deferred_handler.py index 3c5110ef8f8..e0777dc7887 100644 --- a/packages/service-library/src/servicelib/deferred_tasks/_base_deferred_handler.py +++ b/packages/service-library/src/servicelib/deferred_tasks/_base_deferred_handler.py @@ -2,7 +2,7 @@ from datetime import timedelta from typing import Any, ClassVar, Generic, TypeAlias, TypeVar -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from ._models import ClassUniqueReference, TaskResultError, TaskUID diff --git a/packages/service-library/src/servicelib/deferred_tasks/_deferred_manager.py b/packages/service-library/src/servicelib/deferred_tasks/_deferred_manager.py index 2427b25340e..2c3fdc85364 100644 --- a/packages/service-library/src/servicelib/deferred_tasks/_deferred_manager.py +++ b/packages/service-library/src/servicelib/deferred_tasks/_deferred_manager.py @@ -9,7 +9,7 @@ import arrow from faststream.exceptions import NackMessage, RejectMessage from faststream.rabbit import ExchangeType, RabbitBroker, RabbitExchange, RabbitRouter -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.logging_utils import log_catch, log_context from servicelib.redis import RedisClientSDK from settings_library.rabbit import RabbitSettings diff --git a/packages/service-library/src/servicelib/deferred_tasks/_models.py b/packages/service-library/src/servicelib/deferred_tasks/_models.py index 22c3ad20c87..eb1b8cc8168 100644 --- a/packages/service-library/src/servicelib/deferred_tasks/_models.py +++ b/packages/service-library/src/servicelib/deferred_tasks/_models.py @@ -1,7 +1,7 @@ from typing import Any, Literal, TypeAlias from models_library.basic_types import IDStr -from pydantic import BaseModel +from pydantic.v1 import BaseModel TaskUID: TypeAlias = IDStr # Unique identifier provided by the TaskTracker ClassUniqueReference: TypeAlias = str diff --git a/packages/service-library/src/servicelib/deferred_tasks/_redis_task_tracker.py b/packages/service-library/src/servicelib/deferred_tasks/_redis_task_tracker.py index 69762108e71..df68f891ccb 100644 --- a/packages/service-library/src/servicelib/deferred_tasks/_redis_task_tracker.py +++ b/packages/service-library/src/servicelib/deferred_tasks/_redis_task_tracker.py @@ -2,7 +2,7 @@ from uuid import uuid4 from models_library.basic_types import IDStr -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from ..redis import RedisClientSDK from ..utils import logged_gather diff --git a/packages/service-library/src/servicelib/deferred_tasks/_task_schedule.py b/packages/service-library/src/servicelib/deferred_tasks/_task_schedule.py index 5a88b99568b..edfa070c01e 100644 --- a/packages/service-library/src/servicelib/deferred_tasks/_task_schedule.py +++ b/packages/service-library/src/servicelib/deferred_tasks/_task_schedule.py @@ -2,7 +2,7 @@ from enum import Enum import arrow -from pydantic import BaseModel, Field, NonNegativeInt +from pydantic.v1 import BaseModel, Field, NonNegativeInt from ._base_deferred_handler import StartContext from ._models import ClassUniqueReference, TaskExecutionResult diff --git a/packages/service-library/src/servicelib/deferred_tasks/_worker_tracker.py b/packages/service-library/src/servicelib/deferred_tasks/_worker_tracker.py index bcf9ce5ec2a..73cf2b235e1 100644 --- a/packages/service-library/src/servicelib/deferred_tasks/_worker_tracker.py +++ b/packages/service-library/src/servicelib/deferred_tasks/_worker_tracker.py @@ -4,7 +4,7 @@ from datetime import timedelta from typing import Any -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from ._base_deferred_handler import BaseDeferredHandler, DeferredContext from ._models import ( diff --git a/packages/service-library/src/servicelib/docker_utils.py b/packages/service-library/src/servicelib/docker_utils.py index 3b3159d5916..cf285635020 100644 --- a/packages/service-library/src/servicelib/docker_utils.py +++ b/packages/service-library/src/servicelib/docker_utils.py @@ -11,7 +11,7 @@ from models_library.docker import DockerGenericTag from models_library.generated_models.docker_rest_api import ProgressDetail from models_library.utils.change_case import snake_to_camel -from pydantic import BaseModel, ByteSize, ValidationError, parse_obj_as +from pydantic.v1 import BaseModel, ByteSize, ValidationError, parse_obj_as from settings_library.docker_registry import RegistrySettings from yarl import URL diff --git a/packages/service-library/src/servicelib/error_codes.py b/packages/service-library/src/servicelib/error_codes.py index 2803e3627ab..4c9004f701e 100644 --- a/packages/service-library/src/servicelib/error_codes.py +++ b/packages/service-library/src/servicelib/error_codes.py @@ -11,8 +11,8 @@ import re from typing import TYPE_CHECKING -from pydantic.tools import parse_obj_as -from pydantic.types import constr +from pydantic.v1.tools import parse_obj_as +from pydantic.v1.types import constr _LABEL = "OEC:{}" _PATTERN = r"OEC:\d+" diff --git a/packages/service-library/src/servicelib/exception_utils.py b/packages/service-library/src/servicelib/exception_utils.py index 4f44d673838..91fe58ad9c6 100644 --- a/packages/service-library/src/servicelib/exception_utils.py +++ b/packages/service-library/src/servicelib/exception_utils.py @@ -2,7 +2,7 @@ from datetime import datetime from typing import Final -from pydantic import BaseModel, Field, NonNegativeFloat, PrivateAttr +from pydantic.v1 import BaseModel, Field, NonNegativeFloat, PrivateAttr _logger = logging.getLogger(__name__) diff --git a/packages/service-library/src/servicelib/fastapi/docker_utils.py b/packages/service-library/src/servicelib/fastapi/docker_utils.py index 1c71c190a47..a6ade2cdce5 100644 --- a/packages/service-library/src/servicelib/fastapi/docker_utils.py +++ b/packages/service-library/src/servicelib/fastapi/docker_utils.py @@ -5,7 +5,7 @@ import httpx from models_library.basic_types import IDStr from models_library.docker import DockerGenericTag -from pydantic import ByteSize, ValidationError, parse_obj_as +from pydantic.v1 import ByteSize, ValidationError, parse_obj_as from settings_library.docker_registry import RegistrySettings from yarl import URL diff --git a/packages/service-library/src/servicelib/fastapi/errors.py b/packages/service-library/src/servicelib/fastapi/errors.py index 9eebef84637..237ece5d45f 100644 --- a/packages/service-library/src/servicelib/fastapi/errors.py +++ b/packages/service-library/src/servicelib/fastapi/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class ApplicationRuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/packages/service-library/src/servicelib/fastapi/http_client_thin.py b/packages/service-library/src/servicelib/fastapi/http_client_thin.py index e00e0d636a2..e4f58d3e5de 100644 --- a/packages/service-library/src/servicelib/fastapi/http_client_thin.py +++ b/packages/service-library/src/servicelib/fastapi/http_client_thin.py @@ -7,7 +7,7 @@ from httpx import AsyncClient, ConnectError, HTTPError, PoolTimeout, Response from httpx._types import TimeoutTypes, URLTypes -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin from tenacity import RetryCallState from tenacity.asyncio import AsyncRetrying from tenacity.before_sleep import before_sleep_log diff --git a/packages/service-library/src/servicelib/fastapi/long_running_tasks/_client.py b/packages/service-library/src/servicelib/fastapi/long_running_tasks/_client.py index a2dda66735a..56d2a4c6f5f 100644 --- a/packages/service-library/src/servicelib/fastapi/long_running_tasks/_client.py +++ b/packages/service-library/src/servicelib/fastapi/long_running_tasks/_client.py @@ -6,7 +6,7 @@ from fastapi import FastAPI, status from httpx import AsyncClient, HTTPError -from pydantic import AnyHttpUrl, PositiveFloat, parse_obj_as +from pydantic.v1 import AnyHttpUrl, PositiveFloat, parse_obj_as from tenacity import RetryCallState from tenacity.asyncio import AsyncRetrying from tenacity.retry import retry_if_exception_type diff --git a/packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py b/packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py index 7cb61f29140..307df8d64c7 100644 --- a/packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py +++ b/packages/service-library/src/servicelib/fastapi/long_running_tasks/_context_manager.py @@ -3,7 +3,7 @@ from contextlib import asynccontextmanager from typing import Any, AsyncIterator, Final -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from ...long_running_tasks._errors import TaskClientTimeoutError from ...long_running_tasks._models import ( diff --git a/packages/service-library/src/servicelib/fastapi/long_running_tasks/_server.py b/packages/service-library/src/servicelib/fastapi/long_running_tasks/_server.py index c5d7429f01a..ed72ca8f59b 100644 --- a/packages/service-library/src/servicelib/fastapi/long_running_tasks/_server.py +++ b/packages/service-library/src/servicelib/fastapi/long_running_tasks/_server.py @@ -1,7 +1,7 @@ from typing import Final from fastapi import APIRouter, FastAPI -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from ...long_running_tasks._errors import BaseLongRunningError from ...long_running_tasks._task import TasksManager diff --git a/packages/service-library/src/servicelib/file_utils.py b/packages/service-library/src/servicelib/file_utils.py index c90468cba2a..792300b7458 100644 --- a/packages/service-library/src/servicelib/file_utils.py +++ b/packages/service-library/src/servicelib/file_utils.py @@ -10,7 +10,7 @@ # https://docs.python.org/3/library/os.html#os.remove from aiofiles.os import remove from aiofiles.os import wrap as sync_to_async -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as CHUNK_4KB: Final[ByteSize] = parse_obj_as(ByteSize, "4kb") # 4K blocks diff --git a/packages/service-library/src/servicelib/long_running_tasks/_errors.py b/packages/service-library/src/servicelib/long_running_tasks/_errors.py index 73722f746ac..691d0a73907 100644 --- a/packages/service-library/src/servicelib/long_running_tasks/_errors.py +++ b/packages/service-library/src/servicelib/long_running_tasks/_errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class BaseLongRunningError(PydanticErrorMixin, Exception): diff --git a/packages/service-library/src/servicelib/long_running_tasks/_models.py b/packages/service-library/src/servicelib/long_running_tasks/_models.py index b211ca29fdc..957819166dd 100644 --- a/packages/service-library/src/servicelib/long_running_tasks/_models.py +++ b/packages/service-library/src/servicelib/long_running_tasks/_models.py @@ -15,7 +15,7 @@ TaskResult, TaskStatus, ) -from pydantic import BaseModel, Field, PositiveFloat +from pydantic.v1 import BaseModel, Field, PositiveFloat TaskName: TypeAlias = str diff --git a/packages/service-library/src/servicelib/long_running_tasks/_task.py b/packages/service-library/src/servicelib/long_running_tasks/_task.py index 88960cb6327..9516c9ea682 100644 --- a/packages/service-library/src/servicelib/long_running_tasks/_task.py +++ b/packages/service-library/src/servicelib/long_running_tasks/_task.py @@ -13,7 +13,7 @@ ProgressPercent, TaskProgress, ) -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from ._errors import ( TaskAlreadyRunningError, diff --git a/packages/service-library/src/servicelib/progress_bar.py b/packages/service-library/src/servicelib/progress_bar.py index 782f89ba550..4a24b6b3661 100644 --- a/packages/service-library/src/servicelib/progress_bar.py +++ b/packages/service-library/src/servicelib/progress_bar.py @@ -10,7 +10,7 @@ ProgressStructuredMessage, ProgressUnit, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from .logging_utils import log_catch diff --git a/packages/service-library/src/servicelib/rabbitmq/_client.py b/packages/service-library/src/servicelib/rabbitmq/_client.py index dc70aa03ffa..9c78f59a671 100644 --- a/packages/service-library/src/servicelib/rabbitmq/_client.py +++ b/packages/service-library/src/servicelib/rabbitmq/_client.py @@ -5,7 +5,7 @@ from typing import Final import aio_pika -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from ..logging_utils import log_catch, log_context from ._client_base import RabbitMQClientBase diff --git a/packages/service-library/src/servicelib/rabbitmq/_client_rpc.py b/packages/service-library/src/servicelib/rabbitmq/_client_rpc.py index f7b4a81ce62..c8f09738519 100644 --- a/packages/service-library/src/servicelib/rabbitmq/_client_rpc.py +++ b/packages/service-library/src/servicelib/rabbitmq/_client_rpc.py @@ -7,7 +7,7 @@ import aio_pika from models_library.rabbitmq_basic_types import RPCMethodName, RPCNamespace -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from settings_library.rabbit import RabbitSettings from ..logging_utils import log_context diff --git a/packages/service-library/src/servicelib/rabbitmq/_constants.py b/packages/service-library/src/servicelib/rabbitmq/_constants.py index 765ebee6e47..3aa1b1bacfb 100644 --- a/packages/service-library/src/servicelib/rabbitmq/_constants.py +++ b/packages/service-library/src/servicelib/rabbitmq/_constants.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt BIND_TO_ALL_TOPICS: Final[str] = "#" RPC_REQUEST_DEFAULT_TIMEOUT_S: Final[PositiveInt] = PositiveInt(5) diff --git a/packages/service-library/src/servicelib/rabbitmq/_errors.py b/packages/service-library/src/servicelib/rabbitmq/_errors.py index 0e3efbf3a11..57fb9724f15 100644 --- a/packages/service-library/src/servicelib/rabbitmq/_errors.py +++ b/packages/service-library/src/servicelib/rabbitmq/_errors.py @@ -1,6 +1,6 @@ from typing import Final -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin _ERROR_PREFIX: Final[str] = "rabbitmq_error" diff --git a/packages/service-library/src/servicelib/rabbitmq/_models.py b/packages/service-library/src/servicelib/rabbitmq/_models.py index 565447072fa..b120bf0bf55 100644 --- a/packages/service-library/src/servicelib/rabbitmq/_models.py +++ b/packages/service-library/src/servicelib/rabbitmq/_models.py @@ -7,7 +7,7 @@ RPCMethodName, RPCNamespace, ) -from pydantic import ConstrainedStr, parse_obj_as +from pydantic.v1 import ConstrainedStr, parse_obj_as MessageHandler = Callable[[Any], Awaitable[bool]] diff --git a/packages/service-library/src/servicelib/rabbitmq/_utils.py b/packages/service-library/src/servicelib/rabbitmq/_utils.py index 716d8e2adae..967173a7980 100644 --- a/packages/service-library/src/servicelib/rabbitmq/_utils.py +++ b/packages/service-library/src/servicelib/rabbitmq/_utils.py @@ -4,7 +4,7 @@ import aio_pika from aiormq.exceptions import ChannelPreconditionFailed -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from tenacity import retry from tenacity.before_sleep import before_sleep_log from tenacity.stop import stop_after_delay diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog/services.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog/services.py index 197ea3a1ff8..677aae3dc49 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog/services.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog/services.py @@ -16,7 +16,7 @@ ) from models_library.services_types import ServiceKey, ServiceVersion from models_library.users import UserID -from pydantic import NonNegativeInt, parse_obj_as, validate_arguments +from pydantic.v1 import NonNegativeInt, parse_obj_as, validate_arguments from servicelib.logging_utils import log_decorator from servicelib.rabbitmq._constants import RPC_REQUEST_DEFAULT_TIMEOUT_S diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/errors.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/errors.py index 5e104db333c..034e409597d 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/errors.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class BaseDynamicSchedulerRPCError(PydanticErrorMixin, Exception): diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/services.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/services.py index 9da2dad425e..c5212d60c3c 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/services.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/dynamic_scheduler/services.py @@ -10,7 +10,7 @@ from models_library.api_schemas_webserver.projects_nodes import NodeGet, NodeGetIdle from models_library.projects_nodes_io import NodeID from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from servicelib.logging_utils import log_decorator from servicelib.rabbitmq import RabbitMQRPCClient diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/efs_guardian/efs_manager.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/efs_guardian/efs_manager.py index 592959eb08c..9fbfe2384a9 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/efs_guardian/efs_manager.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/efs_guardian/efs_manager.py @@ -6,7 +6,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from ....logging_utils import log_decorator from ....rabbitmq import RabbitMQRPCClient diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/errors.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/errors.py index 44549841802..7d87265b546 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/errors.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class ResourceUsageTrackerRuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_plans.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_plans.py index a7dc4b5d404..0cd845805e1 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_plans.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_plans.py @@ -16,7 +16,7 @@ PricingPlanUpdate, ) from models_library.services import ServiceKey, ServiceVersion -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from ....logging_utils import log_decorator from ....rabbitmq import RabbitMQRPCClient diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_units.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_units.py index cec80e7186a..c7cd6ec3636 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_units.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/pricing_units.py @@ -15,7 +15,7 @@ PricingUnitWithCostCreate, PricingUnitWithCostUpdate, ) -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from ....logging_utils import log_decorator from ....rabbitmq import RabbitMQRPCClient diff --git a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/service_runs.py b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/service_runs.py index e826363897a..4cb9eb6dfd3 100644 --- a/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/service_runs.py +++ b/packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/resource_usage_tracker/service_runs.py @@ -18,7 +18,7 @@ from models_library.rest_ordering import OrderBy from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import AnyUrl, NonNegativeInt, parse_obj_as +from pydantic.v1 import AnyUrl, NonNegativeInt, parse_obj_as from ....logging_utils import log_decorator from ....rabbitmq import RabbitMQRPCClient diff --git a/packages/service-library/src/servicelib/redis.py b/packages/service-library/src/servicelib/redis.py index 03847ae0b04..495ac5ba157 100644 --- a/packages/service-library/src/servicelib/redis.py +++ b/packages/service-library/src/servicelib/redis.py @@ -10,8 +10,8 @@ import redis.asyncio as aioredis import redis.exceptions -from pydantic import NonNegativeFloat, NonNegativeInt -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import NonNegativeFloat, NonNegativeInt +from pydantic.v1.errors import PydanticErrorMixin from redis.asyncio.lock import Lock from redis.asyncio.retry import Retry from redis.backoff import ExponentialBackoff diff --git a/packages/service-library/src/servicelib/sequences_utils.py b/packages/service-library/src/servicelib/sequences_utils.py index df2f9e1b6ee..a502f65ddc6 100644 --- a/packages/service-library/src/servicelib/sequences_utils.py +++ b/packages/service-library/src/servicelib/sequences_utils.py @@ -3,7 +3,7 @@ from typing import TypeVar import toolz # type: ignore[import-untyped] -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt T = TypeVar("T") diff --git a/packages/service-library/src/servicelib/utils.py b/packages/service-library/src/servicelib/utils.py index b3561689f01..e928a0c8106 100644 --- a/packages/service-library/src/servicelib/utils.py +++ b/packages/service-library/src/servicelib/utils.py @@ -21,7 +21,7 @@ from typing import Any, Final, Literal, TypeVar, cast, overload import toolz # type: ignore[import-untyped] -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt _logger = logging.getLogger(__name__) diff --git a/packages/service-library/src/servicelib/utils_meta.py b/packages/service-library/src/servicelib/utils_meta.py index 46fa78dd83e..52f7e8734c3 100644 --- a/packages/service-library/src/servicelib/utils_meta.py +++ b/packages/service-library/src/servicelib/utils_meta.py @@ -6,7 +6,7 @@ from models_library.basic_types import VersionStr from packaging.version import Version -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as class PackageInfo: diff --git a/packages/service-library/src/servicelib/utils_secrets.py b/packages/service-library/src/servicelib/utils_secrets.py index 7b74a491080..1d3cf64bbc8 100644 --- a/packages/service-library/src/servicelib/utils_secrets.py +++ b/packages/service-library/src/servicelib/utils_secrets.py @@ -2,7 +2,7 @@ import string from typing import Final -from pydantic import StrictInt, validate_arguments +from pydantic.v1 import StrictInt, validate_arguments MIN_PASSWORD_LENGTH = 30 _SAFE_SYMBOLS = "!$%*+,-.:=?@^_~" # avoid issues with parsing, espapes etc diff --git a/packages/service-library/tests/aiohttp/long_running_tasks/conftest.py b/packages/service-library/tests/aiohttp/long_running_tasks/conftest.py index 68d06d15278..3b3fb505f3e 100644 --- a/packages/service-library/tests/aiohttp/long_running_tasks/conftest.py +++ b/packages/service-library/tests/aiohttp/long_running_tasks/conftest.py @@ -9,7 +9,7 @@ from aiohttp import web from aiohttp.test_utils import TestClient from faker import Faker -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from servicelib.aiohttp import long_running_tasks, status from servicelib.aiohttp.long_running_tasks.server import TaskId diff --git a/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks.py b/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks.py index afd9e8f4fde..1723f97ec40 100644 --- a/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks.py +++ b/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks.py @@ -18,7 +18,7 @@ import pytest from aiohttp import web from aiohttp.test_utils import TestClient -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from servicelib.aiohttp import long_running_tasks, status from servicelib.aiohttp.long_running_tasks.server import TaskGet, TaskId diff --git a/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks_with_task_context.py b/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks_with_task_context.py index 941ae31359d..157031c0a6c 100644 --- a/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks_with_task_context.py +++ b/packages/service-library/tests/aiohttp/long_running_tasks/test_long_running_tasks_with_task_context.py @@ -18,7 +18,7 @@ import pytest from aiohttp import web from aiohttp.test_utils import TestClient -from pydantic import create_model, parse_obj_as +from pydantic.v1 import create_model, parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from servicelib.aiohttp import long_running_tasks, status from servicelib.aiohttp.long_running_tasks._server import ( diff --git a/packages/service-library/tests/aiohttp/test_docker_utils.py b/packages/service-library/tests/aiohttp/test_docker_utils.py index 890ffdc588b..ef5987ddc26 100644 --- a/packages/service-library/tests/aiohttp/test_docker_utils.py +++ b/packages/service-library/tests/aiohttp/test_docker_utils.py @@ -11,7 +11,7 @@ from faker import Faker from models_library.docker import DockerGenericTag from models_library.progress_bar import ProgressReport -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from servicelib import progress_bar from servicelib.aiohttp.docker_utils import retrieve_image_layer_information diff --git a/packages/service-library/tests/aiohttp/test_requests_validation.py b/packages/service-library/tests/aiohttp/test_requests_validation.py index 08e2f07bfbe..e57536825b3 100644 --- a/packages/service-library/tests/aiohttp/test_requests_validation.py +++ b/packages/service-library/tests/aiohttp/test_requests_validation.py @@ -11,7 +11,7 @@ from aiohttp.test_utils import TestClient from faker import Faker from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import ( parse_request_body_as, diff --git a/packages/service-library/tests/deferred_tasks/example_app.py b/packages/service-library/tests/deferred_tasks/example_app.py index 75850fddc2e..8dbb89e6b02 100644 --- a/packages/service-library/tests/deferred_tasks/example_app.py +++ b/packages/service-library/tests/deferred_tasks/example_app.py @@ -7,7 +7,7 @@ from typing import Any from uuid import uuid4 -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.deferred_tasks import ( BaseDeferredHandler, DeferredContext, diff --git a/packages/service-library/tests/deferred_tasks/test__base_deferred_handler.py b/packages/service-library/tests/deferred_tasks/test__base_deferred_handler.py index 9f3451058bf..c903571af5e 100644 --- a/packages/service-library/tests/deferred_tasks/test__base_deferred_handler.py +++ b/packages/service-library/tests/deferred_tasks/test__base_deferred_handler.py @@ -11,7 +11,7 @@ import pytest from models_library.utils.enums import StrAutoEnum -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.deferred_tasks._base_deferred_handler import ( BaseDeferredHandler, DeferredContext, diff --git a/packages/service-library/tests/deferred_tasks/test__redis_task_tracker.py b/packages/service-library/tests/deferred_tasks/test__redis_task_tracker.py index 3ec3bde01ed..0165b71bd7f 100644 --- a/packages/service-library/tests/deferred_tasks/test__redis_task_tracker.py +++ b/packages/service-library/tests/deferred_tasks/test__redis_task_tracker.py @@ -5,7 +5,7 @@ from datetime import timedelta import pytest -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.deferred_tasks._models import TaskUID from servicelib.deferred_tasks._redis_task_tracker import RedisTaskTracker from servicelib.deferred_tasks._task_schedule import TaskScheduleModel, TaskState diff --git a/packages/service-library/tests/deferred_tasks/test__utils.py b/packages/service-library/tests/deferred_tasks/test__utils.py index db3f32554b3..5ba54b6b199 100644 --- a/packages/service-library/tests/deferred_tasks/test__utils.py +++ b/packages/service-library/tests/deferred_tasks/test__utils.py @@ -18,7 +18,7 @@ RabbitRouter, TestRabbitBroker, ) -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.deferred_tasks._utils import stop_retry_for_unintended_errors from settings_library.rabbit import RabbitSettings from tenacity.asyncio import AsyncRetrying diff --git a/packages/service-library/tests/deferred_tasks/test_deferred_tasks.py b/packages/service-library/tests/deferred_tasks/test_deferred_tasks.py index 0ea55a62eee..9738df8296b 100644 --- a/packages/service-library/tests/deferred_tasks/test_deferred_tasks.py +++ b/packages/service-library/tests/deferred_tasks/test_deferred_tasks.py @@ -16,7 +16,7 @@ import psutil import pytest from aiohttp.test_utils import unused_port -from pydantic import NonNegativeFloat, NonNegativeInt +from pydantic.v1 import NonNegativeFloat, NonNegativeInt from pytest_mock import MockerFixture from servicelib import redis as servicelib_redis from servicelib.rabbitmq import RabbitMQClient diff --git a/packages/service-library/tests/fastapi/conftest.py b/packages/service-library/tests/fastapi/conftest.py index 2ee38fbeab2..6986f31a0be 100644 --- a/packages/service-library/tests/fastapi/conftest.py +++ b/packages/service-library/tests/fastapi/conftest.py @@ -11,7 +11,7 @@ from fastapi import APIRouter, FastAPI from fastapi.params import Query from httpx import AsyncClient -from pydantic.types import PositiveFloat +from pydantic.v1.types import PositiveFloat @pytest.fixture diff --git a/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks.py b/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks.py index bd55b44d498..cd02d96b338 100644 --- a/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks.py +++ b/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks.py @@ -18,7 +18,7 @@ from asgi_lifespan import LifespanManager from fastapi import APIRouter, Depends, FastAPI, status from httpx import AsyncClient -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.fastapi import long_running_tasks from servicelib.long_running_tasks._models import TaskGet, TaskId from servicelib.long_running_tasks._task import TaskContext diff --git a/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py b/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py index 9f15184b052..63f890564ce 100644 --- a/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py +++ b/packages/service-library/tests/fastapi/long_running_tasks/test_long_running_tasks_context_manager.py @@ -8,7 +8,7 @@ from asgi_lifespan import LifespanManager from fastapi import APIRouter, Depends, FastAPI, status from httpx import AsyncClient -from pydantic import AnyHttpUrl, PositiveFloat, parse_obj_as +from pydantic.v1 import AnyHttpUrl, PositiveFloat, parse_obj_as from servicelib.fastapi.long_running_tasks._context_manager import _ProgressManager from servicelib.fastapi.long_running_tasks.client import ( Client, diff --git a/packages/service-library/tests/fastapi/test_docker_utils.py b/packages/service-library/tests/fastapi/test_docker_utils.py index 4db0db99bd0..c2efb0688d9 100644 --- a/packages/service-library/tests/fastapi/test_docker_utils.py +++ b/packages/service-library/tests/fastapi/test_docker_utils.py @@ -12,7 +12,7 @@ from faker import Faker from models_library.docker import DockerGenericTag from models_library.progress_bar import ProgressReport -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock import MockerFixture from servicelib import progress_bar from servicelib.docker_utils import pull_image diff --git a/packages/service-library/tests/fastapi/test_exceptions_utils.py b/packages/service-library/tests/fastapi/test_exceptions_utils.py index 845043f3405..ea37f890e2d 100644 --- a/packages/service-library/tests/fastapi/test_exceptions_utils.py +++ b/packages/service-library/tests/fastapi/test_exceptions_utils.py @@ -10,7 +10,7 @@ from fastapi import FastAPI, HTTPException from httpx import AsyncClient from models_library.api_schemas__common.errors import DefaultApiError -from pydantic import parse_raw_as +from pydantic.v1 import parse_raw_as from servicelib.fastapi.exceptions_utils import ( handle_errors_as_500, http_exception_as_json_response, diff --git a/packages/service-library/tests/fastapi/test_http_client_thin.py b/packages/service-library/tests/fastapi/test_http_client_thin.py index f98de720c33..cb11ae0b056 100644 --- a/packages/service-library/tests/fastapi/test_http_client_thin.py +++ b/packages/service-library/tests/fastapi/test_http_client_thin.py @@ -15,7 +15,7 @@ TransportError, codes, ) -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from respx import MockRouter from servicelib.fastapi.http_client_thin import ( BaseThinClient, diff --git a/packages/service-library/tests/fastapi/test_rabbitmq.py b/packages/service-library/tests/fastapi/test_rabbitmq.py index 9c94cfa0766..2d2f7642af0 100644 --- a/packages/service-library/tests/fastapi/test_rabbitmq.py +++ b/packages/service-library/tests/fastapi/test_rabbitmq.py @@ -10,7 +10,7 @@ from faker import Faker from fastapi import FastAPI from models_library.rabbitmq_messages import LoggerRabbitMessage, RabbitMessageBase -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/packages/service-library/tests/rabbitmq/test_rabbitmq_connection.py b/packages/service-library/tests/rabbitmq/test_rabbitmq_connection.py index 3019b07d6ab..b62911d9030 100644 --- a/packages/service-library/tests/rabbitmq/test_rabbitmq_connection.py +++ b/packages/service-library/tests/rabbitmq/test_rabbitmq_connection.py @@ -13,7 +13,7 @@ import pytest import requests from faker import Faker -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl from servicelib.rabbitmq import RabbitMQClient from settings_library.rabbit import RabbitSettings from tenacity import retry, retry_if_exception_type diff --git a/packages/service-library/tests/rabbitmq/test_rabbitmq_rpc.py b/packages/service-library/tests/rabbitmq/test_rabbitmq_rpc.py index e192afc611e..0556321a1e5 100644 --- a/packages/service-library/tests/rabbitmq/test_rabbitmq_rpc.py +++ b/packages/service-library/tests/rabbitmq/test_rabbitmq_rpc.py @@ -7,7 +7,7 @@ import pytest from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import NonNegativeInt, ValidationError +from pydantic.v1 import NonNegativeInt, ValidationError from servicelib.rabbitmq import ( RabbitMQRPCClient, RemoteMethodNotRegisteredError, diff --git a/packages/service-library/tests/rabbitmq/test_rabbitmq_utils.py b/packages/service-library/tests/rabbitmq/test_rabbitmq_utils.py index b07f8e8cb8d..ef9e1ad73fc 100644 --- a/packages/service-library/tests/rabbitmq/test_rabbitmq_utils.py +++ b/packages/service-library/tests/rabbitmq/test_rabbitmq_utils.py @@ -1,5 +1,5 @@ import pytest -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.rabbitmq import RPCNamespace diff --git a/packages/service-library/tests/test_archiving_utils.py b/packages/service-library/tests/test_archiving_utils.py index f6886ea509a..457b3340fbf 100644 --- a/packages/service-library/tests/test_archiving_utils.py +++ b/packages/service-library/tests/test_archiving_utils.py @@ -18,7 +18,7 @@ import pytest from faker import Faker -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_benchmark.plugin import BenchmarkFixture from servicelib import archiving_utils from servicelib.archiving_utils import ArchiveError, archive_dir, unarchive_dir diff --git a/packages/service-library/tests/test_exception_utils.py b/packages/service-library/tests/test_exception_utils.py index 299855e8241..e1cf7a0bd5e 100644 --- a/packages/service-library/tests/test_exception_utils.py +++ b/packages/service-library/tests/test_exception_utils.py @@ -3,7 +3,7 @@ from typing import Final import pytest -from pydantic import PositiveFloat, PositiveInt +from pydantic.v1 import PositiveFloat, PositiveInt from servicelib.exception_utils import DelayedExceptionHandler TOLERANCE: Final[PositiveFloat] = 0.1 diff --git a/packages/service-library/tests/test_progress_bar.py b/packages/service-library/tests/test_progress_bar.py index 6c1b7a2756b..ec51ae80a61 100644 --- a/packages/service-library/tests/test_progress_bar.py +++ b/packages/service-library/tests/test_progress_bar.py @@ -10,7 +10,7 @@ import pytest from faker import Faker from models_library.progress_bar import ProgressReport, ProgressStructuredMessage -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_mock import MockerFixture from servicelib.progress_bar import ( _INITIAL_VALUE, diff --git a/packages/service-library/tests/test_utils_secrets.py b/packages/service-library/tests/test_utils_secrets.py index 37e31f4c076..6c929e2f72b 100644 --- a/packages/service-library/tests/test_utils_secrets.py +++ b/packages/service-library/tests/test_utils_secrets.py @@ -8,7 +8,7 @@ from uuid import uuid4 import pytest -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.utils_secrets import ( _MIN_SECRET_NUM_BYTES, _PLACEHOLDER, diff --git a/packages/settings-library/requirements/_base.txt b/packages/settings-library/requirements/_base.txt index 900c4fea2aa..68b4e5fd9c1 100644 --- a/packages/settings-library/requirements/_base.txt +++ b/packages/settings-library/requirements/_base.txt @@ -1,13 +1,17 @@ +annotated-types==0.7.0 + # via pydantic click==8.1.7 # via typer markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -r requirements/_base.in +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich rich==13.7.1 @@ -21,4 +25,5 @@ typer==0.12.4 typing-extensions==4.12.2 # via # pydantic + # pydantic-core # typer diff --git a/packages/settings-library/requirements/_test.txt b/packages/settings-library/requirements/_test.txt index 1ca7d43dd3c..9a1422f4bc4 100644 --- a/packages/settings-library/requirements/_test.txt +++ b/packages/settings-library/requirements/_test.txt @@ -2,8 +2,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in iniconfig==2.0.0 @@ -39,7 +37,3 @@ six==1.16.0 # via python-dateutil termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest diff --git a/packages/settings-library/requirements/_tools.txt b/packages/settings-library/requirements/_tools.txt index a75c5397d80..d14257822b0 100644 --- a/packages/settings-library/requirements/_tools.txt +++ b/packages/settings-library/requirements/_tools.txt @@ -67,21 +67,11 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/settings-library/src/settings_library/application.py b/packages/settings-library/src/settings_library/application.py index e7d588c7023..deeaa9c3c0e 100644 --- a/packages/settings-library/src/settings_library/application.py +++ b/packages/settings-library/src/settings_library/application.py @@ -1,4 +1,4 @@ -from pydantic import Field, PositiveInt +from pydantic.v1 import Field, PositiveInt from .base import BaseCustomSettings from .basic_types import BuildTargetEnum diff --git a/packages/settings-library/src/settings_library/aws_s3_cli.py b/packages/settings-library/src/settings_library/aws_s3_cli.py index 7fd3b271b10..d6ddab8971c 100644 --- a/packages/settings-library/src/settings_library/aws_s3_cli.py +++ b/packages/settings-library/src/settings_library/aws_s3_cli.py @@ -1,4 +1,4 @@ -from pydantic import Field +from pydantic.v1 import Field from .base import BaseCustomSettings from .s3 import S3Settings diff --git a/packages/settings-library/src/settings_library/base.py b/packages/settings-library/src/settings_library/base.py index 296b453e26c..21ee1f3f8ab 100644 --- a/packages/settings-library/src/settings_library/base.py +++ b/packages/settings-library/src/settings_library/base.py @@ -3,7 +3,7 @@ from functools import cached_property from typing import Final, get_args, get_origin -from pydantic import ( +from pydantic.v1 import ( BaseConfig, BaseSettings, ConfigError, @@ -11,9 +11,9 @@ ValidationError, validator, ) -from pydantic.error_wrappers import ErrorList, ErrorWrapper -from pydantic.fields import ModelField, Undefined -from pydantic.typing import is_literal_type +from pydantic.v1.error_wrappers import ErrorList, ErrorWrapper +from pydantic.v1.fields import ModelField, Undefined +from pydantic.v1.typing import is_literal_type _logger = logging.getLogger(__name__) diff --git a/packages/settings-library/src/settings_library/basic_types.py b/packages/settings-library/src/settings_library/basic_types.py index 277832669e1..7006a0218de 100644 --- a/packages/settings-library/src/settings_library/basic_types.py +++ b/packages/settings-library/src/settings_library/basic_types.py @@ -6,7 +6,7 @@ import re from enum import Enum -from pydantic import ConstrainedInt, ConstrainedStr +from pydantic.v1 import ConstrainedInt, ConstrainedStr # port number range diff --git a/packages/settings-library/src/settings_library/catalog.py b/packages/settings-library/src/settings_library/catalog.py index e5f44f29269..470a0745b57 100644 --- a/packages/settings-library/src/settings_library/catalog.py +++ b/packages/settings-library/src/settings_library/catalog.py @@ -1,6 +1,6 @@ from functools import cached_property -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.utils_service import ( diff --git a/packages/settings-library/src/settings_library/comp_services.py b/packages/settings-library/src/settings_library/comp_services.py index e3cb628f7b7..c9a396a38e0 100644 --- a/packages/settings-library/src/settings_library/comp_services.py +++ b/packages/settings-library/src/settings_library/comp_services.py @@ -1,5 +1,5 @@ -from pydantic import ByteSize, NonNegativeInt, validator -from pydantic.tools import parse_raw_as +from pydantic.v1 import ByteSize, NonNegativeInt, validator +from pydantic.v1.tools import parse_raw_as from settings_library.base import BaseCustomSettings from ._constants import GB diff --git a/packages/settings-library/src/settings_library/director_v2.py b/packages/settings-library/src/settings_library/director_v2.py index 78c5edd78c6..b7e33527619 100644 --- a/packages/settings-library/src/settings_library/director_v2.py +++ b/packages/settings-library/src/settings_library/director_v2.py @@ -1,6 +1,6 @@ from functools import cached_property -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.utils_service import ( diff --git a/packages/settings-library/src/settings_library/docker_registry.py b/packages/settings-library/src/settings_library/docker_registry.py index bb365cb9785..12d5ade83f7 100644 --- a/packages/settings-library/src/settings_library/docker_registry.py +++ b/packages/settings-library/src/settings_library/docker_registry.py @@ -1,7 +1,7 @@ from functools import cached_property from typing import Any, ClassVar -from pydantic import Field, SecretStr, validator +from pydantic.v1 import Field, SecretStr, validator from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/ec2.py b/packages/settings-library/src/settings_library/ec2.py index 2cd7cf0b9a6..08e1dda15a7 100644 --- a/packages/settings-library/src/settings_library/ec2.py +++ b/packages/settings-library/src/settings_library/ec2.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import Field +from pydantic.v1 import Field from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/efs.py b/packages/settings-library/src/settings_library/efs.py index d09b8abb20f..e3f0019e21e 100644 --- a/packages/settings-library/src/settings_library/efs.py +++ b/packages/settings-library/src/settings_library/efs.py @@ -1,6 +1,6 @@ from pathlib import Path -from pydantic import Field +from pydantic.v1 import Field from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/email.py b/packages/settings-library/src/settings_library/email.py index b15bf209405..16fe8c5dd4f 100644 --- a/packages/settings-library/src/settings_library/email.py +++ b/packages/settings-library/src/settings_library/email.py @@ -1,8 +1,8 @@ from enum import Enum -from pydantic import root_validator -from pydantic.fields import Field -from pydantic.types import SecretStr +from pydantic.v1 import root_validator +from pydantic.v1.fields import Field +from pydantic.v1.types import SecretStr from .base import BaseCustomSettings from .basic_types import PortInt diff --git a/packages/settings-library/src/settings_library/http_client_request.py b/packages/settings-library/src/settings_library/http_client_request.py index fcf7f2ff97f..d4e36c33fb6 100644 --- a/packages/settings-library/src/settings_library/http_client_request.py +++ b/packages/settings-library/src/settings_library/http_client_request.py @@ -1,4 +1,4 @@ -from pydantic import Field +from pydantic.v1 import Field from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/node_ports.py b/packages/settings-library/src/settings_library/node_ports.py index 2a5d12f1bd7..c94de22313e 100644 --- a/packages/settings-library/src/settings_library/node_ports.py +++ b/packages/settings-library/src/settings_library/node_ports.py @@ -1,7 +1,7 @@ from datetime import timedelta from typing import Final -from pydantic import Field, NonNegativeInt, PositiveInt, SecretStr, root_validator +from pydantic.v1 import Field, NonNegativeInt, PositiveInt, SecretStr, root_validator from .base import BaseCustomSettings from .postgres import PostgresSettings diff --git a/packages/settings-library/src/settings_library/postgres.py b/packages/settings-library/src/settings_library/postgres.py index f8335bbeed2..3f3c96492e9 100644 --- a/packages/settings-library/src/settings_library/postgres.py +++ b/packages/settings-library/src/settings_library/postgres.py @@ -2,7 +2,7 @@ from functools import cached_property from typing import Any, ClassVar -from pydantic import Field, PostgresDsn, SecretStr, validator +from pydantic.v1 import Field, PostgresDsn, SecretStr, validator from .base import BaseCustomSettings from .basic_types import PortInt diff --git a/packages/settings-library/src/settings_library/prometheus.py b/packages/settings-library/src/settings_library/prometheus.py index 065c7e930f0..99a8957215b 100644 --- a/packages/settings-library/src/settings_library/prometheus.py +++ b/packages/settings-library/src/settings_library/prometheus.py @@ -1,6 +1,6 @@ from functools import cached_property -from pydantic import AnyUrl, SecretStr +from pydantic.v1 import AnyUrl, SecretStr from settings_library.base import BaseCustomSettings from settings_library.utils_service import MixinServiceSettings diff --git a/packages/settings-library/src/settings_library/r_clone.py b/packages/settings-library/src/settings_library/r_clone.py index ff04d509bef..9cc0da7a82c 100644 --- a/packages/settings-library/src/settings_library/r_clone.py +++ b/packages/settings-library/src/settings_library/r_clone.py @@ -1,6 +1,6 @@ from enum import StrEnum -from pydantic import Field, NonNegativeInt +from pydantic.v1 import Field, NonNegativeInt from .base import BaseCustomSettings from .s3 import S3Settings diff --git a/packages/settings-library/src/settings_library/rabbit.py b/packages/settings-library/src/settings_library/rabbit.py index 19c6af0b656..c731ad7d3c3 100644 --- a/packages/settings-library/src/settings_library/rabbit.py +++ b/packages/settings-library/src/settings_library/rabbit.py @@ -1,8 +1,8 @@ from functools import cached_property -from pydantic import parse_obj_as -from pydantic.networks import AnyUrl -from pydantic.types import SecretStr +from pydantic.v1 import parse_obj_as +from pydantic.v1.networks import AnyUrl +from pydantic.v1.types import SecretStr from .base import BaseCustomSettings from .basic_types import PortInt diff --git a/packages/settings-library/src/settings_library/redis.py b/packages/settings-library/src/settings_library/redis.py index ecccad69c10..e4162d3b433 100644 --- a/packages/settings-library/src/settings_library/redis.py +++ b/packages/settings-library/src/settings_library/redis.py @@ -1,8 +1,8 @@ from enum import Enum -from pydantic import parse_obj_as -from pydantic.networks import RedisDsn -from pydantic.types import SecretStr +from pydantic.v1 import parse_obj_as +from pydantic.v1.networks import RedisDsn +from pydantic.v1.types import SecretStr from .base import BaseCustomSettings from .basic_types import PortInt diff --git a/packages/settings-library/src/settings_library/resource_usage_tracker.py b/packages/settings-library/src/settings_library/resource_usage_tracker.py index dc696fab76c..f52e4b94136 100644 --- a/packages/settings-library/src/settings_library/resource_usage_tracker.py +++ b/packages/settings-library/src/settings_library/resource_usage_tracker.py @@ -1,7 +1,7 @@ from datetime import timedelta from functools import cached_property -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.utils_service import ( diff --git a/packages/settings-library/src/settings_library/s3.py b/packages/settings-library/src/settings_library/s3.py index cef1bf11be5..de7d3a700e5 100644 --- a/packages/settings-library/src/settings_library/s3.py +++ b/packages/settings-library/src/settings_library/s3.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import AnyHttpUrl, Field +from pydantic.v1 import AnyHttpUrl, Field from .base import BaseCustomSettings from .basic_types import IDStr diff --git a/packages/settings-library/src/settings_library/ssm.py b/packages/settings-library/src/settings_library/ssm.py index 32b965fa123..9dbd36f7dfb 100644 --- a/packages/settings-library/src/settings_library/ssm.py +++ b/packages/settings-library/src/settings_library/ssm.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import AnyHttpUrl, Field, SecretStr +from pydantic.v1 import AnyHttpUrl, Field, SecretStr from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/storage.py b/packages/settings-library/src/settings_library/storage.py index 92ec0301257..19ab5353984 100644 --- a/packages/settings-library/src/settings_library/storage.py +++ b/packages/settings-library/src/settings_library/storage.py @@ -1,6 +1,6 @@ from functools import cached_property -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.utils_service import ( diff --git a/packages/settings-library/src/settings_library/tracing.py b/packages/settings-library/src/settings_library/tracing.py index 28a11cbbf6a..437f024359a 100644 --- a/packages/settings-library/src/settings_library/tracing.py +++ b/packages/settings-library/src/settings_library/tracing.py @@ -1,4 +1,4 @@ -from pydantic import AnyUrl, Field, parse_obj_as +from pydantic.v1 import AnyUrl, Field, parse_obj_as from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/twilio.py b/packages/settings-library/src/settings_library/twilio.py index eb4ec0c707a..08df79d91d6 100644 --- a/packages/settings-library/src/settings_library/twilio.py +++ b/packages/settings-library/src/settings_library/twilio.py @@ -9,7 +9,7 @@ import re from re import Pattern -from pydantic import ConstrainedStr, Field, parse_obj_as +from pydantic.v1 import ConstrainedStr, Field, parse_obj_as from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/utils_cli.py b/packages/settings-library/src/settings_library/utils_cli.py index 79d0e1ac145..4785dbb1598 100644 --- a/packages/settings-library/src/settings_library/utils_cli.py +++ b/packages/settings-library/src/settings_library/utils_cli.py @@ -6,8 +6,8 @@ import rich import typer -from pydantic import ValidationError -from pydantic.env_settings import BaseSettings +from pydantic.v1 import ValidationError +from pydantic.v1.env_settings import BaseSettings from ._constants import HEADER_STR from .base import BaseCustomSettings diff --git a/packages/settings-library/src/settings_library/utils_encoders.py b/packages/settings-library/src/settings_library/utils_encoders.py index 71ea960bf78..d65ed4cb81a 100644 --- a/packages/settings-library/src/settings_library/utils_encoders.py +++ b/packages/settings-library/src/settings_library/utils_encoders.py @@ -1,7 +1,7 @@ from functools import partial -from pydantic import BaseModel, SecretStr -from pydantic.json import custom_pydantic_encoder +from pydantic.v1 import BaseModel, SecretStr +from pydantic.v1.json import custom_pydantic_encoder def create_json_encoder_wo_secrets(model_cls: type[BaseModel]): diff --git a/packages/settings-library/src/settings_library/utils_service.py b/packages/settings-library/src/settings_library/utils_service.py index e7bb66057c5..6c81e76e0d3 100644 --- a/packages/settings-library/src/settings_library/utils_service.py +++ b/packages/settings-library/src/settings_library/utils_service.py @@ -4,9 +4,9 @@ """ from enum import Enum, auto -from pydantic import parse_obj_as -from pydantic.networks import AnyUrl -from pydantic.types import SecretStr +from pydantic.v1 import parse_obj_as +from pydantic.v1.networks import AnyUrl +from pydantic.v1.types import SecretStr from .basic_types import PortInt diff --git a/packages/settings-library/src/settings_library/webserver.py b/packages/settings-library/src/settings_library/webserver.py index 4da2c41d699..5b0572af100 100644 --- a/packages/settings-library/src/settings_library/webserver.py +++ b/packages/settings-library/src/settings_library/webserver.py @@ -1,6 +1,6 @@ from functools import cached_property -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from .base import BaseCustomSettings from .basic_types import PortInt, VersionTag diff --git a/packages/settings-library/tests/conftest.py b/packages/settings-library/tests/conftest.py index 725f19c534a..9dd448cc472 100644 --- a/packages/settings-library/tests/conftest.py +++ b/packages/settings-library/tests/conftest.py @@ -8,7 +8,7 @@ import pytest import settings_library from dotenv import dotenv_values -from pydantic.fields import Field +from pydantic.v1.fields import Field from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt diff --git a/packages/settings-library/tests/test__models_examples.py b/packages/settings-library/tests/test__models_examples.py index c60a6c08261..26ac71ba372 100644 --- a/packages/settings-library/tests/test__models_examples.py +++ b/packages/settings-library/tests/test__models_examples.py @@ -3,7 +3,7 @@ import pytest import settings_library -from pydantic import BaseModel +from pydantic.v1 import BaseModel from pytest_simcore.pydantic_models import walk_model_examples_in_package diff --git a/packages/settings-library/tests/test__pydantic_settings.py b/packages/settings-library/tests/test__pydantic_settings.py index 8cf3eadc30f..3cc8c9f6bd2 100644 --- a/packages/settings-library/tests/test__pydantic_settings.py +++ b/packages/settings-library/tests/test__pydantic_settings.py @@ -13,8 +13,8 @@ """ -from pydantic import BaseSettings, validator -from pydantic.fields import ModelField, Undefined +from pydantic.v1 import BaseSettings, validator +from pydantic.v1.fields import ModelField, Undefined def assert_field_specs( diff --git a/packages/settings-library/tests/test_base.py b/packages/settings-library/tests/test_base.py index 7cbd9fa8773..8b3cc7a5914 100644 --- a/packages/settings-library/tests/test_base.py +++ b/packages/settings-library/tests/test_base.py @@ -10,8 +10,8 @@ import pytest import settings_library.base -from pydantic import BaseModel, BaseSettings, ValidationError -from pydantic.fields import Field +from pydantic.v1 import BaseModel, BaseSettings, ValidationError +from pydantic.v1.fields import Field from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_envfile from settings_library.base import ( diff --git a/packages/settings-library/tests/test_base_w_postgres.py b/packages/settings-library/tests/test_base_w_postgres.py index d54d40bf925..378656e617e 100644 --- a/packages/settings-library/tests/test_base_w_postgres.py +++ b/packages/settings-library/tests/test_base_w_postgres.py @@ -6,7 +6,7 @@ from collections.abc import Callable import pytest -from pydantic import Field, ValidationError +from pydantic.v1 import Field, ValidationError from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_envfile from settings_library.base import BaseCustomSettings, DefaultFromEnvFactoryError from settings_library.basic_types import PortInt diff --git a/packages/settings-library/tests/test_email.py b/packages/settings-library/tests/test_email.py index 1cd3978503e..2d37ed14c95 100644 --- a/packages/settings-library/tests/test_email.py +++ b/packages/settings-library/tests/test_email.py @@ -6,7 +6,7 @@ from typing import Any import pytest -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.monkeypatch_envs import delenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.email import EmailProtocol, SMTPSettings diff --git a/packages/settings-library/tests/test_utils_cli.py b/packages/settings-library/tests/test_utils_cli.py index 611ccf2509f..68ec9986d81 100644 --- a/packages/settings-library/tests/test_utils_cli.py +++ b/packages/settings-library/tests/test_utils_cli.py @@ -11,7 +11,7 @@ import pytest import typer from dotenv import dotenv_values -from pydantic import Field, SecretStr +from pydantic.v1 import Field, SecretStr from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_envfile from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.base import BaseCustomSettings diff --git a/packages/settings-library/tests/test_utils_logging.py b/packages/settings-library/tests/test_utils_logging.py index 9054b391333..de9f1813387 100644 --- a/packages/settings-library/tests/test_utils_logging.py +++ b/packages/settings-library/tests/test_utils_logging.py @@ -1,6 +1,6 @@ import logging -from pydantic import Field, validator +from pydantic.v1 import Field, validator from settings_library.base import BaseCustomSettings from settings_library.basic_types import BootMode from settings_library.utils_logging import MixinLoggingSettings diff --git a/packages/settings-library/tests/test_utils_service.py b/packages/settings-library/tests/test_utils_service.py index a3638f9b31e..f1f65836a72 100644 --- a/packages/settings-library/tests/test_utils_service.py +++ b/packages/settings-library/tests/test_utils_service.py @@ -5,8 +5,8 @@ from functools import cached_property import pytest -from pydantic import AnyHttpUrl, parse_obj_as -from pydantic.types import SecretStr +from pydantic.v1 import AnyHttpUrl, parse_obj_as +from pydantic.v1.types import SecretStr from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.catalog import CatalogSettings diff --git a/packages/simcore-sdk/requirements/_base.txt b/packages/simcore-sdk/requirements/_base.txt index 14712a97fc2..7b57a3b873f 100644 --- a/packages/simcore-sdk/requirements/_base.txt +++ b/packages/simcore-sdk/requirements/_base.txt @@ -31,6 +31,8 @@ aiosignal==1.3.1 # via aiohttp alembic==1.13.2 # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.4.0 # via # fast-depends @@ -44,10 +46,8 @@ arrow==1.3.0 # -r requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 # via - # aiohttp # aiopg # asyncpg - # redis asyncpg==0.29.0 # via sqlalchemy attrs==24.2.0 @@ -61,8 +61,6 @@ dnspython==2.6.1 # via email-validator email-validator==2.2.0 # via pydantic -exceptiongroup==1.2.2 - # via anyio fast-depends==2.4.8 # via faststream faststream==0.5.18 @@ -129,7 +127,7 @@ psycopg2-binary==2.9.9 # via # aiopg # sqlalchemy -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -146,6 +144,8 @@ pydantic==1.10.17 # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/_base.in # fast-depends +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.7.2 @@ -225,12 +225,12 @@ typing-extensions==4.12.2 # via # aiodebug # alembic - # anyio # faststream # flexcache # flexparser # pint # pydantic + # pydantic-core # typer yarl==1.9.4 # via diff --git a/packages/simcore-sdk/requirements/_test.txt b/packages/simcore-sdk/requirements/_test.txt index db22f856cee..f1171067484 100644 --- a/packages/simcore-sdk/requirements/_test.txt +++ b/packages/simcore-sdk/requirements/_test.txt @@ -28,12 +28,12 @@ alembic==1.13.2 # via # -c requirements/_base.txt # -r requirements/_test.in -antlr4-python3-runtime==4.13.2 - # via moto -async-timeout==4.0.3 +annotated-types==0.7.0 # via # -c requirements/_base.txt - # aiohttp + # pydantic +antlr4-python3-runtime==4.13.2 + # via moto attrs==24.2.0 # via # -c requirements/_base.txt @@ -88,10 +88,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.2 - # via - # -c requirements/_base.txt - # pytest execnet==2.1.1 # via pytest-xdist faker==27.0.0 @@ -207,11 +203,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pytest==8.3.2 @@ -304,11 +304,6 @@ sympy==1.13.2 # via cfn-lint termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiobotocore==2.13.2 # via -r requirements/_test.in types-aiobotocore-s3==2.13.2 @@ -327,6 +322,7 @@ typing-extensions==4.12.2 # cfn-lint # mypy # pydantic + # pydantic-core # sqlalchemy2-stubs # types-aiobotocore # types-aiobotocore-s3 diff --git a/packages/simcore-sdk/requirements/_tools.txt b/packages/simcore-sdk/requirements/_tools.txt index 8ca413e037f..5a573bd4848 100644 --- a/packages/simcore-sdk/requirements/_tools.txt +++ b/packages/simcore-sdk/requirements/_tools.txt @@ -76,22 +76,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py b/packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py index 7b8b810ba38..c811b5e76b7 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_data/data_manager.py @@ -6,7 +6,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, StorageFileID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.archiving_utils import unarchive_dir from servicelib.logging_utils import log_context from servicelib.progress_bar import ProgressBarData diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/_filemanager.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/_filemanager.py index 7b5467c2851..51ef812e11e 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/_filemanager.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/_filemanager.py @@ -14,7 +14,7 @@ from models_library.projects_nodes_io import LocationID, LocationName from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from settings_library.node_ports import NodePortsSettings from tenacity.asyncio import AsyncRetrying from tenacity.before_sleep import before_sleep_log diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli.py index 35d1d7c71f8..d51d854af55 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli.py @@ -8,8 +8,8 @@ from aiocache import cached # type: ignore[import-untyped] from models_library.basic_types import IDStr -from pydantic import AnyUrl, ByteSize -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import AnyUrl, ByteSize +from pydantic.v1.errors import PydanticErrorMixin from servicelib.progress_bar import ProgressBarData from servicelib.utils import logged_gather from settings_library.aws_s3_cli import AwsS3CliSettings diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli_utils.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli_utils.py index 5cfbb536583..aa823cc80fd 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli_utils.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/aws_s3_cli_utils.py @@ -1,7 +1,7 @@ import logging import re -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.logging_utils import log_catch from servicelib.progress_bar import ProgressBarData diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/file_io_utils.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/file_io_utils.py index 695b710c8f8..b95501f7ff9 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/file_io_utils.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/file_io_utils.py @@ -20,7 +20,7 @@ from aiohttp.typedefs import LooseHeaders from models_library.api_schemas_storage import ETag, FileUploadSchema, UploadedPart from models_library.basic_types import IDStr, SHA256Str -from pydantic import AnyUrl, NonNegativeInt +from pydantic.v1 import AnyUrl, NonNegativeInt from servicelib.aiohttp import status from servicelib.logging_utils import log_catch from servicelib.progress_bar import ProgressBarData diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/filemanager.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/filemanager.py index 6a5609c7eb5..25a11bba2d1 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/filemanager.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/filemanager.py @@ -15,7 +15,7 @@ from models_library.basic_types import IDStr, SHA256Str from models_library.projects_nodes_io import LocationID, LocationName, StorageFileID from models_library.users import UserID -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.file_utils import create_sha256_checksum from servicelib.progress_bar import ProgressBarData from settings_library.aws_s3_cli import AwsS3CliSettings diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone.py index 18e15139493..a7fcaafd5d9 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone.py @@ -11,8 +11,8 @@ from aiocache import cached # type: ignore[import-untyped] from aiofiles import tempfile from models_library.basic_types import IDStr -from pydantic import AnyUrl, BaseModel, ByteSize -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import AnyUrl, BaseModel, ByteSize +from pydantic.v1.errors import PydanticErrorMixin from servicelib.progress_bar import ProgressBarData from servicelib.utils import logged_gather from settings_library.r_clone import RCloneSettings diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone_utils.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone_utils.py index f539e451026..5de79154101 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone_utils.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/r_clone_utils.py @@ -3,7 +3,7 @@ from typing import Union from models_library.utils.change_case import snake_to_camel -from pydantic import BaseModel, ByteSize, Field, parse_raw_as +from pydantic.v1 import BaseModel, ByteSize, Field, parse_raw_as from servicelib.logging_utils import log_catch from servicelib.progress_bar import ProgressBarData diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/storage_client.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/storage_client.py index c249cbcf830..322b5e5f5a8 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_common/storage_client.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_common/storage_client.py @@ -21,8 +21,8 @@ from models_library.generics import Envelope from models_library.projects_nodes_io import LocationID, StorageFileID from models_library.users import UserID -from pydantic import ByteSize -from pydantic.networks import AnyUrl +from pydantic.v1 import ByteSize +from pydantic.v1.networks import AnyUrl from servicelib.aiohttp import status from tenacity import RetryCallState from tenacity.asyncio import AsyncRetrying diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/links.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/links.py index d8eb1d99349..36df0f9b34b 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/links.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/links.py @@ -4,7 +4,15 @@ from models_library.basic_regex import UUID_RE from models_library.projects_nodes_io import BaseFileLink, DownloadLink from models_library.projects_nodes_io import PortLink as BasePortLink -from pydantic import AnyUrl, Extra, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic.v1 import ( + AnyUrl, + Extra, + Field, + StrictBool, + StrictFloat, + StrictInt, + StrictStr, +) class PortLink(BasePortLink): diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py index 8c78e28a066..c48c8f76756 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py @@ -9,8 +9,8 @@ from models_library.projects_nodes_io import NodeIDStr from models_library.services_types import ServicePortKey from models_library.users import UserID -from pydantic import BaseModel, Field, ValidationError -from pydantic.error_wrappers import flatten_errors +from pydantic.v1 import BaseModel, Field, ValidationError +from pydantic.v1.error_wrappers import flatten_errors from servicelib.progress_bar import ProgressBarData from servicelib.utils import logged_gather from settings_library.aws_s3_cli import AwsS3CliSettings diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port.py index 2338563dcdb..98dc3669907 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port.py @@ -10,8 +10,8 @@ from models_library.basic_types import IDStr from models_library.services_io import BaseServiceIOModel from models_library.services_types import ServicePortKey -from pydantic import AnyUrl, Field, PrivateAttr, ValidationError, validator -from pydantic.tools import parse_obj_as +from pydantic.v1 import AnyUrl, Field, PrivateAttr, ValidationError, validator +from pydantic.v1.tools import parse_obj_as from servicelib.progress_bar import ProgressBarData from ..node_ports_common.exceptions import ( diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_utils.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_utils.py index eb45483f98c..a9a6bbd82ff 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_utils.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_utils.py @@ -8,8 +8,8 @@ from models_library.basic_types import IDStr, SHA256Str from models_library.services_types import FileName, ServicePortKey from models_library.users import UserID -from pydantic import AnyUrl, ByteSize -from pydantic.tools import parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize +from pydantic.v1.tools import parse_obj_as from servicelib.progress_bar import ProgressBarData from settings_library.aws_s3_cli import AwsS3CliSettings from settings_library.r_clone import RCloneSettings diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py index c2ebb56986d..00448fd9e3f 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/port_validation.py @@ -1,6 +1,6 @@ import logging import re -from typing import Any, Dict, Optional, Tuple +from typing import Any from models_library.projects_nodes import UnitStr from models_library.utils.json_schema import ( @@ -9,9 +9,9 @@ jsonschema_validate_schema, ) from pint import PintError, UnitRegistry -from pydantic.errors import PydanticValueError +from pydantic.v1.errors import PydanticValueError -JsonSchemaDict = Dict[str, Any] +JsonSchemaDict = dict[str, Any] log = logging.getLogger(__name__) @@ -72,7 +72,7 @@ def _validate_port_value(value, content_schema: JsonSchemaDict): def _validate_port_unit( value, unit, content_schema: JsonSchemaDict, *, ureg: UnitRegistry -) -> Tuple[Any, Optional[UnitStr]]: +) -> tuple[Any, UnitStr | None]: """ - Checks valid 'value' against content_schema - Converts 'value' with 'unit' to unit expected in content_schema @@ -101,7 +101,7 @@ def _validate_port_unit( def validate_port_content( port_key, value: Any, - unit: Optional[UnitStr], + unit: UnitStr | None, content_schema: JsonSchemaDict, ): """A port content is all datasets injected to a given port. Currently only diff --git a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/ports_mapping.py b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/ports_mapping.py index 2855e8a253e..23408a0b6ce 100644 --- a/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/ports_mapping.py +++ b/packages/simcore-sdk/src/simcore_sdk/node_ports_v2/ports_mapping.py @@ -1,7 +1,7 @@ from collections.abc import ItemsView, Iterator, KeysView, ValuesView from models_library.services_types import ServicePortKey -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..node_ports_common.exceptions import UnboundPortError from .port import Port diff --git a/packages/simcore-sdk/tests/integration/conftest.py b/packages/simcore-sdk/tests/integration/conftest.py index d5f6cd7227a..d464e00e01f 100644 --- a/packages/simcore-sdk/tests/integration/conftest.py +++ b/packages/simcore-sdk/tests/integration/conftest.py @@ -17,7 +17,7 @@ from models_library.generics import Envelope from models_library.projects_nodes_io import LocationID, NodeIDStr, SimcoreS3FileID from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.faker_factories import random_project, random_user from settings_library.aws_s3_cli import AwsS3CliSettings from settings_library.r_clone import RCloneSettings, S3Provider diff --git a/packages/simcore-sdk/tests/integration/test_node_data_data_manager.py b/packages/simcore-sdk/tests/integration/test_node_data_data_manager.py index ca7a81e6c17..93e103dccab 100644 --- a/packages/simcore-sdk/tests/integration/test_node_data_data_manager.py +++ b/packages/simcore-sdk/tests/integration/test_node_data_data_manager.py @@ -17,7 +17,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimcoreS3FileID from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.progress_bar import ProgressBarData from settings_library.aws_s3_cli import AwsS3CliSettings from settings_library.r_clone import RCloneSettings diff --git a/packages/simcore-sdk/tests/integration/test_node_ports_common_aws_s3_cli.py b/packages/simcore-sdk/tests/integration/test_node_ports_common_aws_s3_cli.py index b20f280e291..e32dc367c47 100644 --- a/packages/simcore-sdk/tests/integration/test_node_ports_common_aws_s3_cli.py +++ b/packages/simcore-sdk/tests/integration/test_node_ports_common_aws_s3_cli.py @@ -15,7 +15,7 @@ import pytest from faker import Faker from models_library.progress_bar import ProgressReport -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.file_utils import remove_directory from servicelib.progress_bar import ProgressBarData from servicelib.utils import logged_gather diff --git a/packages/simcore-sdk/tests/integration/test_node_ports_common_filemanager.py b/packages/simcore-sdk/tests/integration/test_node_ports_common_filemanager.py index 9cd1ce32de4..eaaeb68db91 100644 --- a/packages/simcore-sdk/tests/integration/test_node_ports_common_filemanager.py +++ b/packages/simcore-sdk/tests/integration/test_node_ports_common_filemanager.py @@ -19,7 +19,7 @@ SimcoreS3FileID, ) from models_library.users import UserID -from pydantic import BaseModel, ByteSize, parse_obj_as +from pydantic.v1 import BaseModel, ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.parametrizations import byte_size_ids from servicelib.progress_bar import ProgressBarData diff --git a/packages/simcore-sdk/tests/integration/test_node_ports_common_r_clone.py b/packages/simcore-sdk/tests/integration/test_node_ports_common_r_clone.py index 64e7d34ef1f..800f9c394d9 100644 --- a/packages/simcore-sdk/tests/integration/test_node_ports_common_r_clone.py +++ b/packages/simcore-sdk/tests/integration/test_node_ports_common_r_clone.py @@ -16,7 +16,7 @@ import pytest from faker import Faker from models_library.progress_bar import ProgressReport -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.file_utils import remove_directory from servicelib.progress_bar import ProgressBarData from servicelib.utils import logged_gather diff --git a/packages/simcore-sdk/tests/unit/test_node_ports_common_file_io_utils.py b/packages/simcore-sdk/tests/unit/test_node_ports_common_file_io_utils.py index 2d32d345ffa..4a302d3a9ac 100644 --- a/packages/simcore-sdk/tests/unit/test_node_ports_common_file_io_utils.py +++ b/packages/simcore-sdk/tests/unit/test_node_ports_common_file_io_utils.py @@ -19,7 +19,7 @@ UploadedPart, ) from moto.server import ThreadedMotoServer -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from pytest_mock import MockerFixture from servicelib.aiohttp import status from servicelib.progress_bar import ProgressBarData diff --git a/packages/simcore-sdk/tests/unit/test_node_ports_v2_links.py b/packages/simcore-sdk/tests/unit/test_node_ports_v2_links.py index 5116311ae01..7da24b9353c 100644 --- a/packages/simcore-sdk/tests/unit/test_node_ports_v2_links.py +++ b/packages/simcore-sdk/tests/unit/test_node_ports_v2_links.py @@ -1,8 +1,7 @@ -from typing import Dict from uuid import uuid4 import pytest -from pydantic import ValidationError +from pydantic.v1 import ValidationError from simcore_sdk.node_ports_v2.links import DownloadLink, FileLink, PortLink @@ -23,7 +22,7 @@ def test_valid_port_link(): {"nodeUuid": f"{uuid4()}", "output": "some:key"}, ], ) -def test_invalid_port_link(port_link: Dict[str, str]): +def test_invalid_port_link(port_link: dict[str, str]): with pytest.raises(ValidationError): PortLink(**port_link) @@ -36,7 +35,7 @@ def test_invalid_port_link(port_link: Dict[str, str]): {"label": "some stuff"}, ], ) -def test_invalid_download_link(download_link: Dict[str, str]): +def test_invalid_download_link(download_link: dict[str, str]): with pytest.raises(ValidationError): DownloadLink(**download_link) @@ -49,6 +48,6 @@ def test_invalid_download_link(download_link: Dict[str, str]): {"path": "/somefile/blahblah:"}, ], ) -def test_invalid_file_link(file_link: Dict[str, str]): +def test_invalid_file_link(file_link: dict[str, str]): with pytest.raises(ValidationError): FileLink(**file_link) diff --git a/packages/simcore-sdk/tests/unit/test_node_ports_v2_port.py b/packages/simcore-sdk/tests/unit/test_node_ports_v2_port.py index 9cf9d89eb9a..85438b14c18 100644 --- a/packages/simcore-sdk/tests/unit/test_node_ports_v2_port.py +++ b/packages/simcore-sdk/tests/unit/test_node_ports_v2_port.py @@ -23,8 +23,8 @@ from faker import Faker from models_library.api_schemas_storage import FileMetaDataGet from models_library.projects_nodes_io import LocationID -from pydantic import parse_obj_as -from pydantic.error_wrappers import ValidationError +from pydantic.v1 import parse_obj_as +from pydantic.v1.error_wrappers import ValidationError from pytest_mock.plugin import MockerFixture from servicelib.progress_bar import ProgressBarData from simcore_sdk.node_ports_common.file_io_utils import LogRedirectCB diff --git a/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_mapping.py b/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_mapping.py index 10c074591fc..de4f7b71ce4 100644 --- a/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_mapping.py +++ b/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_mapping.py @@ -4,11 +4,11 @@ from collections import deque from pprint import pprint -from typing import Any, Dict, List, Type, Union +from typing import Any import pytest from models_library.services import ServiceInput -from pydantic import ValidationError, confloat, schema_of +from pydantic.v1 import ValidationError, confloat, schema_of from simcore_sdk.node_ports_v2 import exceptions from simcore_sdk.node_ports_v2.port import Port from simcore_sdk.node_ports_v2.ports_mapping import InputsList, OutputsList @@ -16,7 +16,7 @@ @pytest.mark.parametrize("port_class", [InputsList, OutputsList]) -def test_empty_ports_mapping(port_class: Type[Union[InputsList, OutputsList]]): +def test_empty_ports_mapping(port_class: type[InputsList | OutputsList]): port_mapping = port_class(__root__={}) assert not port_mapping.items() assert not port_mapping.values() @@ -28,8 +28,8 @@ def test_empty_ports_mapping(port_class: Type[Union[InputsList, OutputsList]]): @pytest.mark.parametrize("port_class", [InputsList, OutputsList]) -def test_filled_ports_mapping(port_class: Type[Union[InputsList, OutputsList]]): - port_cfgs: Dict[str, Any] = {} +def test_filled_ports_mapping(port_class: type[InputsList | OutputsList]): + port_cfgs: dict[str, Any] = {} for t in ["integer", "number", "boolean", "string"]: port = create_valid_port_config(t) port_cfgs[port["key"]] = port @@ -71,10 +71,10 @@ def test_io_ports_are_not_aliases(): @pytest.fixture -def fake_port_meta() -> Dict[str, Any]: +def fake_port_meta() -> dict[str, Any]: """Service port metadata: defines a list of non-negative numbers""" schema = schema_of( - List[confloat(ge=0)], + list[confloat(ge=0)], title="list[non-negative number]", ) schema.update( @@ -86,7 +86,7 @@ def fake_port_meta() -> Dict[str, Any]: return port_model.dict(exclude_unset=True, by_alias=True) -def test_validate_port_value_against_schema(fake_port_meta: Dict[str, Any]): +def test_validate_port_value_against_schema(fake_port_meta: dict[str, Any]): # A simcore-sdk Port instance is a combination of both # - the port's metadata # - the port's value @@ -121,7 +121,7 @@ def test_validate_port_value_against_schema(fake_port_meta: Dict[str, Any]): assert schema_error_path == deque([1]) -def test_validate_iolist_against_schema(fake_port_meta: Dict[str, Any]): +def test_validate_iolist_against_schema(fake_port_meta: dict[str, Any]): # Check how errors propagate from a single Port to InputsList # reference port diff --git a/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_validation.py b/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_validation.py index 41e61669fe5..7d75a7bed02 100644 --- a/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_validation.py +++ b/packages/simcore-sdk/tests/unit/test_node_ports_v2_port_validation.py @@ -13,8 +13,8 @@ from unittest.mock import AsyncMock import pytest -from pydantic import BaseModel, conint, schema_of -from pydantic.error_wrappers import ValidationError +from pydantic.v1 import BaseModel, conint, schema_of +from pydantic.v1.error_wrappers import ValidationError from simcore_sdk.node_ports_v2.port import Port from simcore_sdk.node_ports_v2.port_validation import ( PortUnitError, diff --git a/packages/simcore-sdk/tests/unit/test_storage_client.py b/packages/simcore-sdk/tests/unit/test_storage_client.py index 91e46c5bd61..4c949f60bb1 100644 --- a/packages/simcore-sdk/tests/unit/test_storage_client.py +++ b/packages/simcore-sdk/tests/unit/test_storage_client.py @@ -20,7 +20,7 @@ ) from models_library.projects_nodes_io import SimcoreS3FileID from models_library.users import UserID -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from servicelib.aiohttp import status from simcore_sdk.node_ports_common import exceptions diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 3316f4276ed..aa123429313 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -34,8 +34,7 @@ urllib3>=1.26.5 # https://github.com/advisories/GH # SEE https://github.com/ITISFoundation/osparc-simcore/issues/4481 -fastapi<0.100.0 -pydantic<2.0 +pydantic<3 # with new released version 1.0.0 (https://github.com/aio-libs/aiozipkin/releases). # TODO: includes async features https://docs.sqlalchemy.org/en/14/changelog/migration_20.html diff --git a/scripts/demo-meta/osparc_webapi.py b/scripts/demo-meta/osparc_webapi.py index d64915fd7d7..1b881341aae 100644 --- a/scripts/demo-meta/osparc_webapi.py +++ b/scripts/demo-meta/osparc_webapi.py @@ -7,12 +7,12 @@ from contextlib import contextmanager from datetime import datetime from pathlib import Path -from typing import Any, Generic, Iterator, Optional, Type, TypeVar +from typing import Any, Generic, Iterator, TypeVar from uuid import UUID import httpx from httpx import HTTPStatusError -from pydantic import ( +from pydantic.v1 import ( AnyHttpUrl, AnyUrl, BaseModel, @@ -24,7 +24,7 @@ ValidationError, conint, ) -from pydantic.generics import GenericModel +from pydantic.v1.generics import GenericModel log = logging.getLogger(__name__) logging.basicConfig(level=getattr(logging, os.environ.get("LOG_LEVEL", "INFO"))) @@ -46,8 +46,8 @@ class Meta(BaseModel): class PageLinks(BaseModel): self: AnyHttpUrl first: AnyHttpUrl - prev: Optional[AnyHttpUrl] - next: Optional[AnyHttpUrl] + prev: AnyHttpUrl | None + next: AnyHttpUrl | None last: AnyHttpUrl @@ -58,8 +58,8 @@ class Page(GenericModel, Generic[ItemT]): class Envelope(GenericModel, Generic[DataT]): - data: Optional[DataT] - error: Optional[Any] + data: DataT | None + error: Any | None @classmethod def parse_data(cls, obj): @@ -69,9 +69,9 @@ def parse_data(cls, obj): class CheckPoint(BaseModel): id: NonNegativeInt checksum: str - tag: Optional[str] = None - message: Optional[str] = None - parent: Optional[NonNegativeInt] = None + tag: str | None = None + message: str | None = None + parent: NonNegativeInt | None = None created_at: datetime @@ -145,14 +145,14 @@ def get_profile(client: httpx.Client): def iter_items( - client: httpx.Client, url_path: str, item_cls: Type[ItemT] + client: httpx.Client, url_path: str, item_cls: type[ItemT] ) -> Iterator[ItemT]: """iterates items returned by a List std-method SEE https://google.aip.dev/132 """ - def _relative_url_path(page_link: Optional[AnyHttpUrl]) -> Optional[str]: + def _relative_url_path(page_link: AnyHttpUrl | None) -> str | None: if page_link: return f"{page_link.path}".replace(client.base_url.path, "") return None @@ -166,8 +166,7 @@ def _relative_url_path(page_link: Optional[AnyHttpUrl]) -> Optional[str]: r.raise_for_status() page = Page[item_cls].parse_raw(r.text) - for item in page.data: - yield item + yield from page.data next_url = _relative_url_path(page.links.next) last_url = _relative_url_path(page.links.last) @@ -198,7 +197,9 @@ def iter_project_iteration( # SETUP ------------------------------------------ class ClientSettings(BaseSettings): - OSPARC_API_URL: AnyUrl = Field(default="http://127.0.0.1.nip.io:9081/v0") # NOSONAR + OSPARC_API_URL: AnyUrl = Field( + default="http://127.0.0.1.nip.io:9081/v0" + ) # NOSONAR OSPARC_USER_EMAIL: EmailStr OSPARC_USER_PASSWORD: SecretStr diff --git a/scripts/maintenance/clean_projects_of_user.py b/scripts/maintenance/clean_projects_of_user.py index 8e4428accb7..1305c1353e4 100755 --- a/scripts/maintenance/clean_projects_of_user.py +++ b/scripts/maintenance/clean_projects_of_user.py @@ -1,11 +1,11 @@ #! /usr/bin/env python3 import asyncio -from typing import Any, Optional +from typing import Any import typer from httpx import URL, AsyncClient, HTTPStatusError, Timeout, codes -from pydantic import EmailStr, SecretStr +from pydantic.v1 import EmailStr, SecretStr DEFAULT_TIMEOUT = Timeout(30.0) @@ -20,7 +20,7 @@ async def login_user(client: AsyncClient, email: EmailStr, password: SecretStr): async def get_project_for_user( client: AsyncClient, project_id: str -) -> Optional[dict[str, Any]]: +) -> dict[str, Any] | None: path = f"/projects/{project_id}" r = await client.get(path, params={"type": "user"}) if r.status_code == 200: @@ -30,7 +30,7 @@ async def get_project_for_user( async def get_all_projects_for_user( - client: AsyncClient, next_link: Optional[str] = None + client: AsyncClient, next_link: str | None = None ) -> list[dict[str, Any]]: path = next_link if next_link else "/projects" r = await client.get(path, params={"type": "user"}) @@ -56,7 +56,7 @@ async def delete_project(client: AsyncClient, project_id: str, progressbar): async def clean( - endpoint: URL, username: EmailStr, password: SecretStr, project_id: Optional[str] + endpoint: URL, username: EmailStr, password: SecretStr, project_id: str | None ) -> int: try: async with AsyncClient( @@ -108,7 +108,7 @@ async def clean( def main( - endpoint: str, username: str, password: str, project_id: Optional[str] = None + endpoint: str, username: str, password: str, project_id: str | None = None ) -> int: return asyncio.get_event_loop().run_until_complete( clean(URL(endpoint), EmailStr(username), SecretStr(password), project_id) diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py index 82c5978f1d5..06865f7e980 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py @@ -2,7 +2,7 @@ from typing import Final import parse -from pydantic import ByteSize +from pydantic.v1 import ByteSize DEFAULT_COMPUTATIONAL_EC2_FORMAT: Final[ str diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py index 1ebd11821b5..e3a6a17d3a0 100755 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/core.py @@ -12,7 +12,7 @@ import typer from mypy_boto3_ec2.service_resource import Instance, ServiceResourceInstancesCollection from mypy_boto3_ec2.type_defs import TagTypeDef -from pydantic import ByteSize, TypeAdapter, ValidationError +from pydantic.v1 import ByteSize, TypeAdapter, ValidationError from rich.progress import track from rich.style import Style from rich.table import Column, Table diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/dask.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/dask.py index e18c2beb831..bf08dfc43c8 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/dask.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/dask.py @@ -5,7 +5,7 @@ import distributed import rich from mypy_boto3_ec2.service_resource import Instance -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl from .constants import SSH_USER_NAME, TASK_CANCEL_EVENT_NAME_TEMPLATE from .ec2 import get_bastion_instance_from_remote_instance diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/db.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/db.py index 615fe6b82a6..9e5edbfdfaf 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/db.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/db.py @@ -5,7 +5,7 @@ import rich import sqlalchemy as sa -from pydantic import PostgresDsn, TypeAdapter +from pydantic.v1 import PostgresDsn, TypeAdapter from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine from .models import AppState, ComputationalTask, PostgresDB diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/models.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/models.py index a4b423ebddc..030cca6c78a 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/models.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/models.py @@ -9,7 +9,7 @@ import parse from mypy_boto3_ec2 import EC2ServiceResource from mypy_boto3_ec2.service_resource import Instance -from pydantic import BaseModel, ByteSize, PostgresDsn +from pydantic.v1 import BaseModel, ByteSize, PostgresDsn @dataclass(kw_only=True) diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/ssh.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/ssh.py index a19f4be0992..57408f1fea6 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/ssh.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/ssh.py @@ -14,7 +14,7 @@ import typer from mypy_boto3_ec2.service_resource import Instance from paramiko import Ed25519Key -from pydantic import ByteSize +from pydantic.v1 import ByteSize from sshtunnel import SSHTunnelForwarder from .constants import DYN_SERVICES_NAMING_CONVENTION diff --git a/scripts/maintenance/create_user.py b/scripts/maintenance/create_user.py index b96d856f32a..7aad9039c32 100755 --- a/scripts/maintenance/create_user.py +++ b/scripts/maintenance/create_user.py @@ -4,8 +4,8 @@ import typer from httpx import URL, AsyncClient -from pydantic.networks import EmailStr -from pydantic.types import SecretStr +from pydantic.v1.networks import EmailStr +from pydantic.v1.types import SecretStr async def logout_current_user(client: AsyncClient): diff --git a/scripts/maintenance/import_projects_as_template.py b/scripts/maintenance/import_projects_as_template.py index a434787ded0..ab494b93656 100755 --- a/scripts/maintenance/import_projects_as_template.py +++ b/scripts/maintenance/import_projects_as_template.py @@ -4,12 +4,11 @@ import os from contextlib import suppress from pathlib import Path -from typing import Optional import typer from httpx import URL, AsyncClient, HTTPStatusError -from pydantic.networks import EmailStr -from pydantic.types import SecretStr +from pydantic.v1.networks import EmailStr +from pydantic.v1.types import SecretStr EVERYONE_GROUP_ID = 1 @@ -143,7 +142,7 @@ def main( endpoint: str, username: str, project_file: Path, - project_name: Optional[str] = None, + project_name: str | None = None, share_with_gid: int = EVERYONE_GROUP_ID, password: str = typer.Option( ..., prompt=True, confirmation_prompt=True, hide_input=True diff --git a/scripts/maintenance/migrate_project/src/models.py b/scripts/maintenance/migrate_project/src/models.py index a26cf63e734..871161414de 100644 --- a/scripts/maintenance/migrate_project/src/models.py +++ b/scripts/maintenance/migrate_project/src/models.py @@ -1,9 +1,8 @@ import json from pathlib import Path -from typing import Optional from uuid import UUID -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from settings_library.r_clone import S3Provider @@ -32,7 +31,7 @@ class SourceConfig(BaseModel): db: DBConfig s3: S3Config project_uuid: UUID = Field(..., description="project to be moved from the source") - hidden_projects_for_user: Optional[int] = Field( + hidden_projects_for_user: int | None = Field( None, description="by default nothing is moved, must provide an user ID for which to move the hidden projects", ) diff --git a/scripts/release/monitor_release/models.py b/scripts/release/monitor_release/models.py index d0d97f93490..5a6f9083128 100644 --- a/scripts/release/monitor_release/models.py +++ b/scripts/release/monitor_release/models.py @@ -1,7 +1,7 @@ from datetime import datetime from enum import Enum -from pydantic import BaseModel +from pydantic.v1 import BaseModel class Deployment(str, Enum): diff --git a/scripts/release/monitor_release/settings.py b/scripts/release/monitor_release/settings.py index ba4f9c7e1d2..1114e9a5616 100644 --- a/scripts/release/monitor_release/settings.py +++ b/scripts/release/monitor_release/settings.py @@ -3,8 +3,8 @@ from typing import Final from dotenv import load_dotenv -from pydantic import BaseModel, Field, HttpUrl, TypeAdapter, model_validator -from pydantic_settings import BaseSettings, SettingsConfigDict +from pydantic.v1 import BaseModel, Field, HttpUrl, TypeAdapter, model_validator +from pydantic.v1_settings import BaseSettings, SettingsConfigDict from .models import Deployment diff --git a/services/agent/requirements/_base.txt b/services/agent/requirements/_base.txt index 394611702aa..3047d32c1c7 100644 --- a/services/agent/requirements/_base.txt +++ b/services/agent/requirements/_base.txt @@ -11,6 +11,8 @@ aiohttp==3.8.5 # aiodocker aiosignal==1.2.0 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==3.6.2 # via # httpx @@ -41,16 +43,10 @@ click==8.1.3 # uvicorn dnspython==2.2.1 # via email-validator -email-validator==1.3.0 +email-validator==2.2.0 # via pydantic -fastapi==0.96.0 +fastapi==0.112.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -106,7 +102,7 @@ prometheus-client==0.19.0 # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -pydantic==1.10.2 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -119,6 +115,8 @@ pydantic==1.10.2 # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/_base.in # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.15.1 # via rich pyrsistent==0.19.2 @@ -143,7 +141,7 @@ sniffio==1.3.0 # via # anyio # httpx -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -154,10 +152,12 @@ starlette==0.27.0 # fastapi typer==0.12.3 # via -r requirements/../../../packages/settings-library/requirements/_base.in -typing-extensions==4.4.0 +typing-extensions==4.12.2 # via # aiodocker + # fastapi # pydantic + # pydantic-core # typer uvicorn==0.19.0 # via diff --git a/services/agent/requirements/_test.txt b/services/agent/requirements/_test.txt index fd7c0889fce..a15e2558cca 100644 --- a/services/agent/requirements/_test.txt +++ b/services/agent/requirements/_test.txt @@ -13,6 +13,10 @@ aiosignal==1.2.0 # via # -c requirements/_base.txt # aiohttp +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic anyio==3.6.2 # via # -c requirements/_base.txt @@ -81,8 +85,6 @@ ecdsa==0.19.0 # moto # python-jose # sshpubkeys -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in flask==3.0.3 @@ -178,11 +180,15 @@ pyasn1==0.6.0 # rsa pycparser==2.22 # via cffi -pydantic==1.10.2 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pyrsistent==0.19.2 @@ -257,16 +263,13 @@ sshpubkeys==3.3.1 # via moto sympy==1.13.2 # via cfn-lint -tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.4.0 +typing-extensions==4.12.2 # via # -c requirements/_base.txt # aws-sam-translator # cfn-lint # pydantic + # pydantic-core urllib3==2.2.2 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/agent/requirements/_tools.txt b/services/agent/requirements/_tools.txt index 69a9671437c..8c9416c12a5 100644 --- a/services/agent/requirements/_tools.txt +++ b/services/agent/requirements/_tools.txt @@ -77,22 +77,12 @@ setuptools==69.2.0 # -c requirements/_base.txt # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint -typing-extensions==4.4.0 +typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/agent/src/simcore_service_agent/core/settings.py b/services/agent/src/simcore_service_agent/core/settings.py index 882217f9a5f..2bbb16e9556 100644 --- a/services/agent/src/simcore_service_agent/core/settings.py +++ b/services/agent/src/simcore_service_agent/core/settings.py @@ -1,7 +1,7 @@ from typing import Final from models_library.basic_types import BootModeEnum, LogLevel -from pydantic import AnyHttpUrl, Field, NonNegativeInt, validator +from pydantic.v1 import AnyHttpUrl, Field, NonNegativeInt, validator from settings_library.base import BaseCustomSettings from settings_library.r_clone import S3Provider from settings_library.utils_logging import MixinLoggingSettings diff --git a/services/agent/src/simcore_service_agent/modules/task_monitor.py b/services/agent/src/simcore_service_agent/modules/task_monitor.py index 8f4e3cd2ab3..4a5d58c55e8 100644 --- a/services/agent/src/simcore_service_agent/modules/task_monitor.py +++ b/services/agent/src/simcore_service_agent/modules/task_monitor.py @@ -4,10 +4,10 @@ from contextlib import suppress from dataclasses import dataclass, field from time import time -from typing import Any, Awaitable, Callable, Final, Optional +from typing import Any, Awaitable, Callable, Final from fastapi import FastAPI -from pydantic import PositiveFloat, PositiveInt +from pydantic.v1 import PositiveFloat, PositiveInt from servicelib.logging_utils import log_context from ..core.settings import ApplicationSettings @@ -22,8 +22,8 @@ class _TaskData: target: Callable args: Any - repeat_interval_s: Optional[PositiveFloat] - _start_time: Optional[PositiveFloat] = None + repeat_interval_s: PositiveFloat | None + _start_time: PositiveFloat | None = None @property def name(self) -> str: @@ -99,7 +99,7 @@ def register_job( self, target: Callable, *args: Any, - repeat_interval_s: Optional[PositiveFloat] = None, + repeat_interval_s: PositiveFloat | None = None, ) -> None: if self._was_started: raise RuntimeError( diff --git a/services/agent/src/simcore_service_agent/modules/volumes_cleanup/_s3.py b/services/agent/src/simcore_service_agent/modules/volumes_cleanup/_s3.py index 0494f614a1d..61a8902519c 100644 --- a/services/agent/src/simcore_service_agent/modules/volumes_cleanup/_s3.py +++ b/services/agent/src/simcore_service_agent/modules/volumes_cleanup/_s3.py @@ -5,7 +5,7 @@ from textwrap import dedent from typing import Final -from pydantic import AnyHttpUrl +from pydantic.v1 import AnyHttpUrl from settings_library.r_clone import S3Provider from settings_library.utils_r_clone import resolve_provider diff --git a/services/agent/tests/conftest.py b/services/agent/tests/conftest.py index bd0d1a8964f..0dac9e0f5a2 100644 --- a/services/agent/tests/conftest.py +++ b/services/agent/tests/conftest.py @@ -14,7 +14,7 @@ from models_library.basic_types import BootModeEnum from models_library.services import RunID from moto.server import ThreadedMotoServer -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from settings_library.r_clone import S3Provider from simcore_service_agent.core.settings import ApplicationSettings diff --git a/services/agent/tests/unit/test_modules_task_monitor.py b/services/agent/tests/unit/test_modules_task_monitor.py index e13b73c5d00..d0e3657cbc3 100644 --- a/services/agent/tests/unit/test_modules_task_monitor.py +++ b/services/agent/tests/unit/test_modules_task_monitor.py @@ -4,7 +4,7 @@ from typing import Final import pytest -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from simcore_service_agent.modules.task_monitor import TaskMonitor REPEAT_TASK_INTERVAL_S: Final[PositiveFloat] = 0.05 diff --git a/services/agent/tests/unit/test_modules_volumes_cleanup_s3.py b/services/agent/tests/unit/test_modules_volumes_cleanup_s3.py index 1728d0bb029..29b1b6b4cdf 100644 --- a/services/agent/tests/unit/test_modules_volumes_cleanup_s3.py +++ b/services/agent/tests/unit/test_modules_volumes_cleanup_s3.py @@ -8,7 +8,7 @@ import aioboto3 import pytest from aiodocker.volumes import DockerVolume -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl from pytest import LogCaptureFixture from simcore_service_agent.core.settings import ApplicationSettings from simcore_service_agent.modules.volumes_cleanup._s3 import ( diff --git a/services/api-server/requirements/_base.txt b/services/api-server/requirements/_base.txt index a132d7fb2a6..3582af4761f 100644 --- a/services/api-server/requirements/_base.txt +++ b/services/api-server/requirements/_base.txt @@ -1,16 +1,55 @@ aio-pika==9.4.1 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiocache==0.12.2 + # via -r requirements/../../../packages/simcore-sdk/requirements/_base.in aiodebug==2.3.0 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiodocker==0.21.0 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in aiofiles==23.2.1 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/_base.in + # -r requirements/_base.in aiohttp==3.9.3 - # via aiodocker + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/simcore-sdk/requirements/_base.in + # aiodocker aiopg==1.4.0 + # via + # -r requirements/../../../packages/simcore-sdk/requirements/_base.in + # -r requirements/_base.in aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp alembic==1.13.1 + # via + # -r requirements/../../../packages/postgres-database/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -19,12 +58,17 @@ anyio==4.3.0 # starlette # watchfiles arrow==1.3.0 + # via + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 # via - # aiohttp # aiopg # asyncpg - # redis asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -33,6 +77,20 @@ attrs==23.2.0 # jsonschema certifi==2024.2.2 # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt # httpcore # httpx cffi==1.16.0 @@ -42,22 +100,46 @@ click==8.1.7 # typer # uvicorn cryptography==42.0.5 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/_base.in dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via # fastapi # pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # -r requirements/_base.in # fastapi-pagination # prometheus-fastapi-instrumentator +fastapi-cli==0.0.5 + # via fastapi fastapi-pagination==0.12.17 + # via + # -c requirements/./constraints.txt + # -r requirements/_base.in faststream==0.5.10 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in frozenlist==1.4.1 # via # aiohttp @@ -73,7 +155,24 @@ httpcore==1.0.5 httptools==0.6.1 # via uvicorn httpx==0.27.0 - # via fastapi + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # -r requirements/_base.in + # fastapi idna==3.6 # via # anyio @@ -83,10 +182,46 @@ idna==3.6 itsdangerous==2.1.2 # via fastapi jinja2==3.1.3 - # via fastapi + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # fastapi jsonschema==3.2.0 + # via + # -c requirements/./constraints.txt + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in mako==1.3.2 - # via alembic + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # alembic markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -100,46 +235,153 @@ multidict==6.0.5 # aiohttp # yarl orjson==3.10.0 - # via fastapi + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/_base.in + # fastapi packaging==24.0 + # via + # -r requirements/../../../packages/simcore-sdk/requirements/_base.in + # -r requirements/_base.in pamqp==3.3.0 # via aiormq parse==1.20.2 + # via -r requirements/_base.in pint==0.23 + # via -r requirements/../../../packages/simcore-sdk/requirements/_base.in prometheus-client==0.20.0 - # via prometheus-fastapi-instrumentator + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via # aiopg # sqlalchemy pycparser==2.22 # via cffi -pydantic==1.10.14 +pydantic==2.8.2 # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/postgres-database/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/_base.in + # -r requirements/_base.in # fast-depends # fastapi # fastapi-pagination + # pydantic-extra-types + # pydantic-settings +pydantic-core==2.20.1 + # via pydantic +pydantic-extra-types==2.9.0 + # via fastapi +pydantic-settings==2.4.0 + # via fastapi pygments==2.17.2 # via rich pyinstrument==4.6.2 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in pyrsistent==0.20.0 # via jsonschema python-dateutil==2.9.0.post0 # via arrow python-dotenv==1.0.1 # via - # pydantic + # pydantic-settings # uvicorn python-multipart==0.0.9 # via fastapi pyyaml==6.0.1 # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/_base.in # fastapi # uvicorn redis==5.0.4 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in rich==13.7.1 - # via typer + # via + # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in + # typer setuptools==69.2.0 # via jsonschema shellingham==1.5.4 @@ -154,9 +396,25 @@ sniffio==1.3.1 # httpx sqlalchemy==1.4.52 # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/postgres-database/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aiopg # alembic -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -180,9 +438,23 @@ tenacity==8.5.0 # -r requirements/../../../packages/simcore-sdk/requirements/_base.in # -r requirements/_base.in toolz==0.12.1 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in tqdm==4.66.2 + # via + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/_base.in typer==0.12.3 - # via faststream + # via + # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/_base.in + # fastapi-cli + # faststream types-python-dateutil==2.9.0.20240316 # via arrow typing-extensions==4.10.0 @@ -190,18 +462,35 @@ typing-extensions==4.10.0 # aiodebug # aiodocker # alembic - # anyio # fastapi # fastapi-pagination # faststream # pint # pydantic + # pydantic-core # typer - # uvicorn ujson==5.9.0 - # via fastapi + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # fastapi uvicorn==0.29.0 - # via fastapi + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # fastapi + # fastapi-cli uvloop==0.19.0 # via uvicorn watchfiles==0.21.0 @@ -210,6 +499,8 @@ websockets==12.0 # via uvicorn yarl==1.9.4 # via + # -r requirements/../../../packages/postgres-database/requirements/_base.in + # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aio-pika # aiohttp # aiormq diff --git a/services/api-server/requirements/_test.txt b/services/api-server/requirements/_test.txt index 8a1ddb9caa4..2c7fec18f12 100644 --- a/services/api-server/requirements/_test.txt +++ b/services/api-server/requirements/_test.txt @@ -19,10 +19,6 @@ anyio==4.3.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp attrs==23.2.0 # via # -c requirements/_base.txt @@ -91,11 +87,6 @@ ecdsa==0.19.0 # moto # python-jose # sshpubkeys -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in flask==2.1.3 @@ -318,11 +309,6 @@ sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy sshpubkeys==3.3.1 # via moto -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in types-awscrt==0.21.2 @@ -335,7 +321,6 @@ typing-extensions==4.10.0 # via # -c requirements/_base.txt # alembic - # anyio # boto3-stubs # mypy # sqlalchemy2-stubs diff --git a/services/api-server/requirements/_tools.txt b/services/api-server/requirements/_tools.txt index ee67b7d505f..a741d4f592a 100644 --- a/services/api-server/requirements/_tools.txt +++ b/services/api-server/requirements/_tools.txt @@ -91,22 +91,12 @@ setuptools==69.2.0 # -c requirements/_base.txt # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/api-server/src/simcore_service_api_server/api/dependencies/authentication.py b/services/api-server/src/simcore_service_api_server/api/dependencies/authentication.py index 20e78d90c90..557ad952e31 100644 --- a/services/api-server/src/simcore_service_api_server/api/dependencies/authentication.py +++ b/services/api-server/src/simcore_service_api_server/api/dependencies/authentication.py @@ -4,7 +4,7 @@ from fastapi.security import HTTPBasic, HTTPBasicCredentials from models_library.emails import LowerCaseEmailStr from models_library.products import ProductName -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from ...db.repositories.api_keys import ApiKeysRepository, UserAndProductTuple from ...db.repositories.users import UsersRepository diff --git a/services/api-server/src/simcore_service_api_server/api/dependencies/files.py b/services/api-server/src/simcore_service_api_server/api/dependencies/files.py index ae3e1009ef5..ffb66bb88c8 100644 --- a/services/api-server/src/simcore_service_api_server/api/dependencies/files.py +++ b/services/api-server/src/simcore_service_api_server/api/dependencies/files.py @@ -1,5 +1,5 @@ from fastapi import Header -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt # # Based on discussion https://github.com/tiangolo/fastapi/issues/362#issuecomment-584104025 diff --git a/services/api-server/src/simcore_service_api_server/api/dependencies/rabbitmq.py b/services/api-server/src/simcore_service_api_server/api/dependencies/rabbitmq.py index 16de774ce52..a3c38d490de 100644 --- a/services/api-server/src/simcore_service_api_server/api/dependencies/rabbitmq.py +++ b/services/api-server/src/simcore_service_api_server/api/dependencies/rabbitmq.py @@ -2,7 +2,7 @@ from typing import Annotated, Final, cast from fastapi import Depends, FastAPI -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.aiohttp.application_setup import ApplicationSetupError from servicelib.fastapi.dependencies import get_app from servicelib.rabbitmq import RabbitMQClient diff --git a/services/api-server/src/simcore_service_api_server/api/routes/files.py b/services/api-server/src/simcore_service_api_server/api/routes/files.py index 69b7baed658..834441eb02e 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/files.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/files.py @@ -14,7 +14,7 @@ from fastapi_pagination.api import create_page from models_library.api_schemas_storage import ETag, FileUploadCompletionBody, LinkType from models_library.basic_types import SHA256Str -from pydantic import AnyUrl, ByteSize, PositiveInt, ValidationError, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, PositiveInt, ValidationError, parse_obj_as from servicelib.fastapi.requests_decorators import cancel_on_disconnect from simcore_sdk.node_ports_common.constants import SIMCORE_LOCATION from simcore_sdk.node_ports_common.file_io_utils import UploadableFileObject diff --git a/services/api-server/src/simcore_service_api_server/api/routes/solvers.py b/services/api-server/src/simcore_service_api_server/api/routes/solvers.py index adb65142fdb..191188c2a7e 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/solvers.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/solvers.py @@ -6,8 +6,8 @@ from fastapi import APIRouter, Depends, HTTPException, status from httpx import HTTPStatusError from models_library.api_schemas_api_server.pricing_plans import ServicePricingPlanGet -from pydantic import ValidationError -from pydantic.errors import PydanticValueError +from pydantic.v1 import ValidationError +from pydantic.v1.errors import PydanticValueError from ...exceptions.service_errors_utils import DEFAULT_BACKEND_SERVICE_STATUS_CODES from ...models.basic_types import VersionStr diff --git a/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs.py b/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs.py index 254d23591e8..b76e1df2d3d 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs.py @@ -11,7 +11,7 @@ from models_library.clusters import ClusterID from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt from simcore_service_api_server.exceptions.backend_errors import ( ProjectAlreadyStartedError, ) diff --git a/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py b/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py index c24a2e5973c..0028b9c6661 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/solvers_jobs_getters.py @@ -16,8 +16,8 @@ from models_library.projects_nodes_io import BaseFileLink from models_library.users import UserID from models_library.wallets import ZERO_CREDITS -from pydantic import NonNegativeInt -from pydantic.types import PositiveInt +from pydantic.v1 import NonNegativeInt +from pydantic.v1.types import PositiveInt from servicelib.fastapi.requests_decorators import cancel_on_disconnect from servicelib.logging_utils import log_context diff --git a/services/api-server/src/simcore_service_api_server/api/routes/studies_jobs.py b/services/api-server/src/simcore_service_api_server/api/routes/studies_jobs.py index c80e2899917..eb6de535639 100644 --- a/services/api-server/src/simcore_service_api_server/api/routes/studies_jobs.py +++ b/services/api-server/src/simcore_service_api_server/api/routes/studies_jobs.py @@ -13,7 +13,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes import InputID, InputTypes from models_library.projects_nodes_io import NodeID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.logging_utils import log_context from simcore_service_api_server.api.routes.solvers_jobs import JOBS_STATUS_CODES from simcore_service_api_server.exceptions.backend_errors import ( diff --git a/services/api-server/src/simcore_service_api_server/core/_prometheus_instrumentation.py b/services/api-server/src/simcore_service_api_server/core/_prometheus_instrumentation.py index 7d435cd086c..f1a000098bd 100644 --- a/services/api-server/src/simcore_service_api_server/core/_prometheus_instrumentation.py +++ b/services/api-server/src/simcore_service_api_server/core/_prometheus_instrumentation.py @@ -5,7 +5,7 @@ from fastapi import FastAPI from prometheus_client import CollectorRegistry, Gauge -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.background_task import start_periodic_task, stop_periodic_task from servicelib.fastapi.prometheus_instrumentation import ( setup_prometheus_instrumentation as setup_rest_instrumentation, diff --git a/services/api-server/src/simcore_service_api_server/core/health_checker.py b/services/api-server/src/simcore_service_api_server/core/health_checker.py index 8dcba7422ec..81e7ad314ff 100644 --- a/services/api-server/src/simcore_service_api_server/core/health_checker.py +++ b/services/api-server/src/simcore_service_api_server/core/health_checker.py @@ -8,7 +8,7 @@ from fastapi import Depends, FastAPI from models_library.rabbitmq_messages import LoggerRabbitMessage from models_library.users import UserID -from pydantic import NonNegativeInt, PositiveFloat, PositiveInt +from pydantic.v1 import NonNegativeInt, PositiveFloat, PositiveInt from servicelib.background_task import start_periodic_task, stop_periodic_task from servicelib.fastapi.dependencies import get_app from servicelib.logging_utils import log_catch diff --git a/services/api-server/src/simcore_service_api_server/core/settings.py b/services/api-server/src/simcore_service_api_server/core/settings.py index 9cc61e1c11a..fb17305af56 100644 --- a/services/api-server/src/simcore_service_api_server/core/settings.py +++ b/services/api-server/src/simcore_service_api_server/core/settings.py @@ -1,8 +1,8 @@ from functools import cached_property from models_library.basic_types import BootModeEnum, LogLevel -from pydantic import Field, NonNegativeInt, PositiveInt, SecretStr -from pydantic.class_validators import validator +from pydantic.v1 import Field, NonNegativeInt, PositiveInt, SecretStr +from pydantic.v1.class_validators import validator from settings_library.base import BaseCustomSettings from settings_library.catalog import CatalogSettings from settings_library.director_v2 import DirectorV2Settings diff --git a/services/api-server/src/simcore_service_api_server/db/repositories/api_keys.py b/services/api-server/src/simcore_service_api_server/db/repositories/api_keys.py index e970f819ccc..bff5273f554 100644 --- a/services/api-server/src/simcore_service_api_server/db/repositories/api_keys.py +++ b/services/api-server/src/simcore_service_api_server/db/repositories/api_keys.py @@ -3,7 +3,7 @@ import sqlalchemy as sa from models_library.products import ProductName -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt from simcore_postgres_database.errors import DatabaseError from .. import tables as tbl diff --git a/services/api-server/src/simcore_service_api_server/db/repositories/users.py b/services/api-server/src/simcore_service_api_server/db/repositories/users.py index 15ea74f083b..69d15e8a8f7 100644 --- a/services/api-server/src/simcore_service_api_server/db/repositories/users.py +++ b/services/api-server/src/simcore_service_api_server/db/repositories/users.py @@ -1,6 +1,6 @@ import sqlalchemy as sa from models_library.emails import LowerCaseEmailStr -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..tables import UserStatus, users from ._base import BaseRepository diff --git a/services/api-server/src/simcore_service_api_server/exceptions/handlers/_validation_errors.py b/services/api-server/src/simcore_service_api_server/exceptions/handlers/_validation_errors.py index de7fd25fecf..5d2b6d9f019 100644 --- a/services/api-server/src/simcore_service_api_server/exceptions/handlers/_validation_errors.py +++ b/services/api-server/src/simcore_service_api_server/exceptions/handlers/_validation_errors.py @@ -2,7 +2,7 @@ from fastapi.exceptions import RequestValidationError from fastapi.openapi.constants import REF_PREFIX from fastapi.openapi.utils import validation_error_response_definition -from pydantic import ValidationError +from pydantic.v1 import ValidationError from starlette.responses import JSONResponse from ._utils import create_error_json_response diff --git a/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py b/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py index 39167c92040..834d553586b 100644 --- a/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py +++ b/services/api-server/src/simcore_service_api_server/exceptions/service_errors_utils.py @@ -7,7 +7,7 @@ import httpx from fastapi import HTTPException, status -from pydantic import ValidationError +from pydantic.v1 import ValidationError from simcore_service_api_server.exceptions.backend_errors import BaseBackEndError from ..models.schemas.errors import ErrorGet diff --git a/services/api-server/src/simcore_service_api_server/models/api_resources.py b/services/api-server/src/simcore_service_api_server/models/api_resources.py index 3f64fd323c0..971d873b321 100644 --- a/services/api-server/src/simcore_service_api_server/models/api_resources.py +++ b/services/api-server/src/simcore_service_api_server/models/api_resources.py @@ -2,8 +2,8 @@ import urllib.parse from typing import Any -from pydantic import BaseModel, Field -from pydantic.types import ConstrainedStr +from pydantic.v1 import BaseModel, Field +from pydantic.v1.types import ConstrainedStr # RESOURCE NAMES https://cloud.google.com/apis/design/resource_names # diff --git a/services/api-server/src/simcore_service_api_server/models/basic_types.py b/services/api-server/src/simcore_service_api_server/models/basic_types.py index 53ea6fe31ce..0485b604fd3 100644 --- a/services/api-server/src/simcore_service_api_server/models/basic_types.py +++ b/services/api-server/src/simcore_service_api_server/models/basic_types.py @@ -2,7 +2,7 @@ from fastapi.responses import StreamingResponse from models_library.basic_regex import SIMPLE_VERSION_RE -from pydantic import ConstrainedStr +from pydantic.v1 import ConstrainedStr class VersionStr(ConstrainedStr): diff --git a/services/api-server/src/simcore_service_api_server/models/domain/groups.py b/services/api-server/src/simcore_service_api_server/models/domain/groups.py index b358d08ae30..0734a410b8a 100644 --- a/services/api-server/src/simcore_service_api_server/models/domain/groups.py +++ b/services/api-server/src/simcore_service_api_server/models/domain/groups.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field class UsersGroup(BaseModel): diff --git a/services/api-server/src/simcore_service_api_server/models/pagination.py b/services/api-server/src/simcore_service_api_server/models/pagination.py index 44013b068e5..99b33e82faa 100644 --- a/services/api-server/src/simcore_service_api_server/models/pagination.py +++ b/services/api-server/src/simcore_service_api_server/models/pagination.py @@ -18,8 +18,8 @@ MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE, ) from models_library.utils.pydantic_tools_extension import FieldNotRequired -from pydantic import Field, NonNegativeInt, validator -from pydantic.generics import GenericModel +from pydantic.v1 import Field, NonNegativeInt, validator +from pydantic.v1.generics import GenericModel T = TypeVar("T") diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/errors.py b/services/api-server/src/simcore_service_api_server/models/schemas/errors.py index 306ac959058..fe8f6658e43 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/errors.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/errors.py @@ -1,6 +1,6 @@ from typing import Any, ClassVar -from pydantic import BaseModel +from pydantic.v1 import BaseModel class ErrorGet(BaseModel): diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/files.py b/services/api-server/src/simcore_service_api_server/models/schemas/files.py index eece67dfa59..ca779930bf8 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/files.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/files.py @@ -10,7 +10,7 @@ from models_library.api_schemas_storage import ETag from models_library.basic_types import SHA256Str from models_library.projects_nodes_io import StorageFileID -from pydantic import ( +from pydantic.v1 import ( AnyUrl, BaseModel, ByteSize, diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/jobs.py b/services/api-server/src/simcore_service_api_server/models/schemas/jobs.py index a190d4e182b..07cb170641f 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/jobs.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/jobs.py @@ -7,7 +7,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.projects_state import RunningState -from pydantic import ( +from pydantic.v1 import ( BaseModel, ConstrainedInt, Extra, diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/meta.py b/services/api-server/src/simcore_service_api_server/models/schemas/meta.py index ea358f1433f..0afc789ecc4 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/meta.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/meta.py @@ -1,7 +1,7 @@ from typing import ClassVar from models_library.api_schemas__common.meta import BaseMeta -from pydantic import AnyHttpUrl +from pydantic.v1 import AnyHttpUrl class Meta(BaseMeta): diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/profiles.py b/services/api-server/src/simcore_service_api_server/models/schemas/profiles.py index 8f86f2e693f..51609251cbc 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/profiles.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/profiles.py @@ -4,7 +4,7 @@ from models_library.emails import LowerCaseEmailStr from models_library.users import FirstNameStr, LastNameStr, UserID from models_library.utils.enums import StrAutoEnum -from pydantic import BaseModel, Field, validator +from pydantic.v1 import BaseModel, Field, validator from ..domain.groups import Groups diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/solvers.py b/services/api-server/src/simcore_service_api_server/models/schemas/solvers.py index a99017852a5..a95d6b72ce5 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/solvers.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/solvers.py @@ -6,7 +6,7 @@ from models_library.services import ServiceMetaDataPublished from models_library.services_regex import COMPUTATIONAL_SERVICE_KEY_RE from packaging.version import Version -from pydantic import BaseModel, ConstrainedStr, Extra, Field, HttpUrl +from pydantic.v1 import BaseModel, ConstrainedStr, Extra, Field, HttpUrl from ..api_resources import compose_resource_name from ..basic_types import VersionStr diff --git a/services/api-server/src/simcore_service_api_server/models/schemas/studies.py b/services/api-server/src/simcore_service_api_server/models/schemas/studies.py index 96c63ee7910..949ab578202 100644 --- a/services/api-server/src/simcore_service_api_server/models/schemas/studies.py +++ b/services/api-server/src/simcore_service_api_server/models/schemas/studies.py @@ -2,7 +2,7 @@ from models_library import projects, projects_nodes_io from models_library.utils import pydantic_tools_extension -from pydantic import AnyUrl, BaseModel, Field +from pydantic.v1 import AnyUrl, BaseModel, Field from .. import api_resources from . import solvers diff --git a/services/api-server/src/simcore_service_api_server/services/catalog.py b/services/api-server/src/simcore_service_api_server/services/catalog.py index 56a7d648790..8a92fcb93b3 100644 --- a/services/api-server/src/simcore_service_api_server/services/catalog.py +++ b/services/api-server/src/simcore_service_api_server/services/catalog.py @@ -9,7 +9,7 @@ from fastapi import FastAPI, status from models_library.emails import LowerCaseEmailStr from models_library.services import ServiceMetaDataPublished, ServiceType -from pydantic import Extra, ValidationError, parse_obj_as, parse_raw_as +from pydantic.v1 import Extra, ValidationError, parse_obj_as, parse_raw_as from settings_library.catalog import CatalogSettings from simcore_service_api_server.exceptions.backend_errors import ( ListSolversOrStudiesError, diff --git a/services/api-server/src/simcore_service_api_server/services/director_v2.py b/services/api-server/src/simcore_service_api_server/services/director_v2.py index ff31490b072..9c5a8b58d57 100644 --- a/services/api-server/src/simcore_service_api_server/services/director_v2.py +++ b/services/api-server/src/simcore_service_api_server/services/director_v2.py @@ -8,7 +8,7 @@ from models_library.projects_nodes_io import NodeID from models_library.projects_pipeline import ComputationTask from models_library.projects_state import RunningState -from pydantic import AnyHttpUrl, AnyUrl, BaseModel, Field, PositiveInt, parse_raw_as +from pydantic.v1 import AnyHttpUrl, AnyUrl, BaseModel, Field, PositiveInt, parse_raw_as from simcore_service_api_server.exceptions.backend_errors import ( JobNotFoundError, LogFileNotFoundError, diff --git a/services/api-server/src/simcore_service_api_server/services/jobs.py b/services/api-server/src/simcore_service_api_server/services/jobs.py index 7bc46d5ed1e..7e6d93dc5b5 100644 --- a/services/api-server/src/simcore_service_api_server/services/jobs.py +++ b/services/api-server/src/simcore_service_api_server/services/jobs.py @@ -5,7 +5,7 @@ from fastapi import Depends, HTTPException, Request, status from models_library.api_schemas_webserver.projects import ProjectGet from models_library.clusters import ClusterID -from pydantic import HttpUrl, PositiveInt +from pydantic.v1 import HttpUrl, PositiveInt from servicelib.logging_utils import log_context from ..api.dependencies.authentication import get_current_user_id diff --git a/services/api-server/src/simcore_service_api_server/services/log_streaming.py b/services/api-server/src/simcore_service_api_server/services/log_streaming.py index faefc5c905b..3a5ed13aff2 100644 --- a/services/api-server/src/simcore_service_api_server/services/log_streaming.py +++ b/services/api-server/src/simcore_service_api_server/services/log_streaming.py @@ -6,7 +6,7 @@ from models_library.rabbitmq_messages import LoggerRabbitMessage from models_library.users import UserID -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.error_codes import create_error_code from servicelib.logging_utils import log_catch from servicelib.rabbitmq import RabbitMQClient diff --git a/services/api-server/src/simcore_service_api_server/services/solver_job_models_converters.py b/services/api-server/src/simcore_service_api_server/services/solver_job_models_converters.py index 137463e1263..af31e5cb5c2 100644 --- a/services/api-server/src/simcore_service_api_server/services/solver_job_models_converters.py +++ b/services/api-server/src/simcore_service_api_server/services/solver_job_models_converters.py @@ -13,7 +13,7 @@ from models_library.api_schemas_webserver.projects import ProjectCreateNew, ProjectGet from models_library.basic_types import KeyIDStr from models_library.projects_nodes import InputID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..models.basic_types import VersionStr from ..models.domain.projects import InputTypes, Node, SimCoreFileLink, StudyUI diff --git a/services/api-server/src/simcore_service_api_server/services/solver_job_outputs.py b/services/api-server/src/simcore_service_api_server/services/solver_job_outputs.py index 27ce26bd8f0..94850b6300c 100644 --- a/services/api-server/src/simcore_service_api_server/services/solver_job_outputs.py +++ b/services/api-server/src/simcore_service_api_server/services/solver_job_outputs.py @@ -4,7 +4,7 @@ import aiopg from models_library.projects import ProjectID, ProjectIDStr from models_library.projects_nodes_io import BaseFileLink, NodeID, NodeIDStr -from pydantic import StrictBool, StrictFloat, StrictInt, parse_obj_as +from pydantic.v1 import StrictBool, StrictFloat, StrictInt, parse_obj_as from simcore_sdk import node_ports_v2 from simcore_sdk.node_ports_v2 import DBManager, Nodeports from simcore_service_api_server.exceptions.backend_errors import ( diff --git a/services/api-server/src/simcore_service_api_server/services/storage.py b/services/api-server/src/simcore_service_api_server/services/storage.py index 13920d8a931..d91bc304f3e 100644 --- a/services/api-server/src/simcore_service_api_server/services/storage.py +++ b/services/api-server/src/simcore_service_api_server/services/storage.py @@ -13,7 +13,7 @@ from models_library.api_schemas_storage import FileUploadSchema, PresignedLink from models_library.basic_types import SHA256Str from models_library.generics import Envelope -from pydantic import AnyUrl, PositiveInt +from pydantic.v1 import AnyUrl, PositiveInt from starlette.datastructures import URL from ..core.settings import StorageSettings diff --git a/services/api-server/src/simcore_service_api_server/services/study_job_models_converters.py b/services/api-server/src/simcore_service_api_server/services/study_job_models_converters.py index 8258e67129b..15b5c3213a3 100644 --- a/services/api-server/src/simcore_service_api_server/services/study_job_models_converters.py +++ b/services/api-server/src/simcore_service_api_server/services/study_job_models_converters.py @@ -13,7 +13,7 @@ from models_library.projects import DateTimeStr from models_library.projects_nodes import InputID from models_library.projects_nodes_io import LinkToFileTypes, NodeID, SimcoreS3FileID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..models.domain.projects import InputTypes, SimCoreFileLink from ..models.schemas.files import File diff --git a/services/api-server/src/simcore_service_api_server/services/webserver.py b/services/api-server/src/simcore_service_api_server/services/webserver.py index 0d265248dc2..3179c535dcb 100644 --- a/services/api-server/src/simcore_service_api_server/services/webserver.py +++ b/services/api-server/src/simcore_service_api_server/services/webserver.py @@ -42,7 +42,7 @@ from models_library.projects_nodes_io import NodeID from models_library.rest_pagination import Page from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.aiohttp.long_running_tasks.server import TaskStatus from servicelib.common_headers import ( X_SIMCORE_PARENT_NODE_ID, diff --git a/services/api-server/tests/unit/_with_db/conftest.py b/services/api-server/tests/unit/_with_db/conftest.py index 57450561ce4..46064a7f749 100644 --- a/services/api-server/tests/unit/_with_db/conftest.py +++ b/services/api-server/tests/unit/_with_db/conftest.py @@ -22,7 +22,7 @@ from aiopg.sa.connection import SAConnection from fastapi import FastAPI from models_library.api_schemas_api_server.api_keys import ApiKeyInDB -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from pytest_mock import MockerFixture from pytest_simcore.helpers.faker_factories import ( random_api_key, diff --git a/services/api-server/tests/unit/_with_db/test_product.py b/services/api-server/tests/unit/_with_db/test_product.py index bd14faf087e..cb3895cd9e9 100644 --- a/services/api-server/tests/unit/_with_db/test_product.py +++ b/services/api-server/tests/unit/_with_db/test_product.py @@ -18,7 +18,7 @@ from models_library.generics import Envelope from models_library.users import UserID from models_library.wallets import WalletStatus -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from simcore_service_api_server._meta import API_VTAG diff --git a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs.py b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs.py index ed3ae76cfbd..32de8b8ec50 100644 --- a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs.py +++ b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs.py @@ -18,7 +18,7 @@ from fastapi import FastAPI from models_library.services import ServiceMetaDataPublished from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyUrl, HttpUrl, parse_obj_as +from pydantic.v1 import AnyUrl, HttpUrl, parse_obj_as from respx import MockRouter from simcore_service_api_server._meta import API_VTAG from simcore_service_api_server.core.settings import ApplicationSettings diff --git a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_delete.py b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_delete.py index 000a586836a..910b27227bc 100644 --- a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_delete.py +++ b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_delete.py @@ -11,7 +11,7 @@ import pytest from faker import Faker from models_library.basic_regex import UUID_RE_BASE -from pydantic import parse_file_as +from pydantic.v1 import parse_file_as from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel from respx import MockRouter from servicelib.common_headers import ( diff --git a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_logs.py b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_logs.py index a30404606d7..0fe17c86dd2 100644 --- a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_logs.py +++ b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_logs.py @@ -17,7 +17,7 @@ from faker import Faker from fastapi import FastAPI, status from models_library.api_schemas_webserver.projects import ProjectGet -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_mock import MockFixture from pytest_simcore.simcore_webserver_projects_rest_api import GET_PROJECT from respx import MockRouter diff --git a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_metadata.py b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_metadata.py index ccf9b40b565..1c0094ecb7d 100644 --- a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_metadata.py +++ b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_metadata.py @@ -10,7 +10,7 @@ import pytest from faker import Faker from models_library.basic_regex import UUID_RE_BASE -from pydantic import parse_file_as +from pydantic.v1 import parse_file_as from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel from respx import MockRouter from simcore_service_api_server._meta import API_VTAG diff --git a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_read.py b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_read.py index 1dbf8b3fa0f..c6a1fb44bc5 100644 --- a/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_read.py +++ b/services/api-server/tests/unit/api_solvers/test_api_routers_solvers_jobs_read.py @@ -7,7 +7,7 @@ import httpx import pytest -from pydantic import parse_file_as, parse_obj_as +from pydantic.v1 import parse_file_as, parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel from respx import MockRouter from simcore_service_api_server._meta import API_VTAG diff --git a/services/api-server/tests/unit/api_studies/test_api_routers_studies_jobs_metadata.py b/services/api-server/tests/unit/api_studies/test_api_routers_studies_jobs_metadata.py index 098718c3738..cfbf509bbfe 100644 --- a/services/api-server/tests/unit/api_studies/test_api_routers_studies_jobs_metadata.py +++ b/services/api-server/tests/unit/api_studies/test_api_routers_studies_jobs_metadata.py @@ -12,7 +12,7 @@ import httpx import pytest from fastapi.encoders import jsonable_encoder -from pydantic import parse_file_as +from pydantic.v1 import parse_file_as from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel from pytest_simcore.helpers.httpx_calls_capture_parameters import PathDescription from respx import MockRouter diff --git a/services/api-server/tests/unit/api_studies/test_api_routes_studies.py b/services/api-server/tests/unit/api_studies/test_api_routes_studies.py index 1893e6e068e..a9ae6773a9e 100644 --- a/services/api-server/tests/unit/api_studies/test_api_routes_studies.py +++ b/services/api-server/tests/unit/api_studies/test_api_routes_studies.py @@ -12,7 +12,7 @@ import pytest from faker import Faker from fastapi import status -from pydantic import parse_file_as, parse_obj_as +from pydantic.v1 import parse_file_as, parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel from respx import MockRouter from servicelib.common_headers import ( diff --git a/services/api-server/tests/unit/api_studies/test_api_routes_studies_jobs.py b/services/api-server/tests/unit/api_studies/test_api_routes_studies_jobs.py index 61d91fa9d94..bde6b3fabf1 100644 --- a/services/api-server/tests/unit/api_studies/test_api_routes_studies_jobs.py +++ b/services/api-server/tests/unit/api_studies/test_api_routes_studies_jobs.py @@ -14,7 +14,7 @@ import respx from faker import Faker from fastapi import status -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import ( CreateRespxMockCallback, HttpApiCallCaptureModel, diff --git a/services/api-server/tests/unit/captures/test__mocks_captures.py b/services/api-server/tests/unit/captures/test__mocks_captures.py index 4c04cca224d..6b2bb0c2607 100644 --- a/services/api-server/tests/unit/captures/test__mocks_captures.py +++ b/services/api-server/tests/unit/captures/test__mocks_captures.py @@ -14,7 +14,7 @@ import jsonref import pytest import respx -from pydantic import parse_file_as +from pydantic.v1 import parse_file_as from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel from pytest_simcore.helpers.httpx_calls_capture_openapi import _determine_path from pytest_simcore.helpers.httpx_calls_capture_parameters import ( diff --git a/services/api-server/tests/unit/conftest.py b/services/api-server/tests/unit/conftest.py index e8324bcc0b7..0751b93e8e1 100644 --- a/services/api-server/tests/unit/conftest.py +++ b/services/api-server/tests/unit/conftest.py @@ -36,7 +36,7 @@ from models_library.users import UserID from moto.server import ThreadedMotoServer from packaging.version import Version -from pydantic import EmailStr, HttpUrl, parse_obj_as +from pydantic.v1 import EmailStr, HttpUrl, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.host import get_localhost_ip from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict diff --git a/services/api-server/tests/unit/test_api_files.py b/services/api-server/tests/unit/test_api_files.py index 4d45e0e5528..5067d1d43be 100644 --- a/services/api-server/tests/unit/test_api_files.py +++ b/services/api-server/tests/unit/test_api_files.py @@ -24,7 +24,7 @@ UploadedPart, ) from models_library.basic_types import SHA256Str -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import ( CreateRespxMockCallback, HttpApiCallCaptureModel, diff --git a/services/api-server/tests/unit/test_api_health.py b/services/api-server/tests/unit/test_api_health.py index d548c525406..d338dd31da0 100644 --- a/services/api-server/tests/unit/test_api_health.py +++ b/services/api-server/tests/unit/test_api_health.py @@ -10,7 +10,7 @@ from fastapi import FastAPI, status from httpx import AsyncClient from models_library.app_diagnostics import AppStatusCheck -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from respx import MockRouter from simcore_service_api_server._meta import API_VTAG diff --git a/services/api-server/tests/unit/test_api_solver_jobs.py b/services/api-server/tests/unit/test_api_solver_jobs.py index 524adc7300c..bc5ebfe26e2 100644 --- a/services/api-server/tests/unit/test_api_solver_jobs.py +++ b/services/api-server/tests/unit/test_api_solver_jobs.py @@ -17,7 +17,7 @@ from models_library.api_schemas_webserver.resource_usage import PricingUnitGet from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits from models_library.generics import Envelope -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import ( CreateRespxMockCallback, HttpApiCallCaptureModel, diff --git a/services/api-server/tests/unit/test_api_solvers.py b/services/api-server/tests/unit/test_api_solvers.py index dada48a762c..feafd106578 100644 --- a/services/api-server/tests/unit/test_api_solvers.py +++ b/services/api-server/tests/unit/test_api_solvers.py @@ -10,7 +10,7 @@ from fastapi import status from httpx import AsyncClient from models_library.api_schemas_api_server.pricing_plans import ServicePricingPlanGet -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import CreateRespxMockCallback from simcore_service_api_server._meta import API_VTAG diff --git a/services/api-server/tests/unit/test_api_wallets.py b/services/api-server/tests/unit/test_api_wallets.py index 0edf09e7f90..fea59ebd7f6 100644 --- a/services/api-server/tests/unit/test_api_wallets.py +++ b/services/api-server/tests/unit/test_api_wallets.py @@ -11,7 +11,7 @@ from fastapi import status from httpx import AsyncClient from models_library.api_schemas_webserver.wallets import WalletGetWithAvailableCredits -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.httpx_calls_capture_models import ( CreateRespxMockCallback, HttpApiCallCaptureModel, diff --git a/services/api-server/tests/unit/test_models.py b/services/api-server/tests/unit/test_models.py index 06ee47d86c4..5e1915bc0fa 100644 --- a/services/api-server/tests/unit/test_models.py +++ b/services/api-server/tests/unit/test_models.py @@ -8,7 +8,7 @@ import pytest import simcore_service_api_server.models -from pydantic import BaseModel +from pydantic.v1 import BaseModel from pytest_simcore.pydantic_models import walk_model_examples_in_package from simcore_postgres_database.models.users import UserRole from simcore_service_api_server.models.schemas.profiles import UserRoleEnum diff --git a/services/api-server/tests/unit/test_models_schemas_files.py b/services/api-server/tests/unit/test_models_schemas_files.py index ded5c379b58..271880db904 100644 --- a/services/api-server/tests/unit/test_models_schemas_files.py +++ b/services/api-server/tests/unit/test_models_schemas_files.py @@ -14,7 +14,7 @@ from models_library.api_schemas_storage import FileMetaDataGet as StorageFileMetaData from models_library.basic_types import SHA256Str from models_library.projects_nodes_io import StorageFileID -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as from simcore_service_api_server.models.schemas.files import File from simcore_service_api_server.services.storage import to_file_api_model diff --git a/services/api-server/tests/unit/test_services_rabbitmq.py b/services/api-server/tests/unit/test_services_rabbitmq.py index ee68615c8f1..bd6cff7953c 100644 --- a/services/api-server/tests/unit/test_services_rabbitmq.py +++ b/services/api-server/tests/unit/test_services_rabbitmq.py @@ -27,7 +27,7 @@ from models_library.projects_state import RunningState from models_library.rabbitmq_messages import LoggerRabbitMessage, RabbitMessageBase from models_library.users import UserID -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_mock import MockerFixture, MockFixture from pytest_simcore.helpers.monkeypatch_envs import ( EnvVarsDict, diff --git a/services/api-server/tests/unit/test_services_solver_job_models_converters.py b/services/api-server/tests/unit/test_services_solver_job_models_converters.py index 28f8be422f9..6fae142e9cb 100644 --- a/services/api-server/tests/unit/test_services_solver_job_models_converters.py +++ b/services/api-server/tests/unit/test_services_solver_job_models_converters.py @@ -6,7 +6,7 @@ from faker import Faker from models_library.projects import Project from models_library.projects_nodes import InputsDict, InputTypes, SimCoreFileLink -from pydantic import create_model, parse_obj_as +from pydantic.v1 import create_model, parse_obj_as from simcore_service_api_server.models.schemas.files import File from simcore_service_api_server.models.schemas.jobs import ArgumentTypes, Job, JobInputs from simcore_service_api_server.models.schemas.solvers import Solver diff --git a/services/api-server/tests/unit/test_utils_http_calls_capture.py b/services/api-server/tests/unit/test_utils_http_calls_capture.py index 536c42f36e5..e771ade0e15 100644 --- a/services/api-server/tests/unit/test_utils_http_calls_capture.py +++ b/services/api-server/tests/unit/test_utils_http_calls_capture.py @@ -13,7 +13,7 @@ import respx from faker import Faker from models_library.basic_regex import UUID_RE_BASE -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl from pytest_simcore.helpers.httpx_calls_capture_models import HttpApiCallCaptureModel diff --git a/services/autoscaling/requirements/_base.txt b/services/autoscaling/requirements/_base.txt index 0716ffccf41..e516ec36a92 100644 --- a/services/autoscaling/requirements/_base.txt +++ b/services/autoscaling/requirements/_base.txt @@ -46,6 +46,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -60,10 +62,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==23.2.0 # via # aiohttp @@ -119,24 +117,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.1 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -272,7 +256,7 @@ psutil==5.9.8 # via # -c requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt # distributed -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -300,6 +284,8 @@ pydantic==1.10.15 # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.6.2 @@ -378,7 +364,7 @@ sortedcontainers==2.4.0 # via # -c requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt # distributed -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -440,16 +426,15 @@ typing-extensions==4.11.0 # via # aiodebug # aiodocker - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer # types-aiobotocore # types-aiobotocore-ec2 # types-aiobotocore-s3 # types-aiobotocore-ssm - # uvicorn urllib3==2.2.1 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt diff --git a/services/autoscaling/requirements/_test.txt b/services/autoscaling/requirements/_test.txt index dca31f29f75..214372ccc9e 100644 --- a/services/autoscaling/requirements/_test.txt +++ b/services/autoscaling/requirements/_test.txt @@ -1,3 +1,7 @@ +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic antlr4-python3-runtime==4.13.2 # via moto anyio==4.3.0 @@ -6,10 +10,6 @@ anyio==4.3.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # redis attrs==23.2.0 # via # -c requirements/_base.txt @@ -69,11 +69,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.1 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in fakeredis==2.23.5 @@ -188,11 +183,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pytest==8.3.2 @@ -289,10 +288,6 @@ sympy==1.13.2 # via cfn-lint termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest types-aiobotocore==2.13.0 # via # -c requirements/_base.txt @@ -320,11 +315,10 @@ types-pyyaml==6.0.12.20240808 typing-extensions==4.11.0 # via # -c requirements/_base.txt - # anyio # aws-sam-translator # cfn-lint - # fakeredis # pydantic + # pydantic-core # types-aiobotocore # types-aiobotocore-ec2 # types-aiobotocore-iam diff --git a/services/autoscaling/requirements/_tools.txt b/services/autoscaling/requirements/_tools.txt index db86636a373..7a2c3f9d91b 100644 --- a/services/autoscaling/requirements/_tools.txt +++ b/services/autoscaling/requirements/_tools.txt @@ -74,22 +74,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.11.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/autoscaling/src/simcore_service_autoscaling/api/health.py b/services/autoscaling/src/simcore_service_autoscaling/api/health.py index d6b0bbb5e5f..e3774a0b65b 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/api/health.py +++ b/services/autoscaling/src/simcore_service_autoscaling/api/health.py @@ -9,7 +9,7 @@ from fastapi import APIRouter, Depends, FastAPI from fastapi.responses import PlainTextResponse -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..modules.docker import get_docker_client from ..modules.ec2 import get_ec2_client diff --git a/services/autoscaling/src/simcore_service_autoscaling/constants.py b/services/autoscaling/src/simcore_service_autoscaling/constants.py index 4415d3eca2c..559e36fdac4 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/constants.py +++ b/services/autoscaling/src/simcore_service_autoscaling/constants.py @@ -2,7 +2,7 @@ from typing import Final from aws_library.ec2._models import AWSTagKey, AWSTagValue, EC2Tags -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as BUFFER_MACHINE_PULLING_EC2_TAG_KEY: Final[AWSTagKey] = parse_obj_as( AWSTagKey, "pulling" diff --git a/services/autoscaling/src/simcore_service_autoscaling/core/settings.py b/services/autoscaling/src/simcore_service_autoscaling/core/settings.py index 299293056d8..fc20efc0ee4 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/core/settings.py +++ b/services/autoscaling/src/simcore_service_autoscaling/core/settings.py @@ -13,7 +13,7 @@ ) from models_library.clusters import InternalClusterAuthentication from models_library.docker import DockerLabelKey -from pydantic import ( +from pydantic.v1 import ( AnyUrl, Field, NonNegativeInt, diff --git a/services/autoscaling/src/simcore_service_autoscaling/modules/auto_scaling_mode_computational.py b/services/autoscaling/src/simcore_service_autoscaling/modules/auto_scaling_mode_computational.py index 0e3862e51b1..4d7f11ecb52 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/modules/auto_scaling_mode_computational.py +++ b/services/autoscaling/src/simcore_service_autoscaling/modules/auto_scaling_mode_computational.py @@ -10,7 +10,7 @@ DockerLabelKey, ) from models_library.generated_models.docker_rest_api import Node -from pydantic import AnyUrl, ByteSize +from pydantic.v1 import AnyUrl, ByteSize from servicelib.logging_utils import LogLevelInt from servicelib.utils import logged_gather from types_aiobotocore_ec2.literals import InstanceTypeType diff --git a/services/autoscaling/src/simcore_service_autoscaling/modules/buffer_machines_pool_core.py b/services/autoscaling/src/simcore_service_autoscaling/modules/buffer_machines_pool_core.py index 8d6128042cd..a88e9677468 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/modules/buffer_machines_pool_core.py +++ b/services/autoscaling/src/simcore_service_autoscaling/modules/buffer_machines_pool_core.py @@ -31,7 +31,7 @@ SSMCommandExecutionTimeoutError, ) from fastapi import FastAPI -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.logging_utils import log_context from types_aiobotocore_ec2.literals import InstanceTypeType diff --git a/services/autoscaling/src/simcore_service_autoscaling/modules/dask.py b/services/autoscaling/src/simcore_service_autoscaling/modules/dask.py index edb02d40e2f..75e45b61926 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/modules/dask.py +++ b/services/autoscaling/src/simcore_service_autoscaling/modules/dask.py @@ -12,7 +12,7 @@ from aws_library.ec2 import EC2InstanceData, Resources from dask_task_models_library.resource_constraints import DaskTaskResources from models_library.clusters import InternalClusterAuthentication, TLSAuthentication -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from ..core.errors import ( DaskNoWorkersError, diff --git a/services/autoscaling/src/simcore_service_autoscaling/utils/buffer_machines_pool_core.py b/services/autoscaling/src/simcore_service_autoscaling/utils/buffer_machines_pool_core.py index 133708001ae..2bc6e2d1bf4 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/utils/buffer_machines_pool_core.py +++ b/services/autoscaling/src/simcore_service_autoscaling/utils/buffer_machines_pool_core.py @@ -5,7 +5,7 @@ from fastapi import FastAPI from models_library.docker import DockerGenericTag from models_library.utils.json_serialization import json_dumps -from pydantic import parse_obj_as, parse_raw_as +from pydantic.v1 import parse_obj_as, parse_raw_as from ..constants import ( ACTIVATED_BUFFER_MACHINE_EC2_TAGS, diff --git a/services/autoscaling/src/simcore_service_autoscaling/utils/utils_docker.py b/services/autoscaling/src/simcore_service_autoscaling/utils/utils_docker.py index fe782f66b2a..c665a872243 100644 --- a/services/autoscaling/src/simcore_service_autoscaling/utils/utils_docker.py +++ b/services/autoscaling/src/simcore_service_autoscaling/utils/utils_docker.py @@ -29,7 +29,7 @@ Task, TaskState, ) -from pydantic import ByteSize, ValidationError, parse_obj_as +from pydantic.v1 import ByteSize, ValidationError, parse_obj_as from servicelib.docker_utils import to_datetime from servicelib.logging_utils import log_context from servicelib.utils import logged_gather diff --git a/services/autoscaling/tests/unit/conftest.py b/services/autoscaling/tests/unit/conftest.py index 77609220f47..65c4adc12d2 100644 --- a/services/autoscaling/tests/unit/conftest.py +++ b/services/autoscaling/tests/unit/conftest.py @@ -44,7 +44,7 @@ ResourceObject, Service, ) -from pydantic import ByteSize, PositiveInt, parse_obj_as +from pydantic.v1 import ByteSize, PositiveInt, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.host import get_localhost_ip from pytest_simcore.helpers.logging_tools import log_context diff --git a/services/autoscaling/tests/unit/test_core_settings.py b/services/autoscaling/tests/unit/test_core_settings.py index 7b99bb6bf5a..48c57fdc963 100644 --- a/services/autoscaling/tests/unit/test_core_settings.py +++ b/services/autoscaling/tests/unit/test_core_settings.py @@ -7,7 +7,7 @@ import pytest from faker import Faker -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from simcore_service_autoscaling.core.settings import ( ApplicationSettings, diff --git a/services/autoscaling/tests/unit/test_models.py b/services/autoscaling/tests/unit/test_models.py index f859ff591d6..e4df182aecb 100644 --- a/services/autoscaling/tests/unit/test_models.py +++ b/services/autoscaling/tests/unit/test_models.py @@ -10,7 +10,7 @@ import pytest from models_library.docker import DockerLabelKey, StandardSimcoreDockerLabels from models_library.generated_models.docker_rest_api import Service, Task -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as async def test_get_simcore_service_docker_labels_from_task_with_missing_labels_raises( diff --git a/services/autoscaling/tests/unit/test_modules_auto_scaling_computational.py b/services/autoscaling/tests/unit/test_modules_auto_scaling_computational.py index a1b411fa988..667e7aee985 100644 --- a/services/autoscaling/tests/unit/test_modules_auto_scaling_computational.py +++ b/services/autoscaling/tests/unit/test_modules_auto_scaling_computational.py @@ -30,7 +30,7 @@ from models_library.generated_models.docker_rest_api import Node as DockerNode from models_library.generated_models.docker_rest_api import NodeState, NodeStatus from models_library.rabbitmq_messages import RabbitAutoscalingStatusMessage -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.aws_ec2 import assert_autoscaled_computational_ec2_instances from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict diff --git a/services/autoscaling/tests/unit/test_modules_auto_scaling_dynamic.py b/services/autoscaling/tests/unit/test_modules_auto_scaling_dynamic.py index f1ee1a3c062..32c7991facb 100644 --- a/services/autoscaling/tests/unit/test_modules_auto_scaling_dynamic.py +++ b/services/autoscaling/tests/unit/test_modules_auto_scaling_dynamic.py @@ -34,7 +34,7 @@ Task, ) from models_library.rabbitmq_messages import RabbitAutoscalingStatusMessage -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock import MockType from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.aws_ec2 import assert_autoscaled_dynamic_ec2_instances diff --git a/services/autoscaling/tests/unit/test_modules_buffer_machine_core.py b/services/autoscaling/tests/unit/test_modules_buffer_machine_core.py index 4ed2452d1cd..9373445b2f3 100644 --- a/services/autoscaling/tests/unit/test_modules_buffer_machine_core.py +++ b/services/autoscaling/tests/unit/test_modules_buffer_machine_core.py @@ -21,7 +21,7 @@ from fastapi.encoders import jsonable_encoder from models_library.docker import DockerGenericTag from models_library.utils.json_serialization import json_dumps -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.aws_ec2 import ( assert_autoscaled_dynamic_warm_pools_ec2_instances, diff --git a/services/autoscaling/tests/unit/test_modules_dask.py b/services/autoscaling/tests/unit/test_modules_dask.py index 76dab6883e0..55f18e6f222 100644 --- a/services/autoscaling/tests/unit/test_modules_dask.py +++ b/services/autoscaling/tests/unit/test_modules_dask.py @@ -17,7 +17,7 @@ NoAuthentication, TLSAuthentication, ) -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from pytest_simcore.helpers.host import get_localhost_ip from simcore_service_autoscaling.core.errors import ( DaskNoWorkersError, diff --git a/services/autoscaling/tests/unit/test_utils_auto_scaling_core.py b/services/autoscaling/tests/unit/test_utils_auto_scaling_core.py index dd0983f3986..8cde54159bf 100644 --- a/services/autoscaling/tests/unit/test_utils_auto_scaling_core.py +++ b/services/autoscaling/tests/unit/test_utils_auto_scaling_core.py @@ -16,7 +16,7 @@ from faker import Faker from models_library.docker import DockerGenericTag from models_library.generated_models.docker_rest_api import Node as DockerNode -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from simcore_service_autoscaling.core.errors import Ec2InvalidDnsNameError diff --git a/services/autoscaling/tests/unit/test_utils_buffer_machines_pool_core.py b/services/autoscaling/tests/unit/test_utils_buffer_machines_pool_core.py index 84ca4baa474..1ed7379de90 100644 --- a/services/autoscaling/tests/unit/test_utils_buffer_machines_pool_core.py +++ b/services/autoscaling/tests/unit/test_utils_buffer_machines_pool_core.py @@ -6,7 +6,7 @@ from faker import Faker from fastapi import FastAPI from models_library.docker import DockerGenericTag -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict from simcore_service_autoscaling.constants import ( ACTIVATED_BUFFER_MACHINE_EC2_TAGS, diff --git a/services/autoscaling/tests/unit/test_utils_computational_scaling.py b/services/autoscaling/tests/unit/test_utils_computational_scaling.py index 97cf493b6b9..fd7941557a2 100644 --- a/services/autoscaling/tests/unit/test_utils_computational_scaling.py +++ b/services/autoscaling/tests/unit/test_utils_computational_scaling.py @@ -6,7 +6,7 @@ import pytest from aws_library.ec2 import Resources -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from simcore_service_autoscaling.models import DaskTask, DaskTaskResources from simcore_service_autoscaling.utils.computational_scaling import ( _DEFAULT_MAX_CPU, diff --git a/services/autoscaling/tests/unit/test_utils_docker.py b/services/autoscaling/tests/unit/test_utils_docker.py index 03985cfba78..fff92049201 100644 --- a/services/autoscaling/tests/unit/test_utils_docker.py +++ b/services/autoscaling/tests/unit/test_utils_docker.py @@ -30,7 +30,7 @@ Service, Task, ) -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict from servicelib.docker_utils import to_datetime diff --git a/services/autoscaling/tests/unit/test_utils_ec2.py b/services/autoscaling/tests/unit/test_utils_ec2.py index 23c5981acd2..e7e6f3d1590 100644 --- a/services/autoscaling/tests/unit/test_utils_ec2.py +++ b/services/autoscaling/tests/unit/test_utils_ec2.py @@ -6,7 +6,7 @@ import pytest from aws_library.ec2 import EC2InstanceType, Resources from faker import Faker -from pydantic import ByteSize +from pydantic.v1 import ByteSize from simcore_service_autoscaling.core.errors import ( ConfigurationError, TaskBestFittingInstanceNotFoundError, diff --git a/services/autoscaling/tests/unit/test_utils_rabbitmq.py b/services/autoscaling/tests/unit/test_utils_rabbitmq.py index 6b6308399d0..f8b33c45b0a 100644 --- a/services/autoscaling/tests/unit/test_utils_rabbitmq.py +++ b/services/autoscaling/tests/unit/test_utils_rabbitmq.py @@ -18,7 +18,7 @@ ProgressRabbitMessageNode, ProgressType, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture from servicelib.rabbitmq import BIND_TO_ALL_TOPICS, RabbitMQClient from settings_library.rabbit import RabbitSettings diff --git a/services/catalog/requirements/_base.txt b/services/catalog/requirements/_base.txt index cf3adce5de0..667aac54bf5 100644 --- a/services/catalog/requirements/_base.txt +++ b/services/catalog/requirements/_base.txt @@ -24,6 +24,8 @@ aiosignal==1.3.1 # via aiohttp alembic==1.13.1 # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -37,10 +39,7 @@ arrow==1.3.0 # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 - # via - # aiohttp - # asyncpg - # redis + # via asyncpg asyncpg==0.29.0 # via # -r requirements/_base.in @@ -71,22 +70,15 @@ email-validator==2.1.1 # via # fastapi # pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator +fastapi-cli==0.0.5 + # via fastapi faststream==0.5.10 # via -r requirements/../../../packages/service-library/requirements/_base.in frozenlist==1.4.1 @@ -187,7 +179,7 @@ prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via sqlalchemy -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -206,6 +198,14 @@ pydantic==1.10.14 # -r requirements/_base.in # fast-depends # fastapi + # pydantic-extra-types + # pydantic-settings +pydantic-core==2.20.1 + # via pydantic +pydantic-extra-types==2.9.0 + # via fastapi +pydantic-settings==2.4.0 + # via fastapi pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -214,7 +214,7 @@ python-dateutil==2.9.0.post0 # via arrow python-dotenv==1.0.1 # via - # pydantic + # pydantic-settings # uvicorn python-multipart==0.0.9 # via fastapi @@ -275,7 +275,7 @@ sqlalchemy==1.4.52 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/postgres-database/requirements/_base.in # alembic -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -297,6 +297,7 @@ typer==0.12.3 # via # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/../../../packages/settings-library/requirements/_base.in + # fastapi-cli # faststream types-python-dateutil==2.9.0.20240316 # via arrow @@ -305,12 +306,11 @@ typing-extensions==4.10.0 # aiodebug # aiodocker # alembic - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer - # uvicorn ujson==5.9.0 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -325,6 +325,7 @@ uvicorn==0.29.0 # via # -r requirements/../../../packages/service-library/requirements/_fastapi.in # fastapi + # fastapi-cli uvloop==0.19.0 # via uvicorn watchfiles==0.21.0 diff --git a/services/catalog/requirements/_test.txt b/services/catalog/requirements/_test.txt index ee25905a2e3..acad0f2b15d 100644 --- a/services/catalog/requirements/_test.txt +++ b/services/catalog/requirements/_test.txt @@ -17,10 +17,6 @@ anyio==4.3.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp attrs==23.2.0 # via # -c requirements/_base.txt @@ -45,11 +41,6 @@ coverage==7.6.1 # via pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in frozenlist==1.4.1 @@ -180,11 +171,6 @@ sqlalchemy==1.4.52 # alembic sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-psycopg2==2.9.21.20240819 # via -r requirements/_test.in types-pyyaml==6.0.12.20240808 @@ -193,7 +179,6 @@ typing-extensions==4.10.0 # via # -c requirements/_base.txt # alembic - # anyio # mypy # sqlalchemy2-stubs urllib3==2.2.2 diff --git a/services/catalog/requirements/_tools.txt b/services/catalog/requirements/_tools.txt index bc04c03d0dd..e99f6785e71 100644 --- a/services/catalog/requirements/_tools.txt +++ b/services/catalog/requirements/_tools.txt @@ -73,22 +73,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/catalog/src/simcore_service_catalog/api/dependencies/services.py b/services/catalog/src/simcore_service_catalog/api/dependencies/services.py index a5d0eba83c2..3e2dd44cf9c 100644 --- a/services/catalog/src/simcore_service_catalog/api/dependencies/services.py +++ b/services/catalog/src/simcore_service_catalog/api/dependencies/services.py @@ -9,7 +9,7 @@ from models_library.services_metadata_published import ServiceMetaDataPublished from models_library.services_resources import ResourcesDict from models_library.services_types import ServiceKey, ServiceVersion -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.fastapi.dependencies import get_app from ...core.settings import ApplicationSettings diff --git a/services/catalog/src/simcore_service_catalog/api/rest/_meta.py b/services/catalog/src/simcore_service_catalog/api/rest/_meta.py index 24369f696e1..912ba40f6da 100644 --- a/services/catalog/src/simcore_service_catalog/api/rest/_meta.py +++ b/services/catalog/src/simcore_service_catalog/api/rest/_meta.py @@ -1,7 +1,7 @@ from fastapi import APIRouter from models_library.api_schemas__common.meta import BaseMeta from models_library.basic_types import VersionStr -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..._meta import API_VERSION, API_VTAG diff --git a/services/catalog/src/simcore_service_catalog/api/rest/_services.py b/services/catalog/src/simcore_service_catalog/api/rest/_services.py index 68a9f6490ba..ed7cef3a9f7 100644 --- a/services/catalog/src/simcore_service_catalog/api/rest/_services.py +++ b/services/catalog/src/simcore_service_catalog/api/rest/_services.py @@ -10,8 +10,8 @@ from models_library.api_schemas_catalog.services import ServiceGet, ServiceUpdate from models_library.services import ServiceKey, ServiceType, ServiceVersion from models_library.services_metadata_published import ServiceMetaDataPublished -from pydantic import ValidationError -from pydantic.types import PositiveInt +from pydantic.v1 import ValidationError +from pydantic.v1.types import PositiveInt from servicelib.fastapi.requests_decorators import cancel_on_disconnect from starlette.requests import Request diff --git a/services/catalog/src/simcore_service_catalog/api/rest/_services_resources.py b/services/catalog/src/simcore_service_catalog/api/rest/_services_resources.py index 701c4b41f3d..8c8ff277276 100644 --- a/services/catalog/src/simcore_service_catalog/api/rest/_services_resources.py +++ b/services/catalog/src/simcore_service_catalog/api/rest/_services_resources.py @@ -20,7 +20,7 @@ ServiceResourcesDictHelpers, ) from models_library.utils.docker_compose import replace_env_vars_in_compose_spec -from pydantic import parse_obj_as, parse_raw_as +from pydantic.v1 import parse_obj_as, parse_raw_as from ..._constants import RESPONSE_MODEL_POLICY, SIMCORE_SERVICE_SETTINGS_LABELS from ...db.repositories.services import ServicesRepository diff --git a/services/catalog/src/simcore_service_catalog/api/rpc/_services.py b/services/catalog/src/simcore_service_catalog/api/rpc/_services.py index cb102301ecc..46fb69344fc 100644 --- a/services/catalog/src/simcore_service_catalog/api/rpc/_services.py +++ b/services/catalog/src/simcore_service_catalog/api/rpc/_services.py @@ -12,7 +12,7 @@ from models_library.rpc_pagination import DEFAULT_NUMBER_OF_ITEMS_PER_PAGE, PageLimitInt from models_library.services_types import ServiceKey, ServiceVersion from models_library.users import UserID -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from pyinstrument import Profiler from servicelib.logging_utils import log_decorator from servicelib.rabbitmq import RPCRouter diff --git a/services/catalog/src/simcore_service_catalog/core/settings.py b/services/catalog/src/simcore_service_catalog/core/settings.py index 01781d7ded6..07e619ddfc8 100644 --- a/services/catalog/src/simcore_service_catalog/core/settings.py +++ b/services/catalog/src/simcore_service_catalog/core/settings.py @@ -7,7 +7,7 @@ ) from models_library.basic_types import BootModeEnum, BuildTargetEnum, LogLevel from models_library.services_resources import ResourcesDict -from pydantic import ByteSize, Field, PositiveInt, parse_obj_as +from pydantic.v1 import ByteSize, Field, PositiveInt, parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.http_client_request import ClientRequestSettings from settings_library.postgres import PostgresSettings diff --git a/services/catalog/src/simcore_service_catalog/db/repositories/groups.py b/services/catalog/src/simcore_service_catalog/db/repositories/groups.py index 4f339846301..63722597200 100644 --- a/services/catalog/src/simcore_service_catalog/db/repositories/groups.py +++ b/services/catalog/src/simcore_service_catalog/db/repositories/groups.py @@ -3,8 +3,8 @@ import sqlalchemy as sa from models_library.emails import LowerCaseEmailStr from models_library.groups import GroupAtDB -from pydantic import parse_obj_as -from pydantic.types import PositiveInt +from pydantic.v1 import parse_obj_as +from pydantic.v1.types import PositiveInt from ...exceptions.errors import UninitializedGroupError from ..tables import GroupType, groups, user_to_groups, users diff --git a/services/catalog/src/simcore_service_catalog/db/repositories/projects.py b/services/catalog/src/simcore_service_catalog/db/repositories/projects.py index 5b2b2d1bbfe..cc9a446f982 100644 --- a/services/catalog/src/simcore_service_catalog/db/repositories/projects.py +++ b/services/catalog/src/simcore_service_catalog/db/repositories/projects.py @@ -2,7 +2,7 @@ import sqlalchemy as sa from models_library.services import ServiceKeyVersion -from pydantic import ValidationError +from pydantic.v1 import ValidationError from ..tables import ProjectType, projects from ._base import BaseRepository diff --git a/services/catalog/src/simcore_service_catalog/db/repositories/services.py b/services/catalog/src/simcore_service_catalog/db/repositories/services.py index afa9db295e4..92ce9a79e6a 100644 --- a/services/catalog/src/simcore_service_catalog/db/repositories/services.py +++ b/services/catalog/src/simcore_service_catalog/db/repositories/services.py @@ -15,7 +15,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.users import GroupID, UserID from psycopg2.errors import ForeignKeyViolation -from pydantic import PositiveInt, ValidationError, parse_obj_as +from pydantic.v1 import PositiveInt, ValidationError, parse_obj_as from simcore_postgres_database.utils_services import create_select_latest_services_query from sqlalchemy import literal_column from sqlalchemy.dialects.postgresql import insert as pg_insert diff --git a/services/catalog/src/simcore_service_catalog/exceptions/handlers/_validation_error.py b/services/catalog/src/simcore_service_catalog/exceptions/handlers/_validation_error.py index 23aaa1d0f4e..0ad5c8533c9 100644 --- a/services/catalog/src/simcore_service_catalog/exceptions/handlers/_validation_error.py +++ b/services/catalog/src/simcore_service_catalog/exceptions/handlers/_validation_error.py @@ -2,7 +2,7 @@ from fastapi.exceptions import RequestValidationError from fastapi.openapi.constants import REF_PREFIX from fastapi.openapi.utils import validation_error_response_definition -from pydantic import ValidationError +from pydantic.v1 import ValidationError from starlette.requests import Request from starlette.responses import JSONResponse from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY diff --git a/services/catalog/src/simcore_service_catalog/models/services_db.py b/services/catalog/src/simcore_service_catalog/models/services_db.py index c357502bc46..34c9f9abf6a 100644 --- a/services/catalog/src/simcore_service_catalog/models/services_db.py +++ b/services/catalog/src/simcore_service_catalog/models/services_db.py @@ -6,8 +6,8 @@ from models_library.services_base import ServiceKeyVersion from models_library.services_metadata_editable import ServiceMetaDataEditable from models_library.services_types import ServiceKey, ServiceVersion -from pydantic import BaseModel, Field -from pydantic.types import PositiveInt +from pydantic.v1 import BaseModel, Field +from pydantic.v1.types import PositiveInt from simcore_postgres_database.models.services_compatibility import CompatiblePolicyDict diff --git a/services/catalog/src/simcore_service_catalog/services/access_rights.py b/services/catalog/src/simcore_service_catalog/services/access_rights.py index 8e1f485b0d7..0d1ae45a4d5 100644 --- a/services/catalog/src/simcore_service_catalog/services/access_rights.py +++ b/services/catalog/src/simcore_service_catalog/services/access_rights.py @@ -14,7 +14,7 @@ from models_library.services import ServiceMetaDataPublished from models_library.services_types import ServiceKey, ServiceVersion from packaging.version import Version -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt from sqlalchemy.ext.asyncio import AsyncEngine from ..api.dependencies.director import get_director_api diff --git a/services/catalog/src/simcore_service_catalog/services/compatibility.py b/services/catalog/src/simcore_service_catalog/services/compatibility.py index 1e9ea2b9a48..8f20455b6f4 100644 --- a/services/catalog/src/simcore_service_catalog/services/compatibility.py +++ b/services/catalog/src/simcore_service_catalog/services/compatibility.py @@ -8,7 +8,7 @@ from models_library.users import UserID from packaging.specifiers import SpecifierSet from packaging.version import Version -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_catalog.utils.versioning import as_version from ..db.repositories.services import ServicesRepository diff --git a/services/catalog/src/simcore_service_catalog/services/manifest.py b/services/catalog/src/simcore_service_catalog/services/manifest.py index aa6caf52618..3f7cd2c0462 100644 --- a/services/catalog/src/simcore_service_catalog/services/manifest.py +++ b/services/catalog/src/simcore_service_catalog/services/manifest.py @@ -31,7 +31,7 @@ from models_library.function_services_catalog.api import iter_service_docker_data from models_library.services_metadata_published import ServiceMetaDataPublished from models_library.services_types import ServiceKey, ServiceVersion -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.utils import limited_gather from .._constants import DIRECTOR_CACHING_TTL diff --git a/services/catalog/src/simcore_service_catalog/services/services_api.py b/services/catalog/src/simcore_service_catalog/services/services_api.py index af4721b07b9..e4db3e43725 100644 --- a/services/catalog/src/simcore_service_catalog/services/services_api.py +++ b/services/catalog/src/simcore_service_catalog/services/services_api.py @@ -9,7 +9,7 @@ from models_library.services_metadata_published import ServiceMetaDataPublished from models_library.services_types import ServiceKey, ServiceVersion from models_library.users import UserID -from pydantic import HttpUrl, NonNegativeInt, parse_obj_as +from pydantic.v1 import HttpUrl, NonNegativeInt, parse_obj_as from servicelib.rabbitmq.rpc_interfaces.catalog.errors import ( CatalogForbiddenError, CatalogItemNotFoundError, diff --git a/services/catalog/tests/unit/conftest.py b/services/catalog/tests/unit/conftest.py index 6069514b085..8b033d3794e 100644 --- a/services/catalog/tests/unit/conftest.py +++ b/services/catalog/tests/unit/conftest.py @@ -22,7 +22,7 @@ from fastapi import FastAPI, status from fastapi.testclient import TestClient from packaging.version import Version -from pydantic import EmailStr +from pydantic.v1 import EmailStr from pytest_mock import MockerFixture, MockType from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/catalog/tests/unit/with_dbs/conftest.py b/services/catalog/tests/unit/with_dbs/conftest.py index 1681622314f..e2902443c2d 100644 --- a/services/catalog/tests/unit/with_dbs/conftest.py +++ b/services/catalog/tests/unit/with_dbs/conftest.py @@ -17,7 +17,7 @@ from models_library.products import ProductName from models_library.services import ServiceMetaDataPublished from models_library.users import UserID -from pydantic import Extra, parse_obj_as +from pydantic.v1 import Extra, parse_obj_as from pytest_simcore.helpers.faker_factories import ( random_service_access_rights, random_service_meta_data, diff --git a/services/catalog/tests/unit/with_dbs/test_api_rest_services__list.py b/services/catalog/tests/unit/with_dbs/test_api_rest_services__list.py index 4b0bd5dceb6..833d8d9bffc 100644 --- a/services/catalog/tests/unit/with_dbs/test_api_rest_services__list.py +++ b/services/catalog/tests/unit/with_dbs/test_api_rest_services__list.py @@ -13,7 +13,7 @@ from models_library.products import ProductName from models_library.services import ServiceMetaDataPublished from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from respx.router import MockRouter from starlette import status from starlette.testclient import TestClient diff --git a/services/catalog/tests/unit/with_dbs/test_api_rest_services_access_rights.py b/services/catalog/tests/unit/with_dbs/test_api_rest_services_access_rights.py index 87ac133a0df..9756461a567 100644 --- a/services/catalog/tests/unit/with_dbs/test_api_rest_services_access_rights.py +++ b/services/catalog/tests/unit/with_dbs/test_api_rest_services_access_rights.py @@ -14,7 +14,7 @@ ServiceAccessRightsGet, ) from models_library.products import ProductName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from respx.router import MockRouter from starlette.testclient import TestClient from yarl import URL diff --git a/services/catalog/tests/unit/with_dbs/test_api_rest_services_resources.py b/services/catalog/tests/unit/with_dbs/test_api_rest_services_resources.py index 1ea7e40f18f..ce2adf91c90 100644 --- a/services/catalog/tests/unit/with_dbs/test_api_rest_services_resources.py +++ b/services/catalog/tests/unit/with_dbs/test_api_rest_services_resources.py @@ -21,7 +21,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from respx.models import Route from simcore_service_catalog.core.settings import _DEFAULT_RESOURCES from starlette.testclient import TestClient diff --git a/services/catalog/tests/unit/with_dbs/test_api_rpc.py b/services/catalog/tests/unit/with_dbs/test_api_rpc.py index 499683ecdff..62e131db88b 100644 --- a/services/catalog/tests/unit/with_dbs/test_api_rpc.py +++ b/services/catalog/tests/unit/with_dbs/test_api_rpc.py @@ -14,7 +14,7 @@ from models_library.rest_pagination import MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE from models_library.services_types import ServiceKey, ServiceVersion from models_library.users import UserID -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.faker_factories import random_user from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.postgres_tools import insert_and_get_row_lifespan diff --git a/services/catalog/tests/unit/with_dbs/test_db_repositories.py b/services/catalog/tests/unit/with_dbs/test_db_repositories.py index 3438492f740..b8afa44e93d 100644 --- a/services/catalog/tests/unit/with_dbs/test_db_repositories.py +++ b/services/catalog/tests/unit/with_dbs/test_db_repositories.py @@ -10,7 +10,7 @@ from models_library.users import UserID from packaging import version from packaging.version import Version -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from simcore_service_catalog.db.repositories.services import ServicesRepository from simcore_service_catalog.models.services_db import ( ServiceAccessRightsAtDB, diff --git a/services/catalog/tests/unit/with_dbs/test_services_access_rights.py b/services/catalog/tests/unit/with_dbs/test_services_access_rights.py index d4506855f6d..3f572248cc1 100644 --- a/services/catalog/tests/unit/with_dbs/test_services_access_rights.py +++ b/services/catalog/tests/unit/with_dbs/test_services_access_rights.py @@ -8,7 +8,7 @@ from models_library.groups import GroupAtDB from models_library.products import ProductName from models_library.services import ServiceMetaDataPublished, ServiceVersion -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_catalog.db.repositories.services import ServicesRepository from simcore_service_catalog.models.services_db import ServiceAccessRightsAtDB from simcore_service_catalog.services.access_rights import ( diff --git a/services/clusters-keeper/requirements/_base.txt b/services/clusters-keeper/requirements/_base.txt index 5c2cff64acf..3b99ea6418c 100644 --- a/services/clusters-keeper/requirements/_base.txt +++ b/services/clusters-keeper/requirements/_base.txt @@ -43,6 +43,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -57,10 +59,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==23.2.0 # via # aiohttp @@ -116,24 +114,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.1 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -269,7 +253,7 @@ psutil==5.9.8 # via # -c requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt # distributed -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -297,6 +281,8 @@ pydantic==1.10.15 # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.6.2 @@ -375,7 +361,7 @@ sortedcontainers==2.4.0 # via # -c requirements/../../../services/dask-sidecar/requirements/_dask-distributed.txt # distributed -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -437,16 +423,15 @@ typing-extensions==4.11.0 # via # aiodebug # aiodocker - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer # types-aiobotocore # types-aiobotocore-ec2 # types-aiobotocore-s3 # types-aiobotocore-ssm - # uvicorn urllib3==2.2.1 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt diff --git a/services/clusters-keeper/requirements/_test.txt b/services/clusters-keeper/requirements/_test.txt index 3539d24ebad..e39b711ef51 100644 --- a/services/clusters-keeper/requirements/_test.txt +++ b/services/clusters-keeper/requirements/_test.txt @@ -11,6 +11,10 @@ aiosignal==1.3.1 # via # -c requirements/_base.txt # aiohttp +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic antlr4-python3-runtime==4.13.2 # via moto anyio==4.3.0 @@ -19,11 +23,6 @@ anyio==4.3.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp - # redis attrs==23.2.0 # via # -c requirements/_base.txt @@ -82,11 +81,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.1 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in fakeredis==2.23.5 @@ -209,11 +203,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pytest==8.3.2 @@ -302,21 +300,16 @@ sortedcontainers==2.4.0 # fakeredis sympy==1.13.2 # via cfn-lint -tomli==2.0.1 - # via - # coverage - # pytest types-pyyaml==6.0.12.20240808 # via -r requirements/_test.in typing-extensions==4.11.0 # via # -c requirements/_base.txt # aiodocker - # anyio # aws-sam-translator # cfn-lint - # fakeredis # pydantic + # pydantic-core urllib3==2.2.1 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/clusters-keeper/requirements/_tools.txt b/services/clusters-keeper/requirements/_tools.txt index db86636a373..7a2c3f9d91b 100644 --- a/services/clusters-keeper/requirements/_tools.txt +++ b/services/clusters-keeper/requirements/_tools.txt @@ -74,22 +74,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.11.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py index 828216222aa..68bd5d414e8 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/_meta.py @@ -9,7 +9,7 @@ from models_library.basic_types import VersionStr, VersionTag from packaging.version import Version -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as _current_distribution = distribution("simcore-service-clusters-keeper") __version__: str = version("simcore-service-clusters-keeper") diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/api/health.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/api/health.py index ad2882da3c8..5fe726c6ba2 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/api/health.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/api/health.py @@ -9,7 +9,7 @@ from fastapi import APIRouter, Depends, FastAPI from fastapi.responses import PlainTextResponse -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..modules.rabbitmq import get_rabbitmq_client, is_rabbitmq_enabled from ..modules.redis import get_redis_client diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/core/errors.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/core/errors.py index 068a13f702e..c0885ba4392 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/core/errors.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/core/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class ClustersKeeperRuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/core/settings.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/core/settings.py index 3c1e69d85a2..f461b2ed09b 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/core/settings.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/core/settings.py @@ -11,7 +11,7 @@ VersionTag, ) from models_library.clusters import InternalClusterAuthentication -from pydantic import ( +from pydantic.v1 import ( Field, NonNegativeFloat, NonNegativeInt, diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/clusters_management_core.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/clusters_management_core.py index a7c23143a0b..eb02293ecd0 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/clusters_management_core.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/clusters_management_core.py @@ -8,7 +8,7 @@ from fastapi import FastAPI from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.logging_utils import log_catch from ..core.settings import get_application_settings diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/dask.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/dask.py index de585dc654f..c585e10d6c7 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/dask.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/modules/dask.py @@ -4,7 +4,7 @@ import distributed from models_library.clusters import InternalClusterAuthentication, TLSAuthentication -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl _logger = logging.getLogger(__name__) diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/dask.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/dask.py index 957644f6346..2c50f325eeb 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/dask.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/dask.py @@ -1,7 +1,7 @@ from aws_library.ec2 import EC2InstanceData from fastapi import FastAPI from models_library.clusters import InternalClusterAuthentication -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from ..core.settings import get_application_settings diff --git a/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/ec2.py b/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/ec2.py index c74bbc554d9..157fab5985c 100644 --- a/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/ec2.py +++ b/services/clusters-keeper/src/simcore_service_clusters_keeper/utils/ec2.py @@ -4,7 +4,7 @@ from aws_library.ec2 import AWSTagKey, AWSTagValue, EC2Tags from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from .._meta import VERSION from ..core.settings import ApplicationSettings diff --git a/services/clusters-keeper/tests/unit/test_core_settings.py b/services/clusters-keeper/tests/unit/test_core_settings.py index 0e467dc1e67..d1b990bc759 100644 --- a/services/clusters-keeper/tests/unit/test_core_settings.py +++ b/services/clusters-keeper/tests/unit/test_core_settings.py @@ -8,7 +8,7 @@ import pytest from aws_library.ec2 import EC2InstanceBootSpecific -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from simcore_service_clusters_keeper.core.settings import ApplicationSettings from types_aiobotocore_ec2.literals import InstanceTypeType diff --git a/services/clusters-keeper/tests/unit/test_modules_dask.py b/services/clusters-keeper/tests/unit/test_modules_dask.py index db1833ffd91..194204472f4 100644 --- a/services/clusters-keeper/tests/unit/test_modules_dask.py +++ b/services/clusters-keeper/tests/unit/test_modules_dask.py @@ -12,7 +12,7 @@ NoAuthentication, TLSAuthentication, ) -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from simcore_service_clusters_keeper.modules.dask import ( is_scheduler_busy, ping_scheduler, diff --git a/services/clusters-keeper/tests/unit/test_utils_clusters.py b/services/clusters-keeper/tests/unit/test_utils_clusters.py index a6592ed1fa4..3a5c2abca5f 100644 --- a/services/clusters-keeper/tests/unit/test_utils_clusters.py +++ b/services/clusters-keeper/tests/unit/test_utils_clusters.py @@ -23,7 +23,7 @@ TLSAuthentication, ) from models_library.utils.json_serialization import json_dumps -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from simcore_service_clusters_keeper.core.settings import ApplicationSettings from simcore_service_clusters_keeper.utils.clusters import ( diff --git a/services/dask-sidecar/requirements/_base.txt b/services/dask-sidecar/requirements/_base.txt index cca6d21ea7a..d3a35e96920 100644 --- a/services/dask-sidecar/requirements/_base.txt +++ b/services/dask-sidecar/requirements/_base.txt @@ -34,6 +34,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -44,10 +46,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==23.2.0 # via # aiohttp @@ -88,8 +86,6 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.1 - # via anyio fast-depends==2.4.2 # via faststream faststream==0.5.10 @@ -187,7 +183,7 @@ prometheus-client==0.20.0 # via -r requirements/_base.in psutil==5.9.8 # via distributed -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt @@ -208,6 +204,8 @@ pydantic==1.10.15 # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/_base.in # fast-depends +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.6.2 @@ -217,8 +215,6 @@ python-dateutil==2.9.0.post0 # arrow # botocore # pandas -python-dotenv==1.0.1 - # via pydantic pytz==2024.1 # via pandas pyyaml==6.0.1 @@ -303,9 +299,9 @@ typing-extensions==4.11.0 # via # aiodebug # aiodocker - # anyio # faststream # pydantic + # pydantic-core # typer tzdata==2024.1 # via pandas diff --git a/services/dask-sidecar/requirements/_test.txt b/services/dask-sidecar/requirements/_test.txt index 787ef0f3be8..15e7f8662ae 100644 --- a/services/dask-sidecar/requirements/_test.txt +++ b/services/dask-sidecar/requirements/_test.txt @@ -1,3 +1,7 @@ +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic antlr4-python3-runtime==4.13.2 # via moto attrs==23.2.0 @@ -50,10 +54,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.1 - # via - # -c requirements/_base.txt - # pytest faker==27.0.0 # via -r requirements/_test.in flask==3.0.3 @@ -142,11 +142,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyftpdlib==1.5.10 # via pytest-localftpserver pyopenssl==24.2.1 @@ -186,9 +190,7 @@ python-dateutil==2.9.0.post0 # faker # moto python-dotenv==1.0.1 - # via - # -c requirements/_base.txt - # -r requirements/_test.in + # via -r requirements/_test.in pyyaml==6.0.1 # via # -c requirements/../../../requirements/constraints.txt @@ -234,10 +236,6 @@ sympy==1.13.2 # via cfn-lint termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in typing-extensions==4.11.0 @@ -246,6 +244,7 @@ typing-extensions==4.11.0 # aws-sam-translator # cfn-lint # pydantic + # pydantic-core urllib3==2.2.1 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/dask-sidecar/requirements/_tools.txt b/services/dask-sidecar/requirements/_tools.txt index db86636a373..7a2c3f9d91b 100644 --- a/services/dask-sidecar/requirements/_tools.txt +++ b/services/dask-sidecar/requirements/_tools.txt @@ -74,22 +74,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.11.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/core.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/core.py index 63e9bc97a1b..3b28d1d4a5b 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/core.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/core.py @@ -19,8 +19,8 @@ from models_library.basic_types import IDStr from models_library.progress_bar import ProgressReport from packaging import version -from pydantic import ValidationError -from pydantic.networks import AnyUrl +from pydantic.v1 import ValidationError +from pydantic.v1.networks import AnyUrl from servicelib.logging_utils import LogLevelInt, LogMessageStr from servicelib.progress_bar import ProgressBarData from settings_library.s3 import S3Settings diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/docker_utils.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/docker_utils.py index 0a2d9e3e9d3..8d54e8c0ec4 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/docker_utils.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/docker_utils.py @@ -26,7 +26,7 @@ from models_library.services_resources import BootMode from models_library.utils.labels_annotations import OSPARC_LABEL_PREFIXES, from_labels from packaging import version -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.logging_utils import ( LogLevelInt, LogMessageStr, diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/errors.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/errors.py index eabe5f00d03..0b3a134d0b4 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/errors.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class ComputationalSidecarRuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/models.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/models.py index 691192716e9..f40e263a8a9 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/models.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/computational_sidecar/models.py @@ -3,7 +3,7 @@ from models_library.basic_regex import SIMPLE_VERSION_RE from models_library.services import ServiceMetaDataPublished from packaging import version -from pydantic import BaseModel, ByteSize, Extra, Field, validator +from pydantic.v1 import BaseModel, ByteSize, Extra, Field, validator LEGACY_INTEGRATION_VERSION = version.Version("0") PROGRESS_REGEXP: re.Pattern[str] = re.compile( diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/file_utils.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/file_utils.py index a508642fdd6..a20558dbeab 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/file_utils.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/file_utils.py @@ -12,8 +12,8 @@ import aiofiles import aiofiles.tempfile import fsspec # type: ignore[import-untyped] -from pydantic import ByteSize, FileUrl, parse_obj_as -from pydantic.networks import AnyUrl +from pydantic.v1 import ByteSize, FileUrl, parse_obj_as +from pydantic.v1.networks import AnyUrl from servicelib.logging_utils import LogLevelInt, LogMessageStr from settings_library.s3 import S3Settings from yarl import URL diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/settings.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/settings.py index 80661c7ecb2..8cd19c02811 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/settings.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/settings.py @@ -2,7 +2,7 @@ from typing import Any from models_library.basic_types import LogLevel -from pydantic import Field, validator +from pydantic.v1 import Field, validator from settings_library.base import BaseCustomSettings from settings_library.utils_logging import MixinLoggingSettings diff --git a/services/dask-sidecar/src/simcore_service_dask_sidecar/utils.py b/services/dask-sidecar/src/simcore_service_dask_sidecar/utils.py index 936d54a3377..da3f600bfbc 100644 --- a/services/dask-sidecar/src/simcore_service_dask_sidecar/utils.py +++ b/services/dask-sidecar/src/simcore_service_dask_sidecar/utils.py @@ -6,7 +6,7 @@ import aiodocker from aiodocker.containers import DockerContainer -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as logger = logging.getLogger(__name__) diff --git a/services/dask-sidecar/tests/unit/conftest.py b/services/dask-sidecar/tests/unit/conftest.py index edc92c87969..6c9ca7d2629 100644 --- a/services/dask-sidecar/tests/unit/conftest.py +++ b/services/dask-sidecar/tests/unit/conftest.py @@ -19,7 +19,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.users import UserID -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from pytest_localftpserver.servers import ProcessFTPServer from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict diff --git a/services/dask-sidecar/tests/unit/test_file_utils.py b/services/dask-sidecar/tests/unit/test_file_utils.py index 2ca64008962..f27268156e5 100644 --- a/services/dask-sidecar/tests/unit/test_file_utils.py +++ b/services/dask-sidecar/tests/unit/test_file_utils.py @@ -14,7 +14,7 @@ import fsspec import pytest from faker import Faker -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from pytest_localftpserver.servers import ProcessFTPServer from pytest_mock.plugin import MockerFixture from settings_library.s3 import S3Settings diff --git a/services/dask-sidecar/tests/unit/test_models.py b/services/dask-sidecar/tests/unit/test_models.py index 65ec5304631..0781a40e1cb 100644 --- a/services/dask-sidecar/tests/unit/test_models.py +++ b/services/dask-sidecar/tests/unit/test_models.py @@ -1,6 +1,6 @@ import pytest from faker import Faker -from pydantic import ByteSize, ValidationError +from pydantic.v1 import ByteSize, ValidationError from simcore_service_dask_sidecar.computational_sidecar.models import ( ContainerHostConfig, ) diff --git a/services/dask-sidecar/tests/unit/test_tasks.py b/services/dask-sidecar/tests/unit/test_tasks.py index 4aff3a1fd3d..b65281b5fea 100644 --- a/services/dask-sidecar/tests/unit/test_tasks.py +++ b/services/dask-sidecar/tests/unit/test_tasks.py @@ -41,7 +41,7 @@ from models_library.services import ServiceMetaDataPublished from models_library.services_resources import BootMode from packaging import version -from pydantic import AnyUrl, SecretStr, parse_obj_as +from pydantic.v1 import AnyUrl, SecretStr, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.s3 import S3Settings diff --git a/services/datcore-adapter/requirements/_base.txt b/services/datcore-adapter/requirements/_base.txt index b384e50d8b3..fe72514f871 100644 --- a/services/datcore-adapter/requirements/_base.txt +++ b/services/datcore-adapter/requirements/_base.txt @@ -23,6 +23,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -35,10 +37,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==23.2.0 # via # aiohttp @@ -68,18 +66,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # fastapi-pagination @@ -158,7 +148,7 @@ prometheus-client==0.20.0 # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -176,6 +166,8 @@ pydantic==1.10.14 # fast-depends # fastapi # fastapi-pagination +pydantic-core==2.20.1 + # via pydantic pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -231,7 +223,7 @@ sniffio==1.3.1 # via # anyio # httpx -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -257,13 +249,12 @@ typing-extensions==4.10.0 # via # aiodebug # aiodocker - # anyio # fastapi # fastapi-pagination # faststream # pydantic + # pydantic-core # typer - # uvicorn urllib3==2.2.1 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt diff --git a/services/datcore-adapter/requirements/_test.txt b/services/datcore-adapter/requirements/_test.txt index f006d59e4ed..354bbbf15e0 100644 --- a/services/datcore-adapter/requirements/_test.txt +++ b/services/datcore-adapter/requirements/_test.txt @@ -23,11 +23,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # anyio - # pytest execnet==2.1.1 # via pytest-xdist faker==27.0.0 @@ -111,10 +106,6 @@ sniffio==1.3.1 # httpx termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest types-awscrt==0.21.2 # via botocore-stubs types-boto3==1.0.2 @@ -126,7 +117,6 @@ types-s3transfer==0.10.1 typing-extensions==4.10.0 # via # -c requirements/_base.txt - # anyio # boto3-stubs urllib3==2.2.1 # via diff --git a/services/datcore-adapter/requirements/_tools.txt b/services/datcore-adapter/requirements/_tools.txt index b833085b882..aeba68b6f13 100644 --- a/services/datcore-adapter/requirements/_tools.txt +++ b/services/datcore-adapter/requirements/_tools.txt @@ -69,22 +69,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py index 3d9f59a1841..6d11695e229 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/_meta.py @@ -6,7 +6,7 @@ from typing import Final from models_library.basic_types import VersionStr -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as current_distribution = distribution("simcore_service_datcore_adapter") __version__ = version("simcore_service_datcore_adapter") diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/api/errors/validation_error.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/api/errors/validation_error.py index fb70f6791ac..0ad5c8533c9 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/api/errors/validation_error.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/api/errors/validation_error.py @@ -1,10 +1,8 @@ -from typing import Union - from fastapi.encoders import jsonable_encoder from fastapi.exceptions import RequestValidationError from fastapi.openapi.constants import REF_PREFIX from fastapi.openapi.utils import validation_error_response_definition -from pydantic import ValidationError +from pydantic.v1 import ValidationError from starlette.requests import Request from starlette.responses import JSONResponse from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY @@ -12,7 +10,7 @@ async def http422_error_handler( _: Request, - exc: Union[RequestValidationError, ValidationError], + exc: RequestValidationError | ValidationError, ) -> JSONResponse: return JSONResponse( content=jsonable_encoder({"errors": exc.errors()}), diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/api/routes/files.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/api/routes/files.py index 44fdfb96599..c67dd5b1b0a 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/api/routes/files.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/api/routes/files.py @@ -2,7 +2,7 @@ from typing import Annotated, Any from fastapi import APIRouter, Depends, Header, Request -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from servicelib.fastapi.requests_decorators import cancel_on_disconnect from starlette import status diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/core/settings.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/core/settings.py index a550589571f..94208739bbe 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/core/settings.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/core/settings.py @@ -1,8 +1,8 @@ from functools import cached_property from models_library.basic_types import BootModeEnum, LogLevel -from pydantic import Field, parse_obj_as, validator -from pydantic.networks import AnyUrl +from pydantic.v1 import Field, parse_obj_as, validator +from pydantic.v1.networks import AnyUrl from settings_library.base import BaseCustomSettings from settings_library.utils_logging import MixinLoggingSettings diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/files.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/files.py index a125faaa5fd..eeb329e55f5 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/files.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/files.py @@ -1,4 +1,4 @@ -from pydantic import AnyUrl, BaseModel +from pydantic.v1 import AnyUrl, BaseModel class FileDownloadOut(BaseModel): diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/user.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/user.py index b62b56403e5..ea7311bd013 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/user.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/models/domains/user.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel # NOTE: for now only used to check if the user exists diff --git a/services/datcore-adapter/src/simcore_service_datcore_adapter/models/schemas/datasets.py b/services/datcore-adapter/src/simcore_service_datcore_adapter/models/schemas/datasets.py index 4d5190c5512..ae9ae3e7bd4 100644 --- a/services/datcore-adapter/src/simcore_service_datcore_adapter/models/schemas/datasets.py +++ b/services/datcore-adapter/src/simcore_service_datcore_adapter/models/schemas/datasets.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Any -from pydantic import BaseModel +from pydantic.v1 import BaseModel class DatasetMetaData(BaseModel): diff --git a/services/datcore-adapter/tests/unit/test_route_datasets.py b/services/datcore-adapter/tests/unit/test_route_datasets.py index 2c9c98b20f4..e43f38fa0f6 100644 --- a/services/datcore-adapter/tests/unit/test_route_datasets.py +++ b/services/datcore-adapter/tests/unit/test_route_datasets.py @@ -3,12 +3,10 @@ # pylint:disable=redefined-outer-name -from typing import Optional - import httpx import respx from fastapi_pagination import Page -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_datcore_adapter.models.schemas.datasets import ( DatasetMetaData, FileMetaData, @@ -18,7 +16,7 @@ async def test_list_datasets_entrypoint( async_client: httpx.AsyncClient, - pennsieve_subsystem_mock: Optional[respx.MockRouter], + pennsieve_subsystem_mock: respx.MockRouter | None, pennsieve_api_headers: dict[str, str], ): response = await async_client.get( diff --git a/services/datcore-adapter/tests/unit/test_route_files.py b/services/datcore-adapter/tests/unit/test_route_files.py index 840a7edf79f..1e73186e59d 100644 --- a/services/datcore-adapter/tests/unit/test_route_files.py +++ b/services/datcore-adapter/tests/unit/test_route_files.py @@ -5,7 +5,7 @@ from unittest.mock import Mock import httpx -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_datcore_adapter.models.domains.files import FileDownloadOut from starlette import status diff --git a/services/director-v2/requirements/_base.txt b/services/director-v2/requirements/_base.txt index 41696797fe8..9e190ecb047 100644 --- a/services/director-v2/requirements/_base.txt +++ b/services/director-v2/requirements/_base.txt @@ -55,6 +55,8 @@ alembic==1.13.1 # via # -r requirements/../../../packages/postgres-database/requirements/_base.in # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -73,10 +75,8 @@ arrow==1.3.0 # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 # via - # aiohttp # aiopg # asyncpg - # redis asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -141,32 +141,15 @@ email-validator==2.1.1 # via # fastapi # pydantic -exceptiongroup==1.2.1 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/dask-task-models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator +fastapi-cli==0.0.5 + # via fastapi faststream==0.5.10 # via # -r requirements/../../../packages/service-library/requirements/_base.in @@ -360,7 +343,7 @@ psycopg2-binary==2.9.9 # via # aiopg # sqlalchemy -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt @@ -399,6 +382,14 @@ pydantic==1.10.15 # -r requirements/_base.in # fast-depends # fastapi + # pydantic-extra-types + # pydantic-settings +pydantic-core==2.20.1 + # via pydantic +pydantic-extra-types==2.9.0 + # via fastapi +pydantic-settings==2.4.0 + # via fastapi pygments==2.18.0 # via rich pyinstrument==4.6.2 @@ -409,7 +400,7 @@ python-dateutil==2.9.0.post0 # via arrow python-dotenv==1.0.1 # via - # pydantic + # pydantic-settings # uvicorn python-engineio==4.9.1 # via python-socketio @@ -523,7 +514,7 @@ sqlalchemy==1.4.52 # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aiopg # alembic -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt @@ -578,6 +569,7 @@ typer==0.12.3 # -r requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/_base.in + # fastapi-cli # faststream types-python-dateutil==2.9.0.20240316 # via arrow @@ -586,13 +578,12 @@ typing-extensions==4.11.0 # aiodebug # aiodocker # alembic - # anyio # fastapi # faststream # pint # pydantic + # pydantic-core # typer - # uvicorn ujson==5.10.0 # via # -c requirements/../../../packages/dask-task-models-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -638,6 +629,7 @@ uvicorn==0.29.0 # via # -r requirements/../../../packages/service-library/requirements/_fastapi.in # fastapi + # fastapi-cli uvloop==0.19.0 # via uvicorn watchfiles==0.21.0 diff --git a/services/director-v2/requirements/_test.txt b/services/director-v2/requirements/_test.txt index 4d1d11143d3..4806e20e36a 100644 --- a/services/director-v2/requirements/_test.txt +++ b/services/director-v2/requirements/_test.txt @@ -38,10 +38,6 @@ asgi-lifespan==2.1.0 # via -r requirements/_test.in async-asgi-testclient==1.4.11 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp attrs==23.2.0 # via # -c requirements/_base.txt @@ -100,11 +96,6 @@ distributed==2024.5.1 # dask docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.1 - # via - # -c requirements/_base.txt - # anyio - # pytest execnet==2.1.1 # via pytest-xdist faker==27.0.0 @@ -303,11 +294,6 @@ tblib==3.0.0 # via # -c requirements/_base.txt # distributed -tomli==2.0.1 - # via - # coverage - # mypy - # pytest toolz==0.12.1 # via # -c requirements/_base.txt @@ -331,7 +317,6 @@ typing-extensions==4.11.0 # via # -c requirements/_base.txt # alembic - # anyio # mypy # sqlalchemy2-stubs tzdata==2024.1 diff --git a/services/director-v2/requirements/_tools.txt b/services/director-v2/requirements/_tools.txt index ea37071c1ad..261bbf16bef 100644 --- a/services/director-v2/requirements/_tools.txt +++ b/services/director-v2/requirements/_tools.txt @@ -75,22 +75,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.11.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/director-v2/src/simcore_service_director_v2/api/errors/validation_error.py b/services/director-v2/src/simcore_service_director_v2/api/errors/validation_error.py index fb70f6791ac..0ad5c8533c9 100644 --- a/services/director-v2/src/simcore_service_director_v2/api/errors/validation_error.py +++ b/services/director-v2/src/simcore_service_director_v2/api/errors/validation_error.py @@ -1,10 +1,8 @@ -from typing import Union - from fastapi.encoders import jsonable_encoder from fastapi.exceptions import RequestValidationError from fastapi.openapi.constants import REF_PREFIX from fastapi.openapi.utils import validation_error_response_definition -from pydantic import ValidationError +from pydantic.v1 import ValidationError from starlette.requests import Request from starlette.responses import JSONResponse from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY @@ -12,7 +10,7 @@ async def http422_error_handler( _: Request, - exc: Union[RequestValidationError, ValidationError], + exc: RequestValidationError | ValidationError, ) -> JSONResponse: return JSONResponse( content=jsonable_encoder({"errors": exc.errors()}), diff --git a/services/director-v2/src/simcore_service_director_v2/api/routes/computations.py b/services/director-v2/src/simcore_service_director_v2/api/routes/computations.py index cea6e18770d..8e55df056ca 100644 --- a/services/director-v2/src/simcore_service_director_v2/api/routes/computations.py +++ b/services/director-v2/src/simcore_service_director_v2/api/routes/computations.py @@ -35,7 +35,7 @@ from models_library.services import ServiceKeyVersion from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from servicelib.async_utils import run_sequentially_in_context from servicelib.rabbitmq import RabbitMQRPCClient from simcore_postgres_database.utils_projects_metadata import DBProjectNotFoundError diff --git a/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_scheduler.py b/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_scheduler.py index dadfdc3cdfc..5f04d8c7fea 100644 --- a/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_scheduler.py +++ b/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_scheduler.py @@ -3,7 +3,7 @@ from fastapi import APIRouter, Depends, HTTPException, status from models_library.projects_nodes_io import NodeID -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from servicelib.fastapi.long_running_tasks.client import ( ProgressMessage, ProgressPercent, diff --git a/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_services.py b/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_services.py index a2a99f4bea3..204c0a0ec3f 100644 --- a/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_services.py +++ b/services/director-v2/src/simcore_service_director_v2/api/routes/dynamic_services.py @@ -19,7 +19,7 @@ from models_library.services import ServiceKeyVersion from models_library.users import UserID from models_library.utils.json_serialization import json_dumps -from pydantic import NonNegativeFloat, NonNegativeInt +from pydantic.v1 import NonNegativeFloat, NonNegativeInt from servicelib.fastapi.requests_decorators import cancel_on_disconnect from servicelib.logging_utils import log_decorator from servicelib.rabbitmq import RabbitMQClient diff --git a/services/director-v2/src/simcore_service_director_v2/cli/_close_and_save_service.py b/services/director-v2/src/simcore_service_director_v2/cli/_close_and_save_service.py index be75694f55c..7436fa4d977 100644 --- a/services/director-v2/src/simcore_service_director_v2/cli/_close_and_save_service.py +++ b/services/director-v2/src/simcore_service_director_v2/cli/_close_and_save_service.py @@ -5,7 +5,7 @@ import rich from fastapi import FastAPI from models_library.projects_nodes_io import NodeID -from pydantic import AnyHttpUrl, PositiveFloat, parse_obj_as +from pydantic.v1 import AnyHttpUrl, PositiveFloat, parse_obj_as from rich.progress import ( BarColumn, Progress, diff --git a/services/director-v2/src/simcore_service_director_v2/cli/_core.py b/services/director-v2/src/simcore_service_director_v2/cli/_core.py index 893aed2504e..b89f00855e8 100644 --- a/services/director-v2/src/simcore_service_director_v2/cli/_core.py +++ b/services/director-v2/src/simcore_service_director_v2/cli/_core.py @@ -12,7 +12,7 @@ from models_library.projects_nodes_io import NodeID, NodeIDStr from models_library.services import ServiceType from models_library.services_enums import ServiceBootType, ServiceState -from pydantic import AnyHttpUrl, BaseModel, PositiveInt, parse_obj_as +from pydantic.v1 import AnyHttpUrl, BaseModel, PositiveInt, parse_obj_as from rich.live import Live from rich.table import Table from servicelib.services_utils import get_service_from_key diff --git a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/__init__.py b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/__init__.py index 276e21b40c3..8fdf65144b9 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/__init__.py +++ b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/__init__.py @@ -1,4 +1,4 @@ -from pydantic import Field +from pydantic.v1 import Field from settings_library.base import BaseCustomSettings from .egress_proxy import EgressProxySettings diff --git a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/egress_proxy.py b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/egress_proxy.py index fe7b25029d4..fe56ad3ec79 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/egress_proxy.py +++ b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/egress_proxy.py @@ -2,7 +2,7 @@ from models_library.docker import DockerGenericTag from models_library.utils.enums import StrAutoEnum -from pydantic import Field +from pydantic.v1 import Field from settings_library.base import BaseCustomSettings diff --git a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/proxy.py b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/proxy.py index 06da8acb6e8..70bd44434d0 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/proxy.py +++ b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/proxy.py @@ -1,5 +1,5 @@ from models_library.basic_types import PortInt -from pydantic import Field +from pydantic.v1 import Field from servicelib.utils_secrets import secure_randint from settings_library.base import BaseCustomSettings diff --git a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/scheduler.py b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/scheduler.py index cb8e272da5c..b493a5281f1 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/scheduler.py +++ b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/scheduler.py @@ -2,7 +2,7 @@ from typing import Final from models_library.projects_networks import DockerNetworkName -from pydantic import Field, NonNegativeInt, PositiveFloat +from pydantic.v1 import Field, NonNegativeInt, PositiveFloat from settings_library.base import BaseCustomSettings _MINUTE: Final[NonNegativeInt] = 60 diff --git a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/sidecar.py b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/sidecar.py index 98ce21fc6a4..5b09256c657 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/sidecar.py +++ b/services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/sidecar.py @@ -9,7 +9,7 @@ ensure_unique_dict_values_validator, ensure_unique_list_values_validator, ) -from pydantic import Field, PositiveInt, validator +from pydantic.v1 import Field, PositiveInt, validator from settings_library.aws_s3_cli import AwsS3CliSettings from settings_library.base import BaseCustomSettings from settings_library.efs import AwsEfsSettings diff --git a/services/director-v2/src/simcore_service_director_v2/core/errors.py b/services/director-v2/src/simcore_service_director_v2/core/errors.py index e8c47a934d3..8d32cb53bea 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/errors.py +++ b/services/director-v2/src/simcore_service_director_v2/core/errors.py @@ -22,7 +22,7 @@ from models_library.errors import ErrorDict from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class DirectorError(Exception): diff --git a/services/director-v2/src/simcore_service_director_v2/core/settings.py b/services/director-v2/src/simcore_service_director_v2/core/settings.py index d87b567149a..427c22b75e4 100644 --- a/services/director-v2/src/simcore_service_director_v2/core/settings.py +++ b/services/director-v2/src/simcore_service_director_v2/core/settings.py @@ -19,7 +19,7 @@ ClusterTypeInModel, NoAuthentication, ) -from pydantic import AnyHttpUrl, AnyUrl, Field, NonNegativeInt, validator +from pydantic.v1 import AnyHttpUrl, AnyUrl, Field, NonNegativeInt, validator from settings_library.base import BaseCustomSettings from settings_library.catalog import CatalogSettings from settings_library.docker_registry import RegistrySettings diff --git a/services/director-v2/src/simcore_service_director_v2/models/comp_pipelines.py b/services/director-v2/src/simcore_service_director_v2/models/comp_pipelines.py index 6e156607ae6..5dd5abd93f6 100644 --- a/services/director-v2/src/simcore_service_director_v2/models/comp_pipelines.py +++ b/services/director-v2/src/simcore_service_director_v2/models/comp_pipelines.py @@ -4,7 +4,7 @@ import networkx as nx from models_library.projects import ProjectID from models_library.projects_state import RunningState -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from simcore_postgres_database.models.comp_pipeline import StateType from ..utils.db import DB_TO_RUNNING_STATE diff --git a/services/director-v2/src/simcore_service_director_v2/models/comp_runs.py b/services/director-v2/src/simcore_service_director_v2/models/comp_runs.py index 1d7800b9788..cecbdc002ed 100644 --- a/services/director-v2/src/simcore_service_director_v2/models/comp_runs.py +++ b/services/director-v2/src/simcore_service_director_v2/models/comp_runs.py @@ -7,7 +7,7 @@ from models_library.projects_nodes_io import NodeID from models_library.projects_state import RunningState from models_library.users import UserID -from pydantic import BaseModel, PositiveInt, validator +from pydantic.v1 import BaseModel, PositiveInt, validator from simcore_postgres_database.models.comp_pipeline import StateType from ..utils.db import DB_TO_RUNNING_STATE diff --git a/services/director-v2/src/simcore_service_director_v2/models/comp_tasks.py b/services/director-v2/src/simcore_service_director_v2/models/comp_tasks.py index 5895411b2d0..a673a00dab6 100644 --- a/services/director-v2/src/simcore_service_director_v2/models/comp_tasks.py +++ b/services/director-v2/src/simcore_service_director_v2/models/comp_tasks.py @@ -14,7 +14,7 @@ from models_library.services import ServiceInputsDict, ServiceOutput, ServicePortKey from models_library.services_regex import SERVICE_KEY_RE from models_library.services_resources import BootMode -from pydantic import ( +from pydantic.v1 import ( BaseModel, ByteSize, Extra, diff --git a/services/director-v2/src/simcore_service_director_v2/models/dynamic_services_scheduler.py b/services/director-v2/src/simcore_service_director_v2/models/dynamic_services_scheduler.py index 33272e9f946..d7515e0dbb5 100644 --- a/services/director-v2/src/simcore_service_director_v2/models/dynamic_services_scheduler.py +++ b/services/director-v2/src/simcore_service_director_v2/models/dynamic_services_scheduler.py @@ -25,7 +25,7 @@ from models_library.services import RunID from models_library.services_resources import ServiceResourcesDict from models_library.wallets import WalletInfo -from pydantic import ( +from pydantic.v1 import ( AnyHttpUrl, BaseModel, ConstrainedStr, diff --git a/services/director-v2/src/simcore_service_director_v2/models/pricing.py b/services/director-v2/src/simcore_service_director_v2/models/pricing.py index 4aabef7cd10..0648cb15d6d 100644 --- a/services/director-v2/src/simcore_service_director_v2/models/pricing.py +++ b/services/director-v2/src/simcore_service_director_v2/models/pricing.py @@ -6,7 +6,7 @@ PricingUnitCostId, PricingUnitId, ) -from pydantic import BaseModel +from pydantic.v1 import BaseModel class PricingInfo(BaseModel): diff --git a/services/director-v2/src/simcore_service_director_v2/modules/catalog.py b/services/director-v2/src/simcore_service_director_v2/modules/catalog.py index f5e378afa43..7a25c10391d 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/catalog.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/catalog.py @@ -8,7 +8,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.services_resources import ServiceResourcesDict from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from settings_library.catalog import CatalogSettings from ..utils.client_decorators import handle_errors, handle_retry diff --git a/services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py b/services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py index 523d2443183..3c52a0d18c2 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py @@ -27,7 +27,7 @@ from models_library.projects_state import RunningState from models_library.services import ServiceKey, ServiceType, ServiceVersion from models_library.users import UserID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.common_headers import UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE from servicelib.rabbitmq import RabbitMQClient, RabbitMQRPCClient from servicelib.utils import logged_gather diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py b/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py index fcba4ad1fd3..bf8413f04b9 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dask_client.py @@ -48,8 +48,8 @@ from models_library.projects_nodes_io import NodeID from models_library.resource_tracker import HardwareInfo from models_library.users import UserID -from pydantic import ValidationError, parse_obj_as -from pydantic.networks import AnyUrl +from pydantic.v1 import ValidationError, parse_obj_as +from pydantic.v1.networks import AnyUrl from servicelib.logging_utils import log_catch from settings_library.s3 import S3Settings from simcore_sdk.node_ports_common.exceptions import NodeportsException diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dask_clients_pool.py b/services/director-v2/src/simcore_service_director_v2/modules/dask_clients_pool.py index d246bb35f42..ad405a58cca 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dask_clients_pool.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dask_clients_pool.py @@ -7,7 +7,7 @@ from fastapi import FastAPI from models_library.clusters import BaseCluster, ClusterTypeInModel -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl from ..core.errors import ( ComputationalBackendNotConnectedError, diff --git a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/clusters.py b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/clusters.py index 214c03b9dca..583453de894 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/clusters.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/clusters.py @@ -15,7 +15,7 @@ ClusterID, ) from models_library.users import UserID -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt from simcore_postgres_database.models.cluster_to_groups import cluster_to_groups from simcore_postgres_database.models.clusters import clusters from simcore_postgres_database.models.groups import GroupType, groups, user_to_groups diff --git a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs.py b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs.py index f52607e4bc0..26fb0f15e0b 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs.py @@ -10,7 +10,7 @@ from models_library.projects_state import RunningState from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from simcore_postgres_database.errors import ForeignKeyViolation from sqlalchemy.sql import or_ from sqlalchemy.sql.elements import literal_column diff --git a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_tasks/_utils.py b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_tasks/_utils.py index a33f689e9da..3f9bb8bf6b2 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_tasks/_utils.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_tasks/_utils.py @@ -36,7 +36,7 @@ ) from models_library.users import UserID from models_library.wallets import ZERO_CREDITS, WalletInfo -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.rabbitmq import ( RabbitMQRPCClient, RemoteMethodNotRegisteredError, diff --git a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/users.py b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/users.py index 94f17b90295..03edbc66495 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/users.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/db/repositories/users.py @@ -1,5 +1,5 @@ from models_library.users import UserID -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from simcore_postgres_database.models.users import UserRole from simcore_postgres_database.utils_users import UsersRepo diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_public.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_public.py index 5718267f428..88609f185c1 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_public.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_public.py @@ -17,7 +17,7 @@ from models_library.services_creation import CreateServiceMetricsAdditionalParams from models_library.services_types import ServicePortKey from models_library.sidecar_volumes import VolumeCategory, VolumeStatus -from pydantic import AnyHttpUrl, PositiveFloat +from pydantic.v1 import AnyHttpUrl, PositiveFloat from servicelib.fastapi.http_client_thin import ( BaseHttpClientError, UnexpectedStatusError, diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_thin.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_thin.py index db48d9f96d5..e0839219b4b 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_thin.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/api_client/_thin.py @@ -5,7 +5,7 @@ from httpx import Response, Timeout from models_library.services_creation import CreateServiceMetricsAdditionalParams from models_library.sidecar_volumes import VolumeCategory, VolumeStatus -from pydantic import AnyHttpUrl +from pydantic.v1 import AnyHttpUrl from servicelib.docker_constants import SUFFIX_EGRESS_PROXY_NAME from servicelib.fastapi.http_client_thin import ( BaseThinClient, diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_compose_specs.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_compose_specs.py index c3e0a06fe64..a1956d0f490 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_compose_specs.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_compose_specs.py @@ -22,7 +22,7 @@ from models_library.users import UserID from models_library.utils.docker_compose import replace_env_vars_in_compose_spec from models_library.utils.json_serialization import json_dumps -from pydantic import ByteSize +from pydantic.v1 import ByteSize from servicelib.resources import CPU_RESOURCE_LIMIT_KEY, MEM_RESOURCE_LIMIT_KEY from settings_library.docker_registry import RegistrySettings diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/proxy.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/proxy.py index 26f49cb9c84..e666898c25e 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/proxy.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/proxy.py @@ -7,7 +7,7 @@ MEMORY_50MB, MEMORY_250MB, ) -from pydantic import ByteSize +from pydantic.v1 import ByteSize from servicelib.common_headers import X_SIMCORE_USER_AGENT from ....core.dynamic_services_settings import DynamicServicesSettings diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/sidecar.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/sidecar.py index 78b66242355..140596d1846 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/sidecar.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/sidecar.py @@ -15,7 +15,7 @@ from models_library.resource_tracker import HardwareInfo from models_library.service_settings_labels import SimcoreServiceSettingsLabel from models_library.utils.json_serialization import json_dumps -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.rabbitmq import RabbitMQRPCClient from servicelib.rabbitmq.rpc_interfaces.efs_guardian import efs_manager from servicelib.utils import unused_port diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/volume_remover.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/volume_remover.py index cefbe0156ec..88fe4f0aa6e 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/volume_remover.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/volume_remover.py @@ -14,7 +14,7 @@ MEMORY_250MB, ) from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ....constants import DYNAMIC_VOLUME_REMOVER_PREFIX diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py index ecb86e9a6aa..e68af2715d8 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/errors.py @@ -1,6 +1,6 @@ from aiodocker.exceptions import DockerError from models_library.projects_nodes_io import NodeID -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin from ...core.errors import DirectorError diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_events_user_services.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_events_user_services.py index 85598707c3a..a77b352bab5 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_events_user_services.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_events_user_services.py @@ -7,7 +7,7 @@ from models_library.service_settings_labels import SimcoreServiceLabels from models_library.services import ServiceKeyVersion, ServiceVersion from models_library.services_creation import CreateServiceMetricsAdditionalParams -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.fastapi.long_running_tasks.client import TaskId from tenacity import RetryError from tenacity.asyncio import AsyncRetrying diff --git a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_scheduler.py b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_scheduler.py index b6a5571a4af..29695324920 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_scheduler.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/scheduler/_core/_scheduler.py @@ -38,7 +38,7 @@ from models_library.services_types import ServicePortKey from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import AnyHttpUrl, NonNegativeFloat +from pydantic.v1 import AnyHttpUrl, NonNegativeFloat from servicelib.background_task import ( cancel_task, start_periodic_task, diff --git a/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/_api_auth_rpc.py b/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/_api_auth_rpc.py index d86f09ec9c2..d7d6cf2e56f 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/_api_auth_rpc.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/_api_auth_rpc.py @@ -6,7 +6,7 @@ from models_library.products import ProductName from models_library.rabbitmq_basic_types import RPCMethodName from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..rabbitmq import get_rabbitmq_rpc_client diff --git a/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/substitutions.py b/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/substitutions.py index a855295d9e4..f84ce3836f1 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/substitutions.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/osparc_variables/substitutions.py @@ -20,7 +20,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID from models_library.utils.specs_substitution import SpecsSubstitutionsResolver -from pydantic import BaseModel +from pydantic.v1 import BaseModel from servicelib.fastapi.app_state import SingletonInAppStateMixin from servicelib.logging_utils import log_context diff --git a/services/director-v2/src/simcore_service_director_v2/modules/projects_networks.py b/services/director-v2/src/simcore_service_director_v2/modules/projects_networks.py index cba005a92ae..f31373efc48 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/projects_networks.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/projects_networks.py @@ -17,7 +17,7 @@ from models_library.service_settings_labels import SimcoreServiceLabels from models_library.services import ServiceKeyVersion from models_library.users import UserID -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as from servicelib.rabbitmq import RabbitMQClient from servicelib.utils import logged_gather diff --git a/services/director-v2/src/simcore_service_director_v2/modules/resource_usage_tracker_client.py b/services/director-v2/src/simcore_service_director_v2/modules/resource_usage_tracker_client.py index 2c546ea3d84..cb9b7e0633c 100644 --- a/services/director-v2/src/simcore_service_director_v2/modules/resource_usage_tracker_client.py +++ b/services/director-v2/src/simcore_service_director_v2/modules/resource_usage_tracker_client.py @@ -23,7 +23,7 @@ ) from models_library.services import ServiceKey, ServiceVersion from models_library.wallets import WalletID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..core.errors import PricingPlanUnitNotFoundError from ..core.settings import AppSettings diff --git a/services/director-v2/src/simcore_service_director_v2/utils/base_distributed_identifier.py b/services/director-v2/src/simcore_service_director_v2/utils/base_distributed_identifier.py index 194a308f8b9..ec9ef0203d1 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/base_distributed_identifier.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/base_distributed_identifier.py @@ -4,7 +4,7 @@ from datetime import timedelta from typing import Final, Generic, TypeVar -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.background_task import start_periodic_task, stop_periodic_task from servicelib.logging_utils import log_catch, log_context from servicelib.redis import RedisClientSDK diff --git a/services/director-v2/src/simcore_service_director_v2/utils/comp_scheduler.py b/services/director-v2/src/simcore_service_director_v2/utils/comp_scheduler.py index e2310c4914a..401cb7c93de 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/comp_scheduler.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/comp_scheduler.py @@ -10,7 +10,7 @@ ServiceResourcesDictHelpers, ) from models_library.users import UserID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from ..models.comp_tasks import CompTaskAtDB diff --git a/services/director-v2/src/simcore_service_director_v2/utils/computations.py b/services/director-v2/src/simcore_service_director_v2/utils/computations.py index 0abbc18f593..c7e50e98bbc 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/computations.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/computations.py @@ -6,7 +6,7 @@ from models_library.services import ServiceKeyVersion from models_library.services_regex import SERVICE_KEY_RE from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.utils import logged_gather from ..models.comp_tasks import CompTaskAtDB diff --git a/services/director-v2/src/simcore_service_director_v2/utils/dask.py b/services/director-v2/src/simcore_service_director_v2/utils/dask.py index c6229bacdc8..1a363b6541c 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/dask.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/dask.py @@ -30,7 +30,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID from models_library.utils.json_serialization import json_dumps -from pydantic import AnyUrl, ByteSize, ValidationError, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, ValidationError, parse_obj_as from servicelib.logging_utils import log_catch, log_context from simcore_sdk import node_ports_v2 from simcore_sdk.node_ports_common.exceptions import ( diff --git a/services/director-v2/src/simcore_service_director_v2/utils/dask_client_utils.py b/services/director-v2/src/simcore_service_director_v2/utils/dask_client_utils.py index 2deb203780b..af30553d0ea 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/dask_client_utils.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/dask_client_utils.py @@ -23,7 +23,7 @@ SimpleAuthentication, TLSAuthentication, ) -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl from ..core.errors import ( ConfigurationError, diff --git a/services/director-v2/src/simcore_service_director_v2/utils/osparc_variables.py b/services/director-v2/src/simcore_service_director_v2/utils/osparc_variables.py index 0dfef24cfef..9d575088f6c 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/osparc_variables.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/osparc_variables.py @@ -4,7 +4,7 @@ from typing import Any, Final, NamedTuple, TypeAlias from models_library.utils.specs_substitution import SubstitutionValue -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from servicelib.utils import logged_gather ContextDict: TypeAlias = dict[str, Any] diff --git a/services/director-v2/src/simcore_service_director_v2/utils/rabbitmq.py b/services/director-v2/src/simcore_service_director_v2/utils/rabbitmq.py index 57d014a3c0f..b35f5031413 100644 --- a/services/director-v2/src/simcore_service_director_v2/utils/rabbitmq.py +++ b/services/director-v2/src/simcore_service_director_v2/utils/rabbitmq.py @@ -17,7 +17,7 @@ from models_library.services_resources import ServiceResourcesDict from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import NonNegativeFloat +from pydantic.v1 import NonNegativeFloat from servicelib.logging_utils import LogLevelInt from servicelib.rabbitmq import RabbitMQClient diff --git a/services/director-v2/tests/helpers/shared_comp_utils.py b/services/director-v2/tests/helpers/shared_comp_utils.py index ad7185e8fa7..4b706ce3ee3 100644 --- a/services/director-v2/tests/helpers/shared_comp_utils.py +++ b/services/director-v2/tests/helpers/shared_comp_utils.py @@ -9,8 +9,8 @@ from models_library.projects_pipeline import PipelineDetails from models_library.projects_state import RunningState from models_library.users import UserID -from pydantic import PositiveInt -from pydantic.networks import AnyHttpUrl +from pydantic.v1 import PositiveInt +from pydantic.v1.networks import AnyHttpUrl from pytest_simcore.helpers.constants import MINUTE from starlette import status from tenacity.asyncio import AsyncRetrying diff --git a/services/director-v2/tests/integration/02/conftest.py b/services/director-v2/tests/integration/02/conftest.py index 0d0df8a402f..0ea2faf1a22 100644 --- a/services/director-v2/tests/integration/02/conftest.py +++ b/services/director-v2/tests/integration/02/conftest.py @@ -14,7 +14,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture diff --git a/services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py b/services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py index 2fe09c42286..02d38f9f91d 100644 --- a/services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py +++ b/services/director-v2/tests/integration/02/test_dynamic_sidecar_nodeports_integration.py @@ -46,7 +46,7 @@ from models_library.projects_pipeline import PipelineDetails from models_library.projects_state import RunningState from models_library.users import UserID -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.host import get_localhost_ip from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict diff --git a/services/director-v2/tests/integration/02/utils.py b/services/director-v2/tests/integration/02/utils.py index 0c5f10c07bd..f87df208d09 100644 --- a/services/director-v2/tests/integration/02/utils.py +++ b/services/director-v2/tests/integration/02/utils.py @@ -20,7 +20,7 @@ ServiceResourcesDictHelpers, ) from models_library.users import UserID -from pydantic import PositiveInt, parse_obj_as +from pydantic.v1 import PositiveInt, parse_obj_as from pytest_simcore.helpers.host import get_localhost_ip from servicelib.common_headers import ( X_DYNAMIC_SIDECAR_REQUEST_DNS, diff --git a/services/director-v2/tests/unit/conftest.py b/services/director-v2/tests/unit/conftest.py index f08ffd47337..d373096e434 100644 --- a/services/director-v2/tests/unit/conftest.py +++ b/services/director-v2/tests/unit/conftest.py @@ -27,7 +27,7 @@ from models_library.service_settings_labels import SimcoreServiceLabels from models_library.services import RunID, ServiceKey, ServiceKeyVersion, ServiceVersion from models_library.services_enums import ServiceState -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.s3 import S3Settings diff --git a/services/director-v2/tests/unit/test_core_settings.py b/services/director-v2/tests/unit/test_core_settings.py index 84d99057f3a..0377c5eee7b 100644 --- a/services/director-v2/tests/unit/test_core_settings.py +++ b/services/director-v2/tests/unit/test_core_settings.py @@ -6,7 +6,7 @@ import pytest from models_library.basic_types import LogLevel -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.r_clone import S3Provider from simcore_service_director_v2.core.dynamic_services_settings.egress_proxy import ( diff --git a/services/director-v2/tests/unit/test_models_clusters.py b/services/director-v2/tests/unit/test_models_clusters.py index 0a5d29283bb..b5f7b6d972b 100644 --- a/services/director-v2/tests/unit/test_models_clusters.py +++ b/services/director-v2/tests/unit/test_models_clusters.py @@ -13,7 +13,7 @@ WorkerMetrics, ) from models_library.clusters import ClusterTypeInModel -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from simcore_postgres_database.models.clusters import ClusterType diff --git a/services/director-v2/tests/unit/test_models_comp_pipelines.py b/services/director-v2/tests/unit/test_models_comp_pipelines.py index 98f7722b841..e1df364b040 100644 --- a/services/director-v2/tests/unit/test_models_comp_pipelines.py +++ b/services/director-v2/tests/unit/test_models_comp_pipelines.py @@ -10,7 +10,7 @@ import networkx as nx import pytest from models_library.projects_state import RunningState -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel from simcore_service_director_v2.models.comp_pipelines import CompPipelineAtDB diff --git a/services/director-v2/tests/unit/test_models_comp_runs.py b/services/director-v2/tests/unit/test_models_comp_runs.py index 5505982f2d1..58857d7a03b 100644 --- a/services/director-v2/tests/unit/test_models_comp_runs.py +++ b/services/director-v2/tests/unit/test_models_comp_runs.py @@ -7,7 +7,7 @@ import pytest from models_library.projects_state import RunningState -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel from simcore_service_director_v2.models.comp_runs import CompRunsAtDB diff --git a/services/director-v2/tests/unit/test_models_comp_tasks.py b/services/director-v2/tests/unit/test_models_comp_tasks.py index 6898acface4..0bd5e881ba0 100644 --- a/services/director-v2/tests/unit/test_models_comp_tasks.py +++ b/services/director-v2/tests/unit/test_models_comp_tasks.py @@ -7,7 +7,7 @@ import pytest from models_library.projects_state import RunningState -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel from simcore_postgres_database.models.comp_pipeline import StateType from simcore_service_director_v2.models.comp_tasks import CompTaskAtDB diff --git a/services/director-v2/tests/unit/test_models_schemas_dynamic_services_scheduler.py b/services/director-v2/tests/unit/test_models_schemas_dynamic_services_scheduler.py index 607b8231f78..f1adb085e7b 100644 --- a/services/director-v2/tests/unit/test_models_schemas_dynamic_services_scheduler.py +++ b/services/director-v2/tests/unit/test_models_schemas_dynamic_services_scheduler.py @@ -5,7 +5,7 @@ from pathlib import Path import pytest -from pydantic import parse_file_as +from pydantic.v1 import parse_file_as from simcore_service_director_v2.models.dynamic_services_scheduler import SchedulerData diff --git a/services/director-v2/tests/unit/test_modules_dask_client.py b/services/director-v2/tests/unit/test_modules_dask_client.py index a01980027c0..7fbb616fb7c 100644 --- a/services/director-v2/tests/unit/test_modules_dask_client.py +++ b/services/director-v2/tests/unit/test_modules_dask_client.py @@ -54,8 +54,8 @@ from models_library.projects_nodes_io import NodeID from models_library.resource_tracker import HardwareInfo from models_library.users import UserID -from pydantic import AnyUrl, ByteSize, SecretStr -from pydantic.tools import parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, SecretStr +from pydantic.v1.tools import parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from servicelib.background_task import periodic_task diff --git a/services/director-v2/tests/unit/test_modules_dask_clients_pool.py b/services/director-v2/tests/unit/test_modules_dask_clients_pool.py index 3dd97cc4753..bf44367912a 100644 --- a/services/director-v2/tests/unit/test_modules_dask_clients_pool.py +++ b/services/director-v2/tests/unit/test_modules_dask_clients_pool.py @@ -21,7 +21,7 @@ NoAuthentication, SimpleAuthentication, ) -from pydantic import SecretStr +from pydantic.v1 import SecretStr from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.utils_encoders import create_json_encoder_wo_secrets diff --git a/services/director-v2/tests/unit/test_modules_db_repositories_services_environments.py b/services/director-v2/tests/unit/test_modules_db_repositories_services_environments.py index 82e397bd3f1..683481cdbbc 100644 --- a/services/director-v2/tests/unit/test_modules_db_repositories_services_environments.py +++ b/services/director-v2/tests/unit/test_modules_db_repositories_services_environments.py @@ -1,5 +1,5 @@ from models_library.osparc_variable_identifier import OsparcVariableIdentifier -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.models.services_environments import VENDOR_SECRET_PREFIX diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_public.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_public.py index 5c2397f8af2..7badd2771c3 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_public.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_public.py @@ -11,7 +11,7 @@ from httpx import HTTPError, Response from models_library.sidecar_volumes import VolumeCategory, VolumeStatus from models_library.utils.json_serialization import json_dumps -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from servicelib.fastapi.http_client_thin import ClientHttpError, UnexpectedStatusError diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_thin.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_thin.py index c2e9f0e4b1d..dc29e1bb7aa 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_thin.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_client_api_thin.py @@ -11,7 +11,7 @@ from httpx import Response from models_library.services_creation import CreateServiceMetricsAdditionalParams from models_library.sidecar_volumes import VolumeCategory, VolumeStatus -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from pytest_simcore.helpers.typing_env import EnvVarsDict from respx import MockRouter, Route from respx.types import SideEffectTypes diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_egress_config.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_egress_config.py index 94f50850fb6..b2c56b385b4 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_egress_config.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_egress_config.py @@ -14,7 +14,7 @@ _PortRange, ) from ordered_set import OrderedSet -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from simcore_service_director_v2.modules.dynamic_sidecar.docker_compose_egress_config import ( _get_egress_proxy_dns_port_rules, _get_envoy_config, diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_specs.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_specs.py index 8b390e7b973..4aa5698a2c6 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_specs.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_compose_specs.py @@ -21,7 +21,7 @@ ServiceResourcesDict, ) from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.resources import CPU_RESOURCE_LIMIT_KEY, MEM_RESOURCE_LIMIT_KEY from simcore_service_director_v2.modules.dynamic_sidecar import docker_compose_specs diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_service_specs_volume_remover.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_service_specs_volume_remover.py index 4f5672b4a53..78880e1a31d 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_service_specs_volume_remover.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_docker_service_specs_volume_remover.py @@ -9,7 +9,7 @@ from aiodocker.volumes import DockerVolume from faker import Faker from models_library.services import RunID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_director_v2.modules.dynamic_sidecar.docker_service_specs.volume_remover import ( SH_SCRIPT_REMOVE_VOLUMES, DockerVersion, diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler.py index 13d617ed82d..47f07b86cba 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler.py @@ -21,7 +21,7 @@ from models_library.service_settings_labels import SimcoreServiceLabels from models_library.services_enums import ServiceState from models_library.wallets import WalletID -from pydantic import NonNegativeFloat +from pydantic.v1 import NonNegativeFloat from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from respx.router import MockRouter diff --git a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler_core_events.py b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler_core_events.py index 2bd05535e6a..760f7305e28 100644 --- a/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler_core_events.py +++ b/services/director-v2/tests/unit/test_modules_dynamic_sidecar_scheduler_core_events.py @@ -9,7 +9,7 @@ import pytest from faker import Faker from fastapi import FastAPI -from pydantic import PositiveFloat, PositiveInt +from pydantic.v1 import PositiveFloat, PositiveInt from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/director-v2/tests/unit/test_modules_notifier.py b/services/director-v2/tests/unit/test_modules_notifier.py index 46d0879cebc..b3c8885f2be 100644 --- a/services/director-v2/tests/unit/test_modules_notifier.py +++ b/services/director-v2/tests/unit/test_modules_notifier.py @@ -18,7 +18,7 @@ from models_library.projects_nodes_io import NodeID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from servicelib.utils import logged_gather diff --git a/services/director-v2/tests/unit/test_modules_osparc_variables.py b/services/director-v2/tests/unit/test_modules_osparc_variables.py index 9ed659f00ad..2faaecabaa4 100644 --- a/services/director-v2/tests/unit/test_modules_osparc_variables.py +++ b/services/director-v2/tests/unit/test_modules_osparc_variables.py @@ -21,7 +21,7 @@ from models_library.users import UserID from models_library.utils.specs_substitution import SubstitutionValue from models_library.utils.string_substitution import OSPARC_IDENTIFIER_PREFIX -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.faker_compose_specs import generate_fake_docker_compose from simcore_postgres_database.models.services_environments import VENDOR_SECRET_PREFIX diff --git a/services/director-v2/tests/unit/test_modules_project_networks.py b/services/director-v2/tests/unit/test_modules_project_networks.py index 585d8131b8e..b02bc9c7d5f 100644 --- a/services/director-v2/tests/unit/test_modules_project_networks.py +++ b/services/director-v2/tests/unit/test_modules_project_networks.py @@ -11,7 +11,7 @@ from models_library.projects import NodesDict, ProjectID from models_library.projects_networks import NetworksWithAliases from models_library.projects_nodes import Node -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from pytest_mock.plugin import MockerFixture from simcore_service_director_v2.modules.projects_networks import ( _get_networks_with_aliases_for_default_network, diff --git a/services/director-v2/tests/unit/test_utils_db.py b/services/director-v2/tests/unit/test_utils_db.py index d2a9e49484d..7f3a9157771 100644 --- a/services/director-v2/tests/unit/test_utils_db.py +++ b/services/director-v2/tests/unit/test_utils_db.py @@ -4,7 +4,7 @@ import pytest from models_library.clusters import BaseCluster, Cluster from models_library.projects_state import RunningState -from pydantic import BaseModel +from pydantic.v1 import BaseModel from simcore_postgres_database.models.comp_pipeline import StateType from simcore_service_director_v2.utils.db import ( DB_TO_RUNNING_STATE, diff --git a/services/director-v2/tests/unit/test_utils_distributed_identifier.py b/services/director-v2/tests/unit/test_utils_distributed_identifier.py index ce200feef97..c992f87feec 100644 --- a/services/director-v2/tests/unit/test_utils_distributed_identifier.py +++ b/services/director-v2/tests/unit/test_utils_distributed_identifier.py @@ -10,7 +10,7 @@ from uuid import UUID, uuid4 import pytest -from pydantic import BaseModel, NonNegativeInt, StrBytes +from pydantic.v1 import BaseModel, NonNegativeInt, StrBytes from pytest_mock import MockerFixture from servicelib.redis import RedisClientSDK from servicelib.utils import logged_gather diff --git a/services/director-v2/tests/unit/with_dbs/conftest.py b/services/director-v2/tests/unit/with_dbs/conftest.py index 09b727449f2..6c6b8d0f60a 100644 --- a/services/director-v2/tests/unit/with_dbs/conftest.py +++ b/services/director-v2/tests/unit/with_dbs/conftest.py @@ -18,7 +18,7 @@ from models_library.clusters import Cluster from models_library.projects import ProjectAtDB from models_library.projects_nodes_io import NodeID -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel from simcore_postgres_database.models.cluster_to_groups import cluster_to_groups from simcore_postgres_database.models.clusters import clusters from simcore_postgres_database.models.comp_pipeline import StateType, comp_pipeline diff --git a/services/director-v2/tests/unit/with_dbs/test_api_route_clusters.py b/services/director-v2/tests/unit/with_dbs/test_api_route_clusters.py index 63457484613..e0efdbefce7 100644 --- a/services/director-v2/tests/unit/with_dbs/test_api_route_clusters.py +++ b/services/director-v2/tests/unit/with_dbs/test_api_route_clusters.py @@ -30,7 +30,7 @@ ClusterAuthentication, SimpleAuthentication, ) -from pydantic import AnyHttpUrl, SecretStr, parse_obj_as +from pydantic.v1 import AnyHttpUrl, SecretStr, parse_obj_as from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.utils_encoders import create_json_encoder_wo_secrets from simcore_postgres_database.models.clusters import ClusterType, clusters diff --git a/services/director-v2/tests/unit/with_dbs/test_api_route_clusters_details.py b/services/director-v2/tests/unit/with_dbs/test_api_route_clusters_details.py index 2b509ab1a6f..76f42307dd4 100644 --- a/services/director-v2/tests/unit/with_dbs/test_api_route_clusters_details.py +++ b/services/director-v2/tests/unit/with_dbs/test_api_route_clusters_details.py @@ -17,7 +17,7 @@ from models_library.api_schemas_directorv2.clusters import ClusterDetailsGet from models_library.clusters import Cluster, ClusterID, SimpleAuthentication from models_library.users import UserID -from pydantic import SecretStr +from pydantic.v1 import SecretStr from pytest_simcore.helpers.typing_env import EnvVarsDict from starlette import status from tenacity.asyncio import AsyncRetrying diff --git a/services/director-v2/tests/unit/with_dbs/test_api_route_computations.py b/services/director-v2/tests/unit/with_dbs/test_api_route_computations.py index 7fe67666267..4911aaee249 100644 --- a/services/director-v2/tests/unit/with_dbs/test_api_route_computations.py +++ b/services/director-v2/tests/unit/with_dbs/test_api_route_computations.py @@ -48,7 +48,7 @@ ) from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.wallets import WalletInfo -from pydantic import AnyHttpUrl, ByteSize, PositiveInt, ValidationError, parse_obj_as +from pydantic.v1 import AnyHttpUrl, ByteSize, PositiveInt, ValidationError, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from settings_library.rabbit import RabbitSettings diff --git a/services/director-v2/tests/unit/with_dbs/test_api_route_computations_tasks.py b/services/director-v2/tests/unit/with_dbs/test_api_route_computations_tasks.py index 6f75f43c59f..2c2df8ce51e 100644 --- a/services/director-v2/tests/unit/with_dbs/test_api_route_computations_tasks.py +++ b/services/director-v2/tests/unit/with_dbs/test_api_route_computations_tasks.py @@ -21,7 +21,7 @@ from models_library.projects import ProjectAtDB, ProjectID from models_library.projects_nodes_io import NodeID from models_library.users import UserID -from pydantic import parse_obj_as, parse_raw_as +from pydantic.v1 import parse_obj_as, parse_raw_as from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from simcore_service_director_v2.core.settings import AppSettings diff --git a/services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py b/services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py index 2968e96e5db..a78f11717e1 100644 --- a/services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py +++ b/services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py @@ -41,7 +41,7 @@ RabbitResourceTrackingStoppedMessage, ) from models_library.users import UserID -from pydantic import parse_obj_as, parse_raw_as +from pydantic.v1 import parse_obj_as, parse_raw_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from servicelib.rabbitmq import RabbitMQClient diff --git a/services/director-v2/tests/unit/with_dbs/test_utils_dask.py b/services/director-v2/tests/unit/with_dbs/test_utils_dask.py index 9a2a93d3a33..95ee52130b2 100644 --- a/services/director-v2/tests/unit/with_dbs/test_utils_dask.py +++ b/services/director-v2/tests/unit/with_dbs/test_utils_dask.py @@ -36,9 +36,9 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimCoreFileLink, SimcoreS3FileID from models_library.users import UserID -from pydantic import ByteSize -from pydantic.networks import AnyUrl -from pydantic.tools import parse_obj_as +from pydantic.v1 import ByteSize +from pydantic.v1.networks import AnyUrl +from pydantic.v1.tools import parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from simcore_sdk.node_ports_v2 import FileLinkType diff --git a/services/director/src/simcore_service_director/services_common.py b/services/director/src/simcore_service_director/services_common.py index f1aef5ac668..cb4db0e378e 100644 --- a/services/director/src/simcore_service_director/services_common.py +++ b/services/director/src/simcore_service_director/services_common.py @@ -3,7 +3,7 @@ # since this service is frozen and MUST NOT ADD ANY MORE DEPENDENCIES # # -from pydantic import BaseSettings, Field, PositiveInt +from pydantic.v1 import BaseSettings, Field, PositiveInt _BASE_TIMEOUT_FOR_STOPPING_SERVICES = 60 * 60 diff --git a/services/dynamic-scheduler/requirements/_base.txt b/services/dynamic-scheduler/requirements/_base.txt index 6a29f3ea11a..515c4e77b2e 100644 --- a/services/dynamic-scheduler/requirements/_base.txt +++ b/services/dynamic-scheduler/requirements/_base.txt @@ -22,6 +22,8 @@ aiosignal==1.3.1 # via aiohttp alembic==1.13.1 # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -35,10 +37,7 @@ arrow==1.3.0 # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 - # via - # aiohttp - # asyncpg - # redis + # via asyncpg asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -65,19 +64,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -163,7 +153,7 @@ prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via sqlalchemy -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -181,6 +171,8 @@ pydantic==1.10.15 # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -243,7 +235,7 @@ sqlalchemy==1.4.52 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/postgres-database/requirements/_base.in # alembic -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -272,12 +264,11 @@ typing-extensions==4.10.0 # aiodebug # aiodocker # alembic - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer - # uvicorn uvicorn==0.29.0 # via # -r requirements/../../../packages/service-library/requirements/_fastapi.in diff --git a/services/dynamic-scheduler/requirements/_test.txt b/services/dynamic-scheduler/requirements/_test.txt index c8ed470df58..b26c6841581 100644 --- a/services/dynamic-scheduler/requirements/_test.txt +++ b/services/dynamic-scheduler/requirements/_test.txt @@ -19,11 +19,6 @@ coverage==7.6.1 # pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in h11==0.14.0 @@ -104,14 +99,6 @@ sniffio==1.3.1 # httpx termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.10.0 - # via - # -c requirements/_base.txt - # anyio urllib3==2.2.2 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/dynamic-scheduler/requirements/_tools.txt b/services/dynamic-scheduler/requirements/_tools.txt index c724e2ead52..f02a5246a65 100644 --- a/services/dynamic-scheduler/requirements/_tools.txt +++ b/services/dynamic-scheduler/requirements/_tools.txt @@ -69,22 +69,11 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt - # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py index 260202d00f4..d157c67ef82 100644 --- a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py +++ b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class BaseDynamicSchedulerError(PydanticErrorMixin, ValueError): diff --git a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py index 1a38cf336cb..c6a2017fe35 100644 --- a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py +++ b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py @@ -1,7 +1,7 @@ import datetime from functools import cached_property -from pydantic import Field, parse_obj_as, validator +from pydantic.v1 import Field, parse_obj_as, validator from settings_library.application import BaseApplicationSettings from settings_library.basic_types import LogLevel, VersionTag from settings_library.director_v2 import DirectorV2Settings diff --git a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/models/schemas/meta.py b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/models/schemas/meta.py index df9d3fa4315..3c38dc7e174 100644 --- a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/models/schemas/meta.py +++ b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/models/schemas/meta.py @@ -1,7 +1,7 @@ from typing import Any, ClassVar from models_library.api_schemas__common.meta import BaseMeta -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl class Meta(BaseMeta): diff --git a/services/dynamic-scheduler/tests/unit/test__model_examples.py b/services/dynamic-scheduler/tests/unit/test__model_examples.py index 858bcc66a4d..474ecbec020 100644 --- a/services/dynamic-scheduler/tests/unit/test__model_examples.py +++ b/services/dynamic-scheduler/tests/unit/test__model_examples.py @@ -3,7 +3,7 @@ import pytest import simcore_service_dynamic_scheduler.models -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError from pytest_simcore.pydantic_models import walk_model_examples_in_package diff --git a/services/dynamic-sidecar/requirements/_base.txt b/services/dynamic-sidecar/requirements/_base.txt index 0416a0dc9f0..a03045736a7 100644 --- a/services/dynamic-sidecar/requirements/_base.txt +++ b/services/dynamic-sidecar/requirements/_base.txt @@ -50,6 +50,8 @@ alembic==1.13.1 # via # -r requirements/../../../packages/postgres-database/requirements/_base.in # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -67,10 +69,8 @@ arrow==1.3.0 # -r requirements/_base.in async-timeout==4.0.3 # via - # aiohttp # aiopg # asyncpg - # redis asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -106,26 +106,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/simcore-sdk/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -243,7 +227,7 @@ psycopg2-binary==2.9.9 # via # aiopg # sqlalchemy -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -276,6 +260,8 @@ pydantic==1.10.15 # -r requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -374,7 +360,7 @@ sqlalchemy==1.4.52 # -r requirements/../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in # aiopg # alembic -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -419,13 +405,12 @@ typing-extensions==4.11.0 # aiodebug # aiodocker # alembic - # anyio # fastapi # faststream # pint # pydantic + # pydantic-core # typer - # uvicorn u-msgpack-python==2.8.0 # via -r requirements/_base.in uvicorn==0.29.0 diff --git a/services/dynamic-sidecar/requirements/_test.txt b/services/dynamic-sidecar/requirements/_test.txt index ba822234e96..43cd3bcd6de 100644 --- a/services/dynamic-sidecar/requirements/_test.txt +++ b/services/dynamic-sidecar/requirements/_test.txt @@ -21,10 +21,6 @@ asgi-lifespan==2.1.0 # via -r requirements/_test.in async-asgi-testclient==1.4.11 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp attrs==23.2.0 # via # -c requirements/_base.txt @@ -47,10 +43,6 @@ coverage==7.6.1 # via pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # pytest faker==27.0.0 # via -r requirements/_test.in flaky==3.8.1 @@ -133,11 +125,6 @@ sqlalchemy==1.4.52 # -r requirements/_test.in sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiobotocore-s3==2.13.2 # via -r requirements/_test.in types-aiofiles==24.1.0.20240626 diff --git a/services/dynamic-sidecar/requirements/_tools.txt b/services/dynamic-sidecar/requirements/_tools.txt index 32ff7865877..6ba5bd3db49 100644 --- a/services/dynamic-sidecar/requirements/_tools.txt +++ b/services/dynamic-sidecar/requirements/_tools.txt @@ -72,22 +72,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.11.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers.py index 507540688a6..e3556943a1b 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers.py @@ -12,7 +12,7 @@ ActivityInfo, ActivityInfoOrNone, ) -from pydantic import parse_raw_as +from pydantic.v1 import parse_raw_as from servicelib.fastapi.requests_decorators import cancel_on_disconnect from ..core.docker_utils import docker_client diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers_extension.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers_extension.py index dc0fb030429..d7480d8aef2 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers_extension.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/containers_extension.py @@ -6,7 +6,7 @@ from fastapi import Path as PathParam from fastapi import Request, Response, status from models_library.services import ServiceOutput -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel from simcore_sdk.node_ports_v2.port_utils import is_file_type from ..core.docker_utils import docker_client diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/volumes.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/volumes.py index 5620f6bc11d..496b04d6715 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/volumes.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/api/volumes.py @@ -2,7 +2,7 @@ from fastapi import Path as PathParam from fastapi import status from models_library.sidecar_volumes import VolumeCategory, VolumeState, VolumeStatus -from pydantic import BaseModel +from pydantic.v1 import BaseModel from ..models.shared_store import SharedStore from ._dependencies import get_shared_store diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/docker_utils.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/docker_utils.py index 7804d3de35c..adab64fc380 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/docker_utils.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/docker_utils.py @@ -11,7 +11,7 @@ from models_library.generated_models.docker_rest_api import ContainerState from models_library.generated_models.docker_rest_api import Status2 as ContainerStatus from models_library.services import RunID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.utils import logged_gather from starlette import status as http_status diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py index b0fd128a942..cc1512f588d 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/errors.py @@ -2,7 +2,7 @@ from fastapi import status from models_library.services import RunID -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class BaseDynamicSidecarError(Exception): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/external_dependencies.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/external_dependencies.py index 12696fe13f0..cc1bda197bb 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/external_dependencies.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/external_dependencies.py @@ -1,5 +1,5 @@ from fastapi import FastAPI -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin from servicelib.utils import logged_gather from .postgres import wait_for_postgres_liveness diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/registry.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/registry.py index 71b50a3f548..8af3412cc63 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/registry.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/registry.py @@ -3,7 +3,7 @@ from typing import Final from fastapi import FastAPI -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from settings_library.docker_registry import RegistrySettings from ..modules.service_liveness import wait_for_service_liveness diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/reserved_space.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/reserved_space.py index 945aaccb8e5..bfefc231b33 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/reserved_space.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/reserved_space.py @@ -3,7 +3,7 @@ from typing import Final from fastapi import FastAPI -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from .settings import ApplicationSettings diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/settings.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/settings.py index 1ad855e9f1d..86363b373b0 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/settings.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/settings.py @@ -11,7 +11,7 @@ from models_library.projects_nodes_io import NodeID from models_library.services import DynamicServiceKey, RunID, ServiceVersion from models_library.users import UserID -from pydantic import ByteSize, Field, PositiveInt, parse_obj_as, validator +from pydantic.v1 import ByteSize, Field, PositiveInt, parse_obj_as, validator from settings_library.aws_s3_cli import AwsS3CliSettings from settings_library.base import BaseCustomSettings from settings_library.docker_registry import RegistrySettings diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/storage.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/storage.py index 9118711a573..6e81d29c47c 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/storage.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/storage.py @@ -4,7 +4,7 @@ from fastapi import FastAPI, status from httpx import AsyncClient -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from servicelib.logging_utils import log_context from settings_library.node_ports import StorageAuthSettings diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/application_health.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/application_health.py index 4da644858b9..09d1e5b43de 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/application_health.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/application_health.py @@ -1,12 +1,10 @@ -from typing import Optional - -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field class ApplicationHealth(BaseModel): is_healthy: bool = Field( default=True, description="returns True if the service sis running correctly" ) - error_message: Optional[str] = Field( + error_message: str | None = Field( default=None, description="in case of error this gets set" ) diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/containers.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/containers.py index 3a9606394ef..8556936355f 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/containers.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/schemas/containers.py @@ -1,5 +1,5 @@ from models_library.services_creation import CreateServiceMetricsAdditionalParams -from pydantic import BaseModel +from pydantic.v1 import BaseModel class ContainersCreate(BaseModel): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/shared_store.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/shared_store.py index 0745f595fa8..b96ebdb7809 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/shared_store.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/models/shared_store.py @@ -5,7 +5,7 @@ import aiofiles from fastapi import FastAPI from models_library.sidecar_volumes import VolumeCategory, VolumeState, VolumeStatus -from pydantic import BaseModel, Field, PrivateAttr +from pydantic.v1 import BaseModel, Field, PrivateAttr from ..core.settings import ApplicationSettings diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/attribute_monitor/_logging_event_handler.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/attribute_monitor/_logging_event_handler.py index 527fa32f3ea..a00eb72950b 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/attribute_monitor/_logging_event_handler.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/attribute_monitor/_logging_event_handler.py @@ -14,7 +14,7 @@ import aioprocessing # type: ignore[import-untyped] from aioprocessing.process import AioProcess # type: ignore[import-untyped] from aioprocessing.queues import AioQueue # type: ignore[import-untyped] -from pydantic import ByteSize, PositiveFloat +from pydantic.v1 import ByteSize, PositiveFloat from servicelib.logging_utils import log_context from watchdog.events import FileSystemEvent diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/container_utils.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/container_utils.py index 64b91bf938e..31c1444c1a9 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/container_utils.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/container_utils.py @@ -6,7 +6,7 @@ from aiodocker import Docker, DockerError from aiodocker.execs import Exec from aiodocker.stream import Stream -from pydantic import NonNegativeFloat +from pydantic.v1 import NonNegativeFloat from starlette import status from ..core.errors import ( diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/inputs.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/inputs.py index 3898810930f..5d1c80ee9a8 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/inputs.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/inputs.py @@ -1,5 +1,5 @@ from fastapi import FastAPI -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field class InputsState(BaseModel): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py index f8a573d6a9d..cdcc728eb93 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py @@ -13,7 +13,7 @@ from models_library.basic_types import IDStr from models_library.generated_models.docker_rest_api import ContainerState from models_library.rabbitmq_messages import ProgressType, SimcorePlatformStatus -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.file_utils import log_directory_changes from servicelib.logging_utils import log_context from servicelib.progress_bar import ProgressBarData diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py index 2213dd1d4ac..b3f7b890e07 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py @@ -18,7 +18,7 @@ from models_library.projects import ProjectIDStr from models_library.projects_nodes_io import NodeIDStr from models_library.services_types import ServicePortKey -from pydantic import ByteSize +from pydantic.v1 import ByteSize from servicelib.archiving_utils import PrunableFolder, archive_dir, unarchive_dir from servicelib.async_utils import run_sequentially_in_context from servicelib.file_utils import remove_directory diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_directory_utils.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_directory_utils.py index 7cc13922244..fe925494b56 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_directory_utils.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_directory_utils.py @@ -1,7 +1,7 @@ import os from pathlib import Path -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as def get_directory_total_size(path: Path) -> ByteSize: diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_filter.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_filter.py index 8490f9cd72e..03e222a0466 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_filter.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_filter.py @@ -8,7 +8,7 @@ from dataclasses import dataclass from typing import Final, TypeAlias -from pydantic import ( +from pydantic.v1 import ( ByteSize, NonNegativeFloat, NonNegativeInt, diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_handler.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_handler.py index 784db423ed6..a8c4de4080e 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_handler.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_event_handler.py @@ -14,7 +14,7 @@ import aioprocessing # type: ignore [import-untyped] from aioprocessing.process import AioProcess # type: ignore [import-untyped] from aioprocessing.queues import AioQueue # type: ignore [import-untyped] -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from servicelib.logging_utils import log_context from watchdog.events import FileSystemEvent diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_manager.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_manager.py index 307f8b3d933..d5a6de95b28 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_manager.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_manager.py @@ -9,8 +9,8 @@ from fastapi import FastAPI from models_library.basic_types import IDStr from models_library.rabbitmq_messages import ProgressType -from pydantic import PositiveFloat -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import PositiveFloat +from pydantic.v1.errors import PydanticErrorMixin from servicelib import progress_bar from servicelib.background_task import start_periodic_task, stop_periodic_task from servicelib.logging_utils import log_catch, log_context diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/prometheus_metrics.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/prometheus_metrics.py index 5a4d09ca71d..e240bca9419 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/prometheus_metrics.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/prometheus_metrics.py @@ -8,7 +8,7 @@ import arrow from fastapi import FastAPI, status from models_library.callbacks_mapping import CallbacksMapping, UserServiceCommand -from pydantic import BaseModel, NonNegativeFloat, NonNegativeInt +from pydantic.v1 import BaseModel, NonNegativeFloat, NonNegativeInt from servicelib.background_task import cancel_task from servicelib.logging_utils import log_context from servicelib.sequences_utils import pairwise diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_core.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_core.py index 031b42ff324..93ab62cddb6 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_core.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_core.py @@ -11,7 +11,7 @@ ) from models_library.services import ServiceType from models_library.services_creation import CreateServiceMetricsAdditionalParams -from pydantic import NonNegativeFloat +from pydantic.v1 import NonNegativeFloat from servicelib.background_task import start_periodic_task, stop_periodic_task from servicelib.logging_utils import log_context diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_models.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_models.py index 4708e9c291f..5b34f5e2fb3 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_models.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/resource_tracking/_models.py @@ -1,6 +1,6 @@ from asyncio import Task -from pydantic import BaseModel +from pydantic.v1 import BaseModel class ResourceTrackingState(BaseModel): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/service_liveness.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/service_liveness.py index 78976b53a86..1b6bd2777a7 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/service_liveness.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/service_liveness.py @@ -4,7 +4,7 @@ from datetime import timedelta from typing import Final -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin from tenacity import AsyncRetrying, RetryCallState, TryAgain from tenacity.stop import stop_after_delay from tenacity.wait import wait_fixed diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_db.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_db.py index f2cc53a0d9d..b1a382d0d63 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_db.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_db.py @@ -6,7 +6,7 @@ from models_library.user_preferences import PreferenceName from models_library.users import UserID from packaging.version import Version -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.utils_user_preferences import ( UserServicesUserPreferencesRepo, ) diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py index d1b373ac1f5..f55926ec413 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class BaseServicesPreferencesError(PydanticErrorMixin, Exception): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_packaging.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_packaging.py index 38f2eab7111..e83d0c81de6 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_packaging.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_packaging.py @@ -2,7 +2,7 @@ from typing import Final import aiofiles -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.archiving_utils import archive_dir, unarchive_dir from servicelib.file_utils import remove_directory diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_user_preference.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_user_preference.py index 5f96e43a73e..7aa70820bc8 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_user_preference.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/user_services_preferences/_user_preference.py @@ -1,7 +1,7 @@ from models_library.services import ServiceKey from models_library.user_preferences import UserServiceUserPreference from models_library.utils.change_case import snake_to_upper_camel -from pydantic import create_model +from pydantic.v1 import create_model def get_model_class(service_key: ServiceKey) -> type[UserServiceUserPreference]: diff --git a/services/dynamic-sidecar/tests/conftest.py b/services/dynamic-sidecar/tests/conftest.py index 397666815fb..ed6203f9889 100644 --- a/services/dynamic-sidecar/tests/conftest.py +++ b/services/dynamic-sidecar/tests/conftest.py @@ -20,7 +20,7 @@ from models_library.services_creation import CreateServiceMetricsAdditionalParams from models_library.users import UserID from models_library.utils.json_serialization import json_dumps -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import ( EnvVarsDict, diff --git a/services/dynamic-sidecar/tests/integration/test_modules_long_running_tasks.py b/services/dynamic-sidecar/tests/integration/test_modules_long_running_tasks.py index 5e70b0a6f79..dde1e426694 100644 --- a/services/dynamic-sidecar/tests/integration/test_modules_long_running_tasks.py +++ b/services/dynamic-sidecar/tests/integration/test_modules_long_running_tasks.py @@ -23,7 +23,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimcoreS3FileID from models_library.users import UserID -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.faker_factories import random_project from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict diff --git a/services/dynamic-sidecar/tests/integration/test_modules_user_services_preferences.py b/services/dynamic-sidecar/tests/integration/test_modules_user_services_preferences.py index 094b3014404..aacfc1a2266 100644 --- a/services/dynamic-sidecar/tests/integration/test_modules_user_services_preferences.py +++ b/services/dynamic-sidecar/tests/integration/test_modules_user_services_preferences.py @@ -14,7 +14,7 @@ from models_library.projects import ProjectID from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from pytest_simcore.helpers.postgres_tools import PostgresTestConfig from simcore_service_dynamic_sidecar.core.application import create_app diff --git a/services/dynamic-sidecar/tests/unit/test_api_containers_long_running_tasks.py b/services/dynamic-sidecar/tests/unit/test_api_containers_long_running_tasks.py index 4069eac1fe7..029208c20c8 100644 --- a/services/dynamic-sidecar/tests/unit/test_api_containers_long_running_tasks.py +++ b/services/dynamic-sidecar/tests/unit/test_api_containers_long_running_tasks.py @@ -21,7 +21,7 @@ from fastapi.routing import APIRoute from httpx import AsyncClient from models_library.services_creation import CreateServiceMetricsAdditionalParams -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict from servicelib.fastapi.long_running_tasks.client import ( diff --git a/services/dynamic-sidecar/tests/unit/test_api_prometheus_metrics.py b/services/dynamic-sidecar/tests/unit/test_api_prometheus_metrics.py index 75bf997142e..73caa61ef1f 100644 --- a/services/dynamic-sidecar/tests/unit/test_api_prometheus_metrics.py +++ b/services/dynamic-sidecar/tests/unit/test_api_prometheus_metrics.py @@ -14,7 +14,7 @@ from httpx import AsyncClient from models_library.callbacks_mapping import CallbacksMapping from models_library.services_creation import CreateServiceMetricsAdditionalParams -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from servicelib.fastapi.long_running_tasks.client import ( Client, diff --git a/services/dynamic-sidecar/tests/unit/test_api_workflow_service_metrics.py b/services/dynamic-sidecar/tests/unit/test_api_workflow_service_metrics.py index bfbebda6bf2..96500eb119b 100644 --- a/services/dynamic-sidecar/tests/unit/test_api_workflow_service_metrics.py +++ b/services/dynamic-sidecar/tests/unit/test_api_workflow_service_metrics.py @@ -28,7 +28,7 @@ SimcorePlatformStatus, ) from models_library.services_creation import CreateServiceMetricsAdditionalParams -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from servicelib.fastapi.long_running_tasks.client import ( diff --git a/services/dynamic-sidecar/tests/unit/test_core_docker_utils.py b/services/dynamic-sidecar/tests/unit/test_core_docker_utils.py index a7d2254425c..a88f6ec44bf 100644 --- a/services/dynamic-sidecar/tests/unit/test_core_docker_utils.py +++ b/services/dynamic-sidecar/tests/unit/test_core_docker_utils.py @@ -11,7 +11,7 @@ from faker import Faker from models_library.generated_models.docker_rest_api import ContainerState from models_library.services import RunID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from simcore_service_dynamic_sidecar.core.docker_utils import ( _get_containers_inspect_from_names, get_container_states, diff --git a/services/dynamic-sidecar/tests/unit/test_core_reserved_space.py b/services/dynamic-sidecar/tests/unit/test_core_reserved_space.py index 123f21864a0..2a78ea64864 100644 --- a/services/dynamic-sidecar/tests/unit/test_core_reserved_space.py +++ b/services/dynamic-sidecar/tests/unit/test_core_reserved_space.py @@ -2,7 +2,7 @@ # pylint:disable=unused-argument -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict from simcore_service_dynamic_sidecar.core.application import create_base_app from simcore_service_dynamic_sidecar.core.reserved_space import ( diff --git a/services/dynamic-sidecar/tests/unit/test_models_shared_store.py b/services/dynamic-sidecar/tests/unit/test_models_shared_store.py index c72a8bdb85a..68a2d0ebb05 100644 --- a/services/dynamic-sidecar/tests/unit/test_models_shared_store.py +++ b/services/dynamic-sidecar/tests/unit/test_models_shared_store.py @@ -10,7 +10,7 @@ from async_asgi_testclient import TestClient from fastapi import FastAPI from models_library.sidecar_volumes import VolumeCategory, VolumeState, VolumeStatus -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture from servicelib.utils import logged_gather from simcore_service_dynamic_sidecar.core import application diff --git a/services/dynamic-sidecar/tests/unit/test_modules_outputs_directory_utils.py b/services/dynamic-sidecar/tests/unit/test_modules_outputs_directory_utils.py index a2ab9b9ce9f..08dbe4361c5 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_outputs_directory_utils.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_outputs_directory_utils.py @@ -6,7 +6,7 @@ from uuid import uuid4 import pytest -from pydantic import NonNegativeInt, PositiveInt +from pydantic.v1 import NonNegativeInt, PositiveInt from simcore_service_dynamic_sidecar.modules.outputs._directory_utils import ( get_directory_total_size, ) diff --git a/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_filter.py b/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_filter.py index 024d966e424..c6863c37b65 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_filter.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_filter.py @@ -7,7 +7,7 @@ from unittest.mock import AsyncMock import pytest -from pydantic import ByteSize, NonNegativeFloat, NonNegativeInt, parse_obj_as +from pydantic.v1 import ByteSize, NonNegativeFloat, NonNegativeInt, parse_obj_as from pytest_mock.plugin import MockerFixture from simcore_service_dynamic_sidecar.modules.outputs._context import OutputsContext from simcore_service_dynamic_sidecar.modules.outputs._event_filter import ( diff --git a/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_handler.py b/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_handler.py index 5f02a500a4d..f12b2faa2c1 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_handler.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_outputs_event_handler.py @@ -9,7 +9,7 @@ import aioprocessing import pytest from aioprocessing.queues import AioQueue -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from simcore_service_dynamic_sidecar.modules.outputs._context import OutputsContext from simcore_service_dynamic_sidecar.modules.outputs._event_handler import ( EventHandlerObserver, diff --git a/services/dynamic-sidecar/tests/unit/test_modules_outputs_manager.py b/services/dynamic-sidecar/tests/unit/test_modules_outputs_manager.py index 40a3db6d3f9..b2de57e64a1 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_outputs_manager.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_outputs_manager.py @@ -15,7 +15,7 @@ from faker import Faker from fastapi import FastAPI from models_library.services import RunID -from pydantic import PositiveFloat +from pydantic.v1 import PositiveFloat from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict from simcore_sdk.node_ports_common.exceptions import S3TransferError diff --git a/services/dynamic-sidecar/tests/unit/test_modules_outputs_watcher.py b/services/dynamic-sidecar/tests/unit/test_modules_outputs_watcher.py index f209e4877a7..90485ea5ab5 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_outputs_watcher.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_outputs_watcher.py @@ -17,7 +17,7 @@ from aiofiles import os from faker import Faker from models_library.services import RunID -from pydantic import ( +from pydantic.v1 import ( ByteSize, NonNegativeFloat, NonNegativeInt, diff --git a/services/dynamic-sidecar/tests/unit/test_modules_prometheus_metrics.py b/services/dynamic-sidecar/tests/unit/test_modules_prometheus_metrics.py index 91b91d7a947..21aa3040ad7 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_prometheus_metrics.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_prometheus_metrics.py @@ -4,7 +4,7 @@ import arrow import pytest -from pydantic import NonNegativeFloat +from pydantic.v1 import NonNegativeFloat from simcore_service_dynamic_sidecar.modules.prometheus_metrics import ( _MAX_DEFAULT_METRICS_SCRAPE_INTERVAL, _MAX_PROMETHEUS_SAMPLES, diff --git a/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__disk_usage.py b/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__disk_usage.py index 2c4c3c6a125..236c9c6ff69 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__disk_usage.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__disk_usage.py @@ -13,7 +13,7 @@ from models_library.projects_nodes_io import NodeID from models_library.users import UserID from psutil._common import sdiskusage -from pydantic import ByteSize +from pydantic.v1 import ByteSize from pytest_mock import MockerFixture from simcore_service_dynamic_sidecar.modules.system_monitor._disk_usage import ( DiskUsageMonitor, diff --git a/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__notifier.py b/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__notifier.py index 73184a1b3cb..79cb2a3726b 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__notifier.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_system_monitor__notifier.py @@ -21,7 +21,7 @@ from models_library.api_schemas_webserver.socketio import SocketIORoomStr from models_library.projects_nodes_io import NodeID from models_library.users import UserID -from pydantic import ByteSize, NonNegativeInt, parse_obj_as +from pydantic.v1 import ByteSize, NonNegativeInt, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from servicelib.utils import logged_gather diff --git a/services/dynamic-sidecar/tests/unit/test_modules_user_services_preferences_user_preference.py b/services/dynamic-sidecar/tests/unit/test_modules_user_services_preferences_user_preference.py index 08b6f3da05e..0eb2ab2eeae 100644 --- a/services/dynamic-sidecar/tests/unit/test_modules_user_services_preferences_user_preference.py +++ b/services/dynamic-sidecar/tests/unit/test_modules_user_services_preferences_user_preference.py @@ -3,7 +3,7 @@ import pytest from models_library.services import ServiceKey -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_dynamic_sidecar.modules.user_services_preferences._user_preference import ( get_model_class, ) diff --git a/services/efs-guardian/requirements/_base.txt b/services/efs-guardian/requirements/_base.txt index 0559ab670cf..1b294b53993 100644 --- a/services/efs-guardian/requirements/_base.txt +++ b/services/efs-guardian/requirements/_base.txt @@ -43,6 +43,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.4.0 # via # fast-depends @@ -57,10 +59,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==23.2.0 # via # aiohttp @@ -99,24 +97,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.1 - # via anyio fast-depends==2.4.3 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -203,7 +187,7 @@ prometheus-client==0.20.0 # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -231,6 +215,8 @@ pydantic==1.10.15 # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.6.2 @@ -302,7 +288,7 @@ sniffio==1.3.1 # via # anyio # httpx -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -352,16 +338,15 @@ typing-extensions==4.11.0 # via # aiodebug # aiodocker - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer # types-aiobotocore # types-aiobotocore-ec2 # types-aiobotocore-s3 # types-aiobotocore-ssm - # uvicorn urllib3==2.2.1 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt diff --git a/services/efs-guardian/requirements/_test.txt b/services/efs-guardian/requirements/_test.txt index 847b0b88781..e796b818f23 100644 --- a/services/efs-guardian/requirements/_test.txt +++ b/services/efs-guardian/requirements/_test.txt @@ -11,6 +11,10 @@ aiosignal==1.3.1 # via # -c requirements/_base.txt # aiohttp +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic antlr4-python3-runtime==4.13.2 # via moto anyio==4.4.0 @@ -19,11 +23,6 @@ anyio==4.4.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp - # redis attrs==23.2.0 # via # -c requirements/_base.txt @@ -82,11 +81,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.1 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in fakeredis==2.23.5 @@ -205,11 +199,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pytest==8.3.2 @@ -296,19 +294,14 @@ sortedcontainers==2.4.0 # via fakeredis sympy==1.13.2 # via cfn-lint -tomli==2.0.1 - # via - # coverage - # pytest typing-extensions==4.11.0 # via # -c requirements/_base.txt # aiodocker - # anyio # aws-sam-translator # cfn-lint - # fakeredis # pydantic + # pydantic-core urllib3==2.2.1 # via # -c requirements/../../../requirements/constraints.txt diff --git a/services/efs-guardian/requirements/_tools.txt b/services/efs-guardian/requirements/_tools.txt index db86636a373..7a2c3f9d91b 100644 --- a/services/efs-guardian/requirements/_tools.txt +++ b/services/efs-guardian/requirements/_tools.txt @@ -74,22 +74,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.11.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/efs-guardian/src/simcore_service_efs_guardian/_meta.py b/services/efs-guardian/src/simcore_service_efs_guardian/_meta.py index 9d489cc179e..bd76b80ac4b 100644 --- a/services/efs-guardian/src/simcore_service_efs_guardian/_meta.py +++ b/services/efs-guardian/src/simcore_service_efs_guardian/_meta.py @@ -9,7 +9,7 @@ from models_library.basic_types import VersionStr, VersionTag from packaging.version import Version -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as _current_distribution = distribution("simcore-service-efs-guardian") __version__: str = version("simcore-service-efs-guardian") diff --git a/services/efs-guardian/src/simcore_service_efs_guardian/core/settings.py b/services/efs-guardian/src/simcore_service_efs_guardian/core/settings.py index 57528d7a13d..5b006f8a8db 100644 --- a/services/efs-guardian/src/simcore_service_efs_guardian/core/settings.py +++ b/services/efs-guardian/src/simcore_service_efs_guardian/core/settings.py @@ -8,7 +8,7 @@ LogLevel, VersionTag, ) -from pydantic import Field, PositiveInt, validator +from pydantic.v1 import Field, PositiveInt, validator from settings_library.base import BaseCustomSettings from settings_library.efs import AwsEfsSettings from settings_library.rabbit import RabbitSettings diff --git a/services/invitations/requirements/_base.txt b/services/invitations/requirements/_base.txt index 68a381d3f12..57a1813e14a 100644 --- a/services/invitations/requirements/_base.txt +++ b/services/invitations/requirements/_base.txt @@ -19,6 +19,8 @@ aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -31,10 +33,6 @@ arrow==1.3.0 # -r requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in -async-timeout==4.0.3 - # via - # aiohttp - # redis attrs==23.2.0 # via # aiohttp @@ -69,18 +67,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -149,7 +139,7 @@ prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in pycparser==2.21 # via cffi -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -165,6 +155,8 @@ pydantic==1.10.14 # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -214,7 +206,7 @@ sniffio==1.3.1 # via # anyio # httpx -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -241,12 +233,11 @@ typing-extensions==4.10.0 # via # aiodebug # aiodocker - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer - # uvicorn uvicorn==0.29.0 # via # -r requirements/../../../packages/service-library/requirements/_fastapi.in diff --git a/services/invitations/requirements/_test.txt b/services/invitations/requirements/_test.txt index 4571dba8ffa..7b029ccb0de 100644 --- a/services/invitations/requirements/_test.txt +++ b/services/invitations/requirements/_test.txt @@ -16,12 +16,6 @@ coverage==7.6.1 # via # -r requirements/_test.in # pytest-cov -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # anyio - # hypothesis - # pytest faker==27.0.0 # via -r requirements/_test.in h11==0.14.0 @@ -90,11 +84,3 @@ sortedcontainers==2.4.0 # via hypothesis termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # pytest -typing-extensions==4.10.0 - # via - # -c requirements/_base.txt - # anyio diff --git a/services/invitations/requirements/_tools.txt b/services/invitations/requirements/_tools.txt index b17c8a2c2d8..f3932792cef 100644 --- a/services/invitations/requirements/_tools.txt +++ b/services/invitations/requirements/_tools.txt @@ -70,22 +70,11 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt - # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/invitations/src/simcore_service_invitations/api/_meta.py b/services/invitations/src/simcore_service_invitations/api/_meta.py index 621f3b4445e..4cbd2522980 100644 --- a/services/invitations/src/simcore_service_invitations/api/_meta.py +++ b/services/invitations/src/simcore_service_invitations/api/_meta.py @@ -2,7 +2,7 @@ from collections.abc import Callable from fastapi import APIRouter, Depends -from pydantic import BaseModel, HttpUrl +from pydantic.v1 import BaseModel, HttpUrl from .._meta import API_VERSION, PROJECT_NAME from ._dependencies import get_reverse_url_mapper diff --git a/services/invitations/src/simcore_service_invitations/cli.py b/services/invitations/src/simcore_service_invitations/cli.py index dffb1dca32f..f681eb2cdc6 100644 --- a/services/invitations/src/simcore_service_invitations/cli.py +++ b/services/invitations/src/simcore_service_invitations/cli.py @@ -5,7 +5,7 @@ from cryptography.fernet import Fernet from models_library.emails import LowerCaseEmailStr from models_library.invitations import InvitationContent, InvitationInputs -from pydantic import EmailStr, HttpUrl, ValidationError, parse_obj_as +from pydantic.v1 import EmailStr, HttpUrl, ValidationError, parse_obj_as from rich.console import Console from servicelib.utils_secrets import generate_password from settings_library.utils_cli import ( diff --git a/services/invitations/src/simcore_service_invitations/core/settings.py b/services/invitations/src/simcore_service_invitations/core/settings.py index 6af076f4229..3f4175bdbc7 100644 --- a/services/invitations/src/simcore_service_invitations/core/settings.py +++ b/services/invitations/src/simcore_service_invitations/core/settings.py @@ -1,7 +1,7 @@ from functools import cached_property from models_library.products import ProductName -from pydantic import Field, HttpUrl, PositiveInt, SecretStr, validator +from pydantic.v1 import Field, HttpUrl, PositiveInt, SecretStr, validator from settings_library.base import BaseCustomSettings from settings_library.basic_types import BuildTargetEnum, LogLevel, VersionTag from settings_library.utils_logging import MixinLoggingSettings diff --git a/services/invitations/src/simcore_service_invitations/services/invitations.py b/services/invitations/src/simcore_service_invitations/services/invitations.py index d5bed8662cf..bf7d2425ac8 100644 --- a/services/invitations/src/simcore_service_invitations/services/invitations.py +++ b/services/invitations/src/simcore_service_invitations/services/invitations.py @@ -7,7 +7,7 @@ from cryptography.fernet import Fernet, InvalidToken from models_library.invitations import InvitationContent, InvitationInputs from models_library.products import ProductName -from pydantic import HttpUrl, ValidationError, parse_obj_as +from pydantic.v1 import HttpUrl, ValidationError, parse_obj_as from starlette.datastructures import URL _logger = logging.getLogger(__name__) diff --git a/services/invitations/tests/unit/test__model_examples.py b/services/invitations/tests/unit/test__model_examples.py index 31ed0dfc603..6965dc107aa 100644 --- a/services/invitations/tests/unit/test__model_examples.py +++ b/services/invitations/tests/unit/test__model_examples.py @@ -11,7 +11,7 @@ import pytest import simcore_service_invitations import simcore_service_invitations.api._invitations -from pydantic import BaseModel +from pydantic.v1 import BaseModel from pytest_simcore.pydantic_models import iter_model_examples_in_module diff --git a/services/invitations/tests/unit/test_invitations.py b/services/invitations/tests/unit/test_invitations.py index edd9c01556b..85da6475255 100644 --- a/services/invitations/tests/unit/test_invitations.py +++ b/services/invitations/tests/unit/test_invitations.py @@ -12,7 +12,7 @@ from faker import Faker from models_library.invitations import InvitationContent, InvitationInputs from models_library.products import ProductName -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError from simcore_service_invitations.services.invitations import ( InvalidInvitationCodeError, _ContentWithShortNames, diff --git a/services/migration/requirements/_test.txt b/services/migration/requirements/_test.txt index 1e306e69649..5b2e5bb55dd 100644 --- a/services/migration/requirements/_test.txt +++ b/services/migration/requirements/_test.txt @@ -13,8 +13,6 @@ coverage==7.6.1 # via pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.2 - # via pytest greenlet==3.0.3 # via sqlalchemy idna==3.7 @@ -76,11 +74,6 @@ sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy tenacity==9.0.0 # via -r requirements/_test.in -tomli==2.0.1 - # via - # coverage - # mypy - # pytest typing-extensions==4.12.2 # via # mypy diff --git a/services/migration/requirements/_tools.txt b/services/migration/requirements/_tools.txt index 717169d7f46..70e35d70acc 100644 --- a/services/migration/requirements/_tools.txt +++ b/services/migration/requirements/_tools.txt @@ -71,21 +71,11 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/osparc-gateway-server/requirements/_base.txt b/services/osparc-gateway-server/requirements/_base.txt index 120db872e49..2d37e0ee098 100644 --- a/services/osparc-gateway-server/requirements/_base.txt +++ b/services/osparc-gateway-server/requirements/_base.txt @@ -7,8 +7,8 @@ aiohttp==3.9.5 # dask-gateway-server aiosignal==1.3.1 # via aiohttp -async-timeout==4.0.3 - # via aiohttp +annotated-types==0.7.0 + # via pydantic attrs==23.2.0 # via aiohttp cffi==1.16.0 @@ -41,11 +41,11 @@ multidict==6.0.5 # yarl pycparser==2.22 # via cffi -pydantic==1.10.15 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -r requirements/_base.in -python-dotenv==1.0.1 +pydantic-core==2.20.1 # via pydantic sqlalchemy==1.4.52 # via @@ -54,6 +54,8 @@ sqlalchemy==1.4.52 traitlets==5.14.3 # via dask-gateway-server typing-extensions==4.12.2 - # via pydantic + # via + # pydantic + # pydantic-core yarl==1.9.4 # via aiohttp diff --git a/services/osparc-gateway-server/requirements/_test.txt b/services/osparc-gateway-server/requirements/_test.txt index e02757bd6aa..6e5c4d5dba7 100644 --- a/services/osparc-gateway-server/requirements/_test.txt +++ b/services/osparc-gateway-server/requirements/_test.txt @@ -7,10 +7,6 @@ aiosignal==1.3.1 # via # -c requirements/_base.txt # aiohttp -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp attrs==23.2.0 # via # -c requirements/_base.txt @@ -51,8 +47,6 @@ distributed==2024.5.1 # dask-gateway docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.2 - # via pytest faker==27.0.0 # via -r requirements/_test.in frozenlist==1.4.1 @@ -182,11 +176,6 @@ tenacity==9.0.0 # via -r requirements/_test.in termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest toolz==0.12.1 # via # -c requirements/../../dask-sidecar/requirements/_dask-distributed.txt diff --git a/services/osparc-gateway-server/requirements/_tools.txt b/services/osparc-gateway-server/requirements/_tools.txt index 7a36f37bae9..a3428b0ccc3 100644 --- a/services/osparc-gateway-server/requirements/_tools.txt +++ b/services/osparc-gateway-server/requirements/_tools.txt @@ -72,22 +72,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/osparc-gateway-server/src/osparc_gateway_server/backend/models.py b/services/osparc-gateway-server/src/osparc_gateway_server/backend/models.py index 43e2240270d..ce649c88412 100644 --- a/services/osparc-gateway-server/src/osparc_gateway_server/backend/models.py +++ b/services/osparc-gateway-server/src/osparc_gateway_server/backend/models.py @@ -1,7 +1,7 @@ from ipaddress import IPv4Address from typing import Any, Mapping, Union -from pydantic import BaseModel, ByteSize, Field, PositiveFloat, parse_obj_as +from pydantic.v1 import BaseModel, ByteSize, Field, PositiveFloat, parse_obj_as Hostname = str ResourceName = str diff --git a/services/osparc-gateway-server/src/osparc_gateway_server/backend/settings.py b/services/osparc-gateway-server/src/osparc_gateway_server/backend/settings.py index 1b967564262..adfea2c94b1 100644 --- a/services/osparc-gateway-server/src/osparc_gateway_server/backend/settings.py +++ b/services/osparc-gateway-server/src/osparc_gateway_server/backend/settings.py @@ -1,6 +1,6 @@ from enum import Enum -from pydantic import BaseSettings, Field, NonNegativeInt, PositiveInt +from pydantic.v1 import BaseSettings, Field, NonNegativeInt, PositiveInt class BootModeEnum(str, Enum): diff --git a/services/payments/requirements/_base.txt b/services/payments/requirements/_base.txt index e14e1e9e171..bdc35b6d126 100644 --- a/services/payments/requirements/_base.txt +++ b/services/payments/requirements/_base.txt @@ -1,17 +1,33 @@ aio-pika==9.4.2 + # via -r requirements/../../../packages/service-library/requirements/_base.in aiodebug==2.3.0 + # via -r requirements/../../../packages/service-library/requirements/_base.in aiodocker==0.22.2 + # via -r requirements/../../../packages/service-library/requirements/_base.in aiofiles==24.1.0 + # via -r requirements/../../../packages/service-library/requirements/_base.in aiohappyeyeballs==2.3.4 # via aiohttp aiohttp==3.10.0 - # via aiodocker + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # aiodocker aiormq==6.8.0 # via aio-pika aiosignal==1.3.1 # via aiohttp aiosmtplib==3.0.2 + # via -r requirements/_base.in alembic==1.13.2 + # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.4.0 # via # fast-depends @@ -20,11 +36,12 @@ anyio==4.4.0 # starlette # watchfiles arrow==1.3.0 -async-timeout==4.0.3 # via - # aiohttp - # asyncpg - # redis + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in +async-timeout==4.0.3 + # via asyncpg asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -36,6 +53,13 @@ bidict==0.23.1 # via python-socketio certifi==2024.7.4 # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt # httpcore # httpx cffi==1.16.0 @@ -45,19 +69,30 @@ click==8.1.7 # typer # uvicorn cryptography==43.0.0 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/_base.in dnspython==2.6.1 # via email-validator ecdsa==0.19.0 # via python-jose email-validator==2.2.0 # via pydantic -exceptiongroup==1.2.2 - # via anyio fast-depends==2.4.7 # via faststream -fastapi==0.99.1 - # via prometheus-fastapi-instrumentator +fastapi==0.112.2 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # -r requirements/_base.in + # prometheus-fastapi-instrumentator faststream==0.5.15 + # via -r requirements/../../../packages/service-library/requirements/_base.in frozenlist==1.4.1 # via # aiohttp @@ -74,6 +109,16 @@ httpcore==1.0.5 httptools==0.6.1 # via uvicorn httpx==0.27.0 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # -r requirements/_base.in idna==3.7 # via # anyio @@ -81,11 +126,31 @@ idna==3.7 # httpx # yarl jinja2==3.1.4 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/_base.in jsonschema==4.23.0 + # via + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in jsonschema-specifications==2023.7.1 # via jsonschema mako==1.3.5 - # via alembic + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # alembic markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -99,12 +164,26 @@ multidict==6.0.5 # aiohttp # yarl orjson==3.10.6 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in packaging==24.1 + # via -r requirements/_base.in pamqp==3.3.0 # via aiormq prometheus-client==0.20.0 - # via prometheus-fastapi-instrumentator + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # prometheus-fastapi-instrumentator prometheus-fastapi-instrumentator==6.1.0 + # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via sqlalchemy pyasn1==0.6.0 @@ -113,13 +192,30 @@ pyasn1==0.6.0 # rsa pycparser==2.22 # via cffi -pydantic==1.10.17 +pydantic==2.8.2 # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/postgres-database/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/service-library/requirements/_base.in + # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.18.0 # via rich pyinstrument==4.6.2 + # via -r requirements/../../../packages/service-library/requirements/_base.in python-dateutil==2.9.0.post0 # via arrow python-dotenv==1.0.1 @@ -127,23 +223,56 @@ python-dotenv==1.0.1 python-engineio==4.9.1 # via python-socketio python-jose==3.3.0 + # via -r requirements/_base.in python-multipart==0.0.9 + # via -r requirements/_base.in python-socketio==5.11.3 + # via -r requirements/_base.in pyyaml==6.0.1 - # via uvicorn + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/service-library/requirements/_base.in + # uvicorn redis==5.0.8 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/service-library/requirements/_base.in referencing==0.29.3 # via + # -c requirements/../../../packages/service-library/requirements/./constraints.txt # jsonschema # jsonschema-specifications rich==13.7.1 - # via typer + # via + # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/settings-library/requirements/_base.in + # typer rpds-py==0.19.1 # via # jsonschema # referencing rsa==4.9 - # via python-jose + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # python-jose shellingham==1.5.4 # via typer simple-websocket==1.0.0 @@ -157,27 +286,53 @@ sniffio==1.3.1 # anyio # httpx sqlalchemy==1.4.53 - # via alembic -starlette==0.27.0 - # via fastapi + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # -r requirements/../../../packages/postgres-database/requirements/_base.in + # alembic +starlette==0.38.2 + # via + # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt + # -c requirements/../../../requirements/constraints.txt + # fastapi tenacity==9.0.0 + # via -r requirements/../../../packages/service-library/requirements/_base.in toolz==0.12.1 + # via -r requirements/../../../packages/service-library/requirements/_base.in tqdm==4.66.4 + # via -r requirements/../../../packages/service-library/requirements/_base.in typer==0.12.3 - # via faststream + # via + # -r requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/../../../packages/settings-library/requirements/_base.in + # -r requirements/_base.in + # faststream types-python-dateutil==2.9.0.20240316 # via arrow typing-extensions==4.12.2 # via # aiodebug # alembic - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer - # uvicorn uvicorn==0.30.4 + # via + # -r requirements/../../../packages/service-library/requirements/_fastapi.in + # -r requirements/_base.in uvloop==0.19.0 # via uvicorn watchfiles==0.22.0 @@ -188,6 +343,7 @@ wsproto==1.2.0 # via simple-websocket yarl==1.9.4 # via + # -r requirements/../../../packages/postgres-database/requirements/_base.in # aio-pika # aiohttp # aiormq diff --git a/services/payments/requirements/_test.txt b/services/payments/requirements/_test.txt index ad73ea53868..cca63b4c54a 100644 --- a/services/payments/requirements/_test.txt +++ b/services/payments/requirements/_test.txt @@ -17,10 +17,6 @@ anyio==4.4.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # aiohttp attrs==23.2.0 # via # -c requirements/_base.txt @@ -44,11 +40,6 @@ coverage==7.6.1 # pytest-cov docker==7.1.0 # via -r requirements/_test.in -exceptiongroup==1.2.2 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in frozenlist==1.4.1 @@ -170,11 +161,6 @@ sqlalchemy2-stubs==0.0.2a38 # via sqlalchemy termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in types-pyasn1==0.6.0.20240402 @@ -186,7 +172,6 @@ types-pyyaml==6.0.12.20240808 typing-extensions==4.12.2 # via # -c requirements/_base.txt - # anyio # mypy # sqlalchemy2-stubs urllib3==2.2.2 diff --git a/services/payments/requirements/_tools.txt b/services/payments/requirements/_tools.txt index cee6887ecd0..fb799ce9990 100644 --- a/services/payments/requirements/_tools.txt +++ b/services/payments/requirements/_tools.txt @@ -72,22 +72,12 @@ ruff==0.6.1 # via -r requirements/../../../requirements/devenv.txt setuptools==73.0.1 # via pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.12.2 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/payments/scripts/example_payment_gateway.py b/services/payments/scripts/example_payment_gateway.py index aca2643a555..c6a683a7bf1 100755 --- a/services/payments/scripts/example_payment_gateway.py +++ b/services/payments/scripts/example_payment_gateway.py @@ -38,7 +38,7 @@ from fastapi.encoders import jsonable_encoder from fastapi.responses import HTMLResponse from fastapi.routing import APIRoute -from pydantic import HttpUrl, SecretStr +from pydantic.v1 import HttpUrl, SecretStr from servicelib.fastapi.openapi import override_fastapi_openapi_method from settings_library.base import BaseCustomSettings from simcore_service_payments.models.payments_gateway import ( diff --git a/services/payments/src/simcore_service_payments/api/rpc/_payments.py b/services/payments/src/simcore_service_payments/api/rpc/_payments.py index fe6e4db28dc..ba5586ff177 100644 --- a/services/payments/src/simcore_service_payments/api/rpc/_payments.py +++ b/services/payments/src/simcore_service_payments/api/rpc/_payments.py @@ -15,7 +15,7 @@ from models_library.products import ProductName, StripePriceID, StripeTaxRateID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, HttpUrl +from pydantic.v1 import EmailStr, HttpUrl from servicelib.logging_utils import get_log_record_extra, log_context from servicelib.rabbitmq import RPCRouter diff --git a/services/payments/src/simcore_service_payments/api/rpc/_payments_methods.py b/services/payments/src/simcore_service_payments/api/rpc/_payments_methods.py index 360dcf962c0..9f927972944 100644 --- a/services/payments/src/simcore_service_payments/api/rpc/_payments_methods.py +++ b/services/payments/src/simcore_service_payments/api/rpc/_payments_methods.py @@ -17,7 +17,7 @@ from models_library.products import StripePriceID, StripeTaxRateID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr +from pydantic.v1 import EmailStr from servicelib.logging_utils import get_log_record_extra, log_context from servicelib.rabbitmq import RPCRouter diff --git a/services/payments/src/simcore_service_payments/core/errors.py b/services/payments/src/simcore_service_payments/core/errors.py index 5fce135e800..93ce1b58642 100644 --- a/services/payments/src/simcore_service_payments/core/errors.py +++ b/services/payments/src/simcore_service_payments/core/errors.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class _BaseAppError(PydanticErrorMixin, ValueError): diff --git a/services/payments/src/simcore_service_payments/core/settings.py b/services/payments/src/simcore_service_payments/core/settings.py index 3e8b2d44d76..2ff97078865 100644 --- a/services/payments/src/simcore_service_payments/core/settings.py +++ b/services/payments/src/simcore_service_payments/core/settings.py @@ -1,7 +1,7 @@ from functools import cached_property from models_library.basic_types import NonNegativeDecimal -from pydantic import ( +from pydantic.v1 import ( EmailStr, Field, HttpUrl, diff --git a/services/payments/src/simcore_service_payments/db/auto_recharge_repo.py b/services/payments/src/simcore_service_payments/db/auto_recharge_repo.py index 4e7b25d228e..1a95b0ab033 100644 --- a/services/payments/src/simcore_service_payments/db/auto_recharge_repo.py +++ b/services/payments/src/simcore_service_payments/db/auto_recharge_repo.py @@ -5,7 +5,7 @@ from models_library.basic_types import NonNegativeDecimal from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from simcore_postgres_database.utils_payments_autorecharge import AutoRechargeStmts from .base import BaseRepository diff --git a/services/payments/src/simcore_service_payments/db/payments_methods_repo.py b/services/payments/src/simcore_service_payments/db/payments_methods_repo.py index 79e4b6d7ae4..bb6f9015817 100644 --- a/services/payments/src/simcore_service_payments/db/payments_methods_repo.py +++ b/services/payments/src/simcore_service_payments/db/payments_methods_repo.py @@ -11,7 +11,7 @@ from models_library.api_schemas_webserver.wallets import PaymentMethodID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.models.payments_methods import ( InitPromptAckFlowState, payments_methods, diff --git a/services/payments/src/simcore_service_payments/db/payments_transactions_repo.py b/services/payments/src/simcore_service_payments/db/payments_transactions_repo.py index fc3ba5b3b10..2df85aecb39 100644 --- a/services/payments/src/simcore_service_payments/db/payments_transactions_repo.py +++ b/services/payments/src/simcore_service_payments/db/payments_transactions_repo.py @@ -12,7 +12,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import HttpUrl, PositiveInt, parse_obj_as +from pydantic.v1 import HttpUrl, PositiveInt, parse_obj_as from simcore_postgres_database import errors as pg_errors from simcore_postgres_database.models.payments_transactions import ( PaymentTransactionState, diff --git a/services/payments/src/simcore_service_payments/models/auth.py b/services/payments/src/simcore_service_payments/models/auth.py index a187e5a9215..6e81a79e90b 100644 --- a/services/payments/src/simcore_service_payments/models/auth.py +++ b/services/payments/src/simcore_service_payments/models/auth.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel +from pydantic.v1 import BaseModel class SessionData(BaseModel): diff --git a/services/payments/src/simcore_service_payments/models/db.py b/services/payments/src/simcore_service_payments/models/db.py index 8d69b8de70d..04a57fcdb3e 100644 --- a/services/payments/src/simcore_service_payments/models/db.py +++ b/services/payments/src/simcore_service_payments/models/db.py @@ -8,7 +8,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel, HttpUrl +from pydantic.v1 import BaseModel, HttpUrl from simcore_postgres_database.models.payments_methods import InitPromptAckFlowState from simcore_postgres_database.models.payments_transactions import ( PaymentTransactionState, diff --git a/services/payments/src/simcore_service_payments/models/payments_gateway.py b/services/payments/src/simcore_service_payments/models/payments_gateway.py index e0d7481df58..cbca7b5813b 100644 --- a/services/payments/src/simcore_service_payments/models/payments_gateway.py +++ b/services/payments/src/simcore_service_payments/models/payments_gateway.py @@ -7,7 +7,7 @@ from models_library.basic_types import AmountDecimal, IDStr from models_library.payments import UserInvoiceAddress from models_library.products import StripePriceID, StripeTaxRateID -from pydantic import BaseModel, EmailStr, Extra, Field +from pydantic.v1 import BaseModel, EmailStr, Extra, Field COUNTRIES_WITH_VAT = ["CH", "LI"] diff --git a/services/payments/src/simcore_service_payments/models/schemas/acknowledgements.py b/services/payments/src/simcore_service_payments/models/schemas/acknowledgements.py index 5b73282cc3c..4d42a4bc808 100644 --- a/services/payments/src/simcore_service_payments/models/schemas/acknowledgements.py +++ b/services/payments/src/simcore_service_payments/models/schemas/acknowledgements.py @@ -3,7 +3,7 @@ from models_library.api_schemas_webserver.wallets import PaymentID, PaymentMethodID from models_library.basic_types import IDStr -from pydantic import BaseModel, Field, HttpUrl, validator +from pydantic.v1 import BaseModel, Field, HttpUrl, validator class _BaseAck(BaseModel): diff --git a/services/payments/src/simcore_service_payments/models/schemas/auth.py b/services/payments/src/simcore_service_payments/models/schemas/auth.py index 365b1ffe9a4..929278e916b 100644 --- a/services/payments/src/simcore_service_payments/models/schemas/auth.py +++ b/services/payments/src/simcore_service_payments/models/schemas/auth.py @@ -1,6 +1,6 @@ from typing import Literal -from pydantic import BaseModel +from pydantic.v1 import BaseModel class Token(BaseModel): diff --git a/services/payments/src/simcore_service_payments/models/schemas/meta.py b/services/payments/src/simcore_service_payments/models/schemas/meta.py index 06352b54ba1..900182c3440 100644 --- a/services/payments/src/simcore_service_payments/models/schemas/meta.py +++ b/services/payments/src/simcore_service_payments/models/schemas/meta.py @@ -1,7 +1,7 @@ from typing import Any, ClassVar from models_library.api_schemas__common.meta import BaseMeta -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl class Meta(BaseMeta): diff --git a/services/payments/src/simcore_service_payments/models/stripe.py b/services/payments/src/simcore_service_payments/models/stripe.py index 9b91365df58..3fa8c59a277 100644 --- a/services/payments/src/simcore_service_payments/models/stripe.py +++ b/services/payments/src/simcore_service_payments/models/stripe.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, HttpUrl +from pydantic.v1 import BaseModel, HttpUrl class InvoiceData(BaseModel): diff --git a/services/payments/src/simcore_service_payments/services/auto_recharge_process_message.py b/services/payments/src/simcore_service_payments/services/auto_recharge_process_message.py index 9507b32bf0a..c2daace9aa9 100644 --- a/services/payments/src/simcore_service_payments/services/auto_recharge_process_message.py +++ b/services/payments/src/simcore_service_payments/services/auto_recharge_process_message.py @@ -14,7 +14,7 @@ from models_library.rabbitmq_basic_types import RPCMethodName from models_library.rabbitmq_messages import WalletCreditsMessage from models_library.wallets import WalletID -from pydantic import parse_obj_as, parse_raw_as +from pydantic.v1 import parse_obj_as, parse_raw_as from simcore_service_payments.db.auto_recharge_repo import AutoRechargeRepo from simcore_service_payments.db.payments_methods_repo import PaymentsMethodsRepo from simcore_service_payments.db.payments_transactions_repo import ( diff --git a/services/payments/src/simcore_service_payments/services/notifier_email.py b/services/payments/src/simcore_service_payments/services/notifier_email.py index 8eeb09dc726..0f98cebcc3c 100644 --- a/services/payments/src/simcore_service_payments/services/notifier_email.py +++ b/services/payments/src/simcore_service_payments/services/notifier_email.py @@ -16,7 +16,7 @@ from models_library.api_schemas_webserver.wallets import PaymentMethodTransaction from models_library.products import ProductName from models_library.users import UserID -from pydantic import EmailStr +from pydantic.v1 import EmailStr from settings_library.email import EmailProtocol, SMTPSettings from tenacity import ( retry, diff --git a/services/payments/src/simcore_service_payments/services/payments.py b/services/payments/src/simcore_service_payments/services/payments.py index 6e73bb66089..7c72b7bf8de 100644 --- a/services/payments/src/simcore_service_payments/services/payments.py +++ b/services/payments/src/simcore_service_payments/services/payments.py @@ -27,7 +27,7 @@ from models_library.products import ProductName, StripePriceID, StripeTaxRateID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, HttpUrl, PositiveInt +from pydantic.v1 import EmailStr, HttpUrl, PositiveInt from servicelib.logging_utils import log_context from simcore_postgres_database.models.payments_transactions import ( PaymentTransactionState, diff --git a/services/payments/src/simcore_service_payments/services/payments_gateway.py b/services/payments/src/simcore_service_payments/services/payments_gateway.py index 0b1097492c6..0362aec821b 100644 --- a/services/payments/src/simcore_service_payments/services/payments_gateway.py +++ b/services/payments/src/simcore_service_payments/services/payments_gateway.py @@ -16,8 +16,8 @@ from fastapi.encoders import jsonable_encoder from httpx import URL, HTTPStatusError from models_library.api_schemas_webserver.wallets import PaymentID, PaymentMethodID -from pydantic import ValidationError, parse_raw_as -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import ValidationError, parse_raw_as +from pydantic.v1.errors import PydanticErrorMixin from servicelib.fastapi.app_state import SingletonInAppStateMixin from servicelib.fastapi.http_client import ( AttachLifespanMixin, diff --git a/services/payments/src/simcore_service_payments/services/payments_methods.py b/services/payments/src/simcore_service_payments/services/payments_methods.py index f20189d7859..124408074c9 100644 --- a/services/payments/src/simcore_service_payments/services/payments_methods.py +++ b/services/payments/src/simcore_service_payments/services/payments_methods.py @@ -27,7 +27,7 @@ from models_library.basic_types import IDStr from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, HttpUrl +from pydantic.v1 import EmailStr, HttpUrl from simcore_postgres_database.models.payments_methods import InitPromptAckFlowState from ..db.payments_methods_repo import PaymentsMethodsRepo diff --git a/services/payments/tests/conftest.py b/services/payments/tests/conftest.py index 042ac85f968..031c19f95c2 100644 --- a/services/payments/tests/conftest.py +++ b/services/payments/tests/conftest.py @@ -10,7 +10,7 @@ import simcore_service_payments from faker import Faker from models_library.users import GroupID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from servicelib.utils_secrets import generate_token_secret_key diff --git a/services/payments/tests/unit/api/test__one_time_payment_workflows.py b/services/payments/tests/unit/api/test__one_time_payment_workflows.py index 2052dee31f6..a1779c4ddfe 100644 --- a/services/payments/tests/unit/api/test__one_time_payment_workflows.py +++ b/services/payments/tests/unit/api/test__one_time_payment_workflows.py @@ -15,7 +15,7 @@ from models_library.rabbitmq_basic_types import RPCMethodName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/payments/tests/unit/api/test__payment_method_workflows.py b/services/payments/tests/unit/api/test__payment_method_workflows.py index 5b92bee8b17..c0545796b82 100644 --- a/services/payments/tests/unit/api/test__payment_method_workflows.py +++ b/services/payments/tests/unit/api/test__payment_method_workflows.py @@ -16,7 +16,7 @@ from models_library.rabbitmq_basic_types import RPCMethodName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/payments/tests/unit/api/test_rest_auth.py b/services/payments/tests/unit/api/test_rest_auth.py index eef8ee23cd2..70498327f53 100644 --- a/services/payments/tests/unit/api/test_rest_auth.py +++ b/services/payments/tests/unit/api/test_rest_auth.py @@ -8,7 +8,7 @@ import pytest from faker import Faker from fastapi import FastAPI, status -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl from simcore_service_payments.core.settings import ApplicationSettings from simcore_service_payments.models.schemas.auth import Token diff --git a/services/payments/tests/unit/conftest.py b/services/payments/tests/unit/conftest.py index 63f4ed97bbd..9b69456a855 100644 --- a/services/payments/tests/unit/conftest.py +++ b/services/payments/tests/unit/conftest.py @@ -23,7 +23,7 @@ from models_library.payments import StripeInvoiceID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.faker_factories import random_payment_method_view from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/payments/tests/unit/test__model_examples.py b/services/payments/tests/unit/test__model_examples.py index beab80e794d..c8bc8676732 100644 --- a/services/payments/tests/unit/test__model_examples.py +++ b/services/payments/tests/unit/test__model_examples.py @@ -9,7 +9,7 @@ import pytest import simcore_service_payments.models -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError from pytest_simcore.pydantic_models import walk_model_examples_in_package diff --git a/services/payments/tests/unit/test_rpc_payments.py b/services/payments/tests/unit/test_rpc_payments.py index 3e5b3ad1c2a..de05e062b38 100644 --- a/services/payments/tests/unit/test_rpc_payments.py +++ b/services/payments/tests/unit/test_rpc_payments.py @@ -13,7 +13,7 @@ from models_library.api_schemas_webserver.wallets import WalletPaymentInitiated from models_library.payments import UserInvoiceAddress from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from respx import MockRouter diff --git a/services/payments/tests/unit/test_rpc_payments_methods.py b/services/payments/tests/unit/test_rpc_payments_methods.py index 9ecb10d9976..d5a8a1d00c2 100644 --- a/services/payments/tests/unit/test_rpc_payments_methods.py +++ b/services/payments/tests/unit/test_rpc_payments_methods.py @@ -18,7 +18,7 @@ from models_library.rabbitmq_basic_types import RPCMethodName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, parse_obj_as +from pydantic.v1 import EmailStr, parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from respx import MockRouter diff --git a/services/payments/tests/unit/test_services_notifier.py b/services/payments/tests/unit/test_services_notifier.py index 5aab90f9f0f..275999a17bf 100644 --- a/services/payments/tests/unit/test_services_notifier.py +++ b/services/payments/tests/unit/test_services_notifier.py @@ -20,7 +20,7 @@ from models_library.api_schemas_webserver.socketio import SocketIORoomStr from models_library.api_schemas_webserver.wallets import PaymentTransaction from models_library.users import GroupID, UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.faker_factories import random_payment_transaction from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict diff --git a/services/payments/tests/unit/test_services_notifier_email.py b/services/payments/tests/unit/test_services_notifier_email.py index d078d902b1b..74b0434325a 100644 --- a/services/payments/tests/unit/test_services_notifier_email.py +++ b/services/payments/tests/unit/test_services_notifier_email.py @@ -13,7 +13,7 @@ from jinja2 import DictLoader, Environment, select_autoescape from models_library.products import ProductName from models_library.users import UserID -from pydantic import EmailStr +from pydantic.v1 import EmailStr from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/payments/tests/unit/test_services_payments.py b/services/payments/tests/unit/test_services_payments.py index 94452d9c772..78500d2f448 100644 --- a/services/payments/tests/unit/test_services_payments.py +++ b/services/payments/tests/unit/test_services_payments.py @@ -16,7 +16,7 @@ from models_library.payments import UserInvoiceAddress from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr +from pydantic.v1 import EmailStr from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/payments/tests/unit/test_services_payments__get_invoice.py b/services/payments/tests/unit/test_services_payments__get_invoice.py index 7a391b22351..38e3ae2cb9f 100644 --- a/services/payments/tests/unit/test_services_payments__get_invoice.py +++ b/services/payments/tests/unit/test_services_payments__get_invoice.py @@ -17,7 +17,7 @@ from models_library.payments import StripeInvoiceID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl from pytest_simcore.helpers.faker_factories import random_payment_transaction from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/resource-usage-tracker/requirements/_base.txt b/services/resource-usage-tracker/requirements/_base.txt index 64c4ae399ad..726aded6a97 100644 --- a/services/resource-usage-tracker/requirements/_base.txt +++ b/services/resource-usage-tracker/requirements/_base.txt @@ -48,6 +48,8 @@ aiosignal==1.3.1 # via aiohttp alembic==1.13.1 # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -64,10 +66,7 @@ arrow==1.3.0 # -r requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/_base.in # -r requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 - # via - # aiohttp - # asyncpg - # redis + # via asyncpg asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -118,25 +117,10 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.0 - # via anyio fast-depends==2.4.2 # via faststream -fastapi==0.99.1 +fastapi==0.112.2 # via - # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/aws-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/postgres-database/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/service-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../packages/settings-library/requirements/../../../requirements/constraints.txt - # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/service-library/requirements/_fastapi.in # -r requirements/_base.in # prometheus-fastapi-instrumentator @@ -272,7 +256,7 @@ prometheus-fastapi-instrumentator==6.1.0 # via -r requirements/../../../packages/service-library/requirements/_fastapi.in psycopg2-binary==2.9.9 # via sqlalchemy -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -302,6 +286,8 @@ pydantic==1.10.14 # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends # fastapi +pydantic-core==2.20.1 + # via pydantic pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -412,7 +398,7 @@ sqlalchemy==1.4.52 # -c requirements/../../../requirements/constraints.txt # -r requirements/../../../packages/postgres-database/requirements/_base.in # alembic -starlette==0.27.0 +starlette==0.38.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -465,16 +451,15 @@ typing-extensions==4.10.0 # aiodebug # aiodocker # alembic - # anyio # fastapi # faststream # pydantic + # pydantic-core # typer # types-aiobotocore # types-aiobotocore-ec2 # types-aiobotocore-s3 # types-aiobotocore-ssm - # uvicorn tzdata==2024.1 # via pandas tzlocal==5.2 diff --git a/services/resource-usage-tracker/requirements/_test.txt b/services/resource-usage-tracker/requirements/_test.txt index de56ac958c7..da66616cf44 100644 --- a/services/resource-usage-tracker/requirements/_test.txt +++ b/services/resource-usage-tracker/requirements/_test.txt @@ -2,6 +2,10 @@ alembic==1.13.1 # via # -c requirements/_base.txt # -r requirements/_test.in +annotated-types==0.7.0 + # via + # -c requirements/_base.txt + # pydantic antlr4-python3-runtime==4.13.2 # via moto anyio==4.3.0 @@ -10,10 +14,6 @@ anyio==4.3.0 # httpx asgi-lifespan==2.1.0 # via -r requirements/_test.in -async-timeout==4.0.3 - # via - # -c requirements/_base.txt - # redis attrs==23.2.0 # via # -c requirements/_base.txt @@ -69,11 +69,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.0 - # via - # -c requirements/_base.txt - # anyio - # pytest faker==27.0.0 # via -r requirements/_test.in fakeredis==2.23.5 @@ -191,11 +186,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via # -c requirements/_base.txt @@ -305,23 +304,17 @@ sympy==1.13.2 # via cfn-lint termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-requests==2.32.0.20240712 # via -r requirements/_test.in typing-extensions==4.10.0 # via # -c requirements/_base.txt # alembic - # anyio # aws-sam-translator # cfn-lint - # fakeredis # mypy # pydantic + # pydantic-core # sqlalchemy2-stubs urllib3==2.0.7 # via diff --git a/services/resource-usage-tracker/requirements/_tools.txt b/services/resource-usage-tracker/requirements/_tools.txt index b84cbbeb9fb..9ea4ddf842c 100644 --- a/services/resource-usage-tracker/requirements/_tools.txt +++ b/services/resource-usage-tracker/requirements/_tools.txt @@ -77,22 +77,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/_meta.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/_meta.py index 63e86cce819..3c74c4db153 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/_meta.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/_meta.py @@ -6,7 +6,7 @@ from models_library.basic_types import VersionStr from packaging.version import Version -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.utils_meta import PackageInfo from settings_library.basic_types import VersionTag diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rest/_meta.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rest/_meta.py index 5ffa18d202a..a583791c8b4 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rest/_meta.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rest/_meta.py @@ -2,7 +2,7 @@ from collections.abc import Callable from fastapi import APIRouter, Depends -from pydantic import BaseModel, HttpUrl +from pydantic.v1 import BaseModel, HttpUrl from ..._meta import API_VERSION, PROJECT_NAME from .dependencies import get_reverse_url_mapper diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rpc/_resource_tracker.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rpc/_resource_tracker.py index cae70b1152c..2b812c64ea4 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rpc/_resource_tracker.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/api/rpc/_resource_tracker.py @@ -24,7 +24,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl from servicelib.rabbitmq import RPCRouter from servicelib.rabbitmq.rpc_interfaces.resource_usage_tracker.errors import ( CustomResourceUsageTrackerError, diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/core/settings.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/core/settings.py index 7ac7599ed58..21798db0cd7 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/core/settings.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/core/settings.py @@ -2,7 +2,7 @@ from functools import cached_property from models_library.basic_types import BootModeEnum -from pydantic import Field, PositiveInt, validator +from pydantic.v1 import Field, PositiveInt, validator from settings_library.base import BaseCustomSettings from settings_library.basic_types import BuildTargetEnum, LogLevel, VersionTag from settings_library.postgres import PostgresSettings diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_credit_transactions.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_credit_transactions.py index a264f90d375..2137aead4d7 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_credit_transactions.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_credit_transactions.py @@ -13,7 +13,7 @@ ) from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel +from pydantic.v1 import BaseModel class CreditTransactionCreate(BaseModel): diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_plans.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_plans.py index f946c92e5d9..afd33195778 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_plans.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_plans.py @@ -2,7 +2,7 @@ from models_library.resource_tracker import PricingPlanClassification, PricingPlanId from models_library.services import ServiceKey, ServiceVersion -from pydantic import BaseModel +from pydantic.v1 import BaseModel ## DB Models diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_unit_costs.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_unit_costs.py index b5fa3daadf0..2ca7ac319f1 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_unit_costs.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_unit_costs.py @@ -6,7 +6,7 @@ PricingUnitCostId, PricingUnitId, ) -from pydantic import BaseModel +from pydantic.v1 import BaseModel class PricingUnitCostsDB(BaseModel): diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_units.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_units.py index f0fed877d43..e8d5cf8f5cb 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_units.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_pricing_units.py @@ -9,7 +9,7 @@ PricingUnitId, UnitExtraInfo, ) -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator class PricingUnitsDB(BaseModel): diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_service_runs.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_service_runs.py index 45cddca3057..c1b5fd1d709 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_service_runs.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/models/resource_tracker_service_runs.py @@ -16,7 +16,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel, NonNegativeInt +from pydantic.v1 import BaseModel, NonNegativeInt class ServiceRunCreate(BaseModel): diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/modules/db/repositories/resource_tracker.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/modules/db/repositories/resource_tracker.py index a341bf35e6a..98dff95f918 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/modules/db/repositories/resource_tracker.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/modules/db/repositories/resource_tracker.py @@ -27,7 +27,7 @@ from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.rabbitmq.rpc_interfaces.resource_usage_tracker.errors import ( CustomResourceUsageTrackerError, ) diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_background_task.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_background_task.py index 213dd706582..9979e5f9d94 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_background_task.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_background_task.py @@ -9,7 +9,7 @@ ServiceRunId, ServiceRunStatus, ) -from pydantic import NonNegativeInt, PositiveInt +from pydantic.v1 import NonNegativeInt, PositiveInt from .core.settings import ApplicationSettings from .models.resource_tracker_credit_transactions import ( diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_process_messages.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_process_messages.py index 4cb024b3b7c..e9eaa3c5482 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_process_messages.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_process_messages.py @@ -20,7 +20,7 @@ ServiceRunStatus, ) from models_library.services import ServiceType -from pydantic import parse_raw_as +from pydantic.v1 import parse_raw_as from .models.resource_tracker_credit_transactions import ( CreditTransactionCreate, diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py index 4466fc5e7de..90345e642bb 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/resource_tracker_utils.py @@ -17,7 +17,7 @@ from models_library.resource_tracker import ServiceRunId, ServiceRunStatus from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.rabbitmq import RabbitMQClient from .modules.db.repositories.resource_tracker import ResourceTrackerRepository diff --git a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py index 75e17e28c96..b73f55d10fc 100644 --- a/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py +++ b/services/resource-usage-tracker/src/simcore_service_resource_usage_tracker/services/resource_tracker_service_runs.py @@ -18,7 +18,7 @@ from models_library.rest_ordering import OrderBy from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import AnyUrl, PositiveInt +from pydantic.v1 import AnyUrl, PositiveInt from servicelib.rabbitmq.rpc_interfaces.resource_usage_tracker.errors import ( CustomResourceUsageTrackerError, ) diff --git a/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_service_runs__export.py b/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_service_runs__export.py index c53c1accb90..afa3f950c57 100644 --- a/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_service_runs__export.py +++ b/services/resource-usage-tracker/tests/unit/with_dbs/test_api_resource_tracker_service_runs__export.py @@ -4,7 +4,7 @@ import pytest import sqlalchemy as sa from moto.server import ThreadedMotoServer -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from servicelib.rabbitmq import RabbitMQRPCClient diff --git a/services/storage/requirements/_base.txt b/services/storage/requirements/_base.txt index a2136baf20a..2a4953e8347 100644 --- a/services/storage/requirements/_base.txt +++ b/services/storage/requirements/_base.txt @@ -61,6 +61,8 @@ aiozipkin==1.1.1 # via -r requirements/../../../packages/service-library/requirements/_aiohttp.in alembic==1.13.1 # via -r requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -75,10 +77,8 @@ arrow==1.3.0 # -r requirements/../../../packages/service-library/requirements/_base.in async-timeout==4.0.3 # via - # aiohttp # aiopg # asyncpg - # redis asyncpg==0.29.0 # via sqlalchemy attrs==23.2.0 @@ -120,8 +120,6 @@ dnspython==2.6.1 # via email-validator email-validator==2.1.1 # via pydantic -exceptiongroup==1.2.1 - # via anyio fast-depends==2.4.2 # via faststream faststream==0.5.10 @@ -254,7 +252,7 @@ psycopg2-binary==2.9.9 # via # aiopg # sqlalchemy -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../packages/aws-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../packages/aws-library/requirements/../../../packages/service-library/requirements/../../../packages/models-library/requirements/../../../requirements/constraints.txt @@ -283,6 +281,8 @@ pydantic==1.10.14 # -r requirements/../../../packages/service-library/requirements/_base.in # -r requirements/../../../packages/settings-library/requirements/_base.in # fast-depends +pydantic-core==2.20.1 + # via pydantic pygments==2.17.2 # via rich pyinstrument==4.6.2 @@ -422,9 +422,9 @@ typing-extensions==4.10.0 # aiodebug # aiodocker # alembic - # anyio # faststream # pydantic + # pydantic-core # typer # types-aiobotocore # types-aiobotocore-ec2 diff --git a/services/storage/requirements/_test.txt b/services/storage/requirements/_test.txt index c88441caaad..4b8a32b3d80 100644 --- a/services/storage/requirements/_test.txt +++ b/services/storage/requirements/_test.txt @@ -11,13 +11,12 @@ aiosignal==1.3.1 # via # -c requirements/_base.txt # aiohttp -antlr4-python3-runtime==4.13.2 - # via moto -async-timeout==4.0.3 +annotated-types==0.7.0 # via # -c requirements/_base.txt - # aiohttp - # redis + # pydantic +antlr4-python3-runtime==4.13.2 + # via moto attrs==23.2.0 # via # -c requirements/_base.txt @@ -73,10 +72,6 @@ docker==7.1.0 # via # -r requirements/_test.in # moto -exceptiongroup==1.2.1 - # via - # -c requirements/_base.txt - # pytest faker==27.0.0 # via -r requirements/_test.in fakeredis==2.23.5 @@ -202,11 +197,15 @@ py-partiql-parser==0.5.5 # via moto pycparser==2.22 # via cffi -pydantic==1.10.14 +pydantic==2.8.2 # via # -c requirements/../../../requirements/constraints.txt # -c requirements/_base.txt # aws-sam-translator +pydantic-core==2.20.1 + # via + # -c requirements/_base.txt + # pydantic pyparsing==3.1.2 # via moto pytest==8.3.2 @@ -317,11 +316,6 @@ sympy==1.13.2 # via cfn-lint termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via - # coverage - # mypy - # pytest types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in typing-extensions==4.10.0 @@ -329,9 +323,9 @@ typing-extensions==4.10.0 # -c requirements/_base.txt # aws-sam-translator # cfn-lint - # fakeredis # mypy # pydantic + # pydantic-core # sqlalchemy2-stubs tzdata==2024.1 # via pandas diff --git a/services/storage/requirements/_tools.txt b/services/storage/requirements/_tools.txt index b84cbbeb9fb..9ea4ddf842c 100644 --- a/services/storage/requirements/_tools.txt +++ b/services/storage/requirements/_tools.txt @@ -77,22 +77,12 @@ setuptools==73.0.1 # via # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint typing-extensions==4.10.0 # via # -c requirements/_base.txt # -c requirements/_test.txt - # astroid - # black # mypy virtualenv==20.26.3 # via pre-commit diff --git a/services/storage/src/simcore_service_storage/constants.py b/services/storage/src/simcore_service_storage/constants.py index f9c6a36f5c2..f2b9bcacc57 100644 --- a/services/storage/src/simcore_service_storage/constants.py +++ b/services/storage/src/simcore_service_storage/constants.py @@ -2,7 +2,7 @@ from aws_library.s3 import PRESIGNED_LINK_MAX_SIZE, S3_MAX_FILE_SIZE from models_library.api_schemas_storage import LinkType -from pydantic import ByteSize +from pydantic.v1 import ByteSize from servicelib.aiohttp import application_keys RETRY_WAIT_SECS = 2 diff --git a/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter.py b/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter.py index 5e1f4cff09c..44c4dada0e6 100644 --- a/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter.py +++ b/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter.py @@ -9,7 +9,7 @@ from aiohttp.client import ClientSession from models_library.api_schemas_storage import DatCoreDatasetName from models_library.users import UserID -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from servicelib.aiohttp.application_keys import APP_CONFIG_KEY from servicelib.aiohttp.client_session import get_client_session from servicelib.utils import logged_gather diff --git a/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter_settings.py b/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter_settings.py index c1322590eaa..e92d58573b7 100644 --- a/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter_settings.py +++ b/services/storage/src/simcore_service_storage/datcore_adapter/datcore_adapter_settings.py @@ -1,7 +1,7 @@ from functools import cached_property from models_library.basic_types import PortInt, VersionTag -from pydantic import AnyHttpUrl, Field +from pydantic.v1 import AnyHttpUrl, Field from settings_library.base import BaseCustomSettings diff --git a/services/storage/src/simcore_service_storage/datcore_dsm.py b/services/storage/src/simcore_service_storage/datcore_dsm.py index 3ced68fa3f4..cfec6998f7e 100644 --- a/services/storage/src/simcore_service_storage/datcore_dsm.py +++ b/services/storage/src/simcore_service_storage/datcore_dsm.py @@ -10,7 +10,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import LocationID, LocationName, StorageFileID from models_library.users import UserID -from pydantic import AnyUrl, ByteSize +from pydantic.v1 import AnyUrl, ByteSize from .constants import DATCORE_ID, DATCORE_STR from .datcore_adapter import datcore_adapter diff --git a/services/storage/src/simcore_service_storage/db_projects.py b/services/storage/src/simcore_service_storage/db_projects.py index a8bf48db80e..40b39b8fef4 100644 --- a/services/storage/src/simcore_service_storage/db_projects.py +++ b/services/storage/src/simcore_service_storage/db_projects.py @@ -4,7 +4,7 @@ import sqlalchemy as sa from aiopg.sa.connection import SAConnection from models_library.projects import ProjectAtDB, ProjectID -from pydantic import ValidationError +from pydantic.v1 import ValidationError from simcore_postgres_database.storage_models import projects diff --git a/services/storage/src/simcore_service_storage/dsm_factory.py b/services/storage/src/simcore_service_storage/dsm_factory.py index c84ca4f15db..37cad63f5f8 100644 --- a/services/storage/src/simcore_service_storage/dsm_factory.py +++ b/services/storage/src/simcore_service_storage/dsm_factory.py @@ -8,7 +8,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import LocationID, LocationName, StorageFileID from models_library.users import UserID -from pydantic import AnyUrl, ByteSize +from pydantic.v1 import AnyUrl, ByteSize from .models import DatasetMetaData, FileMetaData, UploadLinks diff --git a/services/storage/src/simcore_service_storage/exceptions.py b/services/storage/src/simcore_service_storage/exceptions.py index d41c6d16d75..2124c9cdeb7 100644 --- a/services/storage/src/simcore_service_storage/exceptions.py +++ b/services/storage/src/simcore_service_storage/exceptions.py @@ -1,4 +1,4 @@ -from pydantic.errors import PydanticErrorMixin +from pydantic.v1.errors import PydanticErrorMixin class StorageRuntimeError(PydanticErrorMixin, RuntimeError): diff --git a/services/storage/src/simcore_service_storage/handlers_files.py b/services/storage/src/simcore_service_storage/handlers_files.py index 8cb96d267a2..d464c61ddb4 100644 --- a/services/storage/src/simcore_service_storage/handlers_files.py +++ b/services/storage/src/simcore_service_storage/handlers_files.py @@ -18,7 +18,7 @@ ) from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import ( parse_request_body_as, diff --git a/services/storage/src/simcore_service_storage/models.py b/services/storage/src/simcore_service_storage/models.py index d05099edd06..436fe49b41d 100644 --- a/services/storage/src/simcore_service_storage/models.py +++ b/services/storage/src/simcore_service_storage/models.py @@ -27,7 +27,7 @@ ) from models_library.users import UserID from models_library.utils.common_validators import empty_str_to_none_pre_validator -from pydantic import ( +from pydantic.v1 import ( AnyUrl, BaseModel, ByteSize, diff --git a/services/storage/src/simcore_service_storage/s3_utils.py b/services/storage/src/simcore_service_storage/s3_utils.py index 57e9b4e9d1c..032ac5ac476 100644 --- a/services/storage/src/simcore_service_storage/s3_utils.py +++ b/services/storage/src/simcore_service_storage/s3_utils.py @@ -1,7 +1,7 @@ import logging from dataclasses import dataclass -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.aiohttp.long_running_tasks.server import ( ProgressMessage, ProgressPercent, diff --git a/services/storage/src/simcore_service_storage/settings.py b/services/storage/src/simcore_service_storage/settings.py index dc01d96f99e..4d925348070 100644 --- a/services/storage/src/simcore_service_storage/settings.py +++ b/services/storage/src/simcore_service_storage/settings.py @@ -1,6 +1,6 @@ from typing import Any -from pydantic import Field, PositiveInt, root_validator, validator +from pydantic.v1 import Field, PositiveInt, root_validator, validator from settings_library.base import BaseCustomSettings from settings_library.basic_types import LogLevel, PortInt from settings_library.postgres import PostgresSettings diff --git a/services/storage/src/simcore_service_storage/simcore_s3_dsm.py b/services/storage/src/simcore_service_storage/simcore_s3_dsm.py index 7084838eae0..1b55b274d39 100644 --- a/services/storage/src/simcore_service_storage/simcore_s3_dsm.py +++ b/services/storage/src/simcore_service_storage/simcore_s3_dsm.py @@ -24,7 +24,7 @@ StorageFileID, ) from models_library.users import UserID -from pydantic import AnyUrl, ByteSize, NonNegativeInt, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, NonNegativeInt, parse_obj_as from servicelib.aiohttp.client_session import get_client_session from servicelib.aiohttp.long_running_tasks.server import TaskProgress from servicelib.logging_utils import log_context diff --git a/services/storage/src/simcore_service_storage/simcore_s3_dsm_utils.py b/services/storage/src/simcore_service_storage/simcore_s3_dsm_utils.py index 3cb3cbfc399..107e7b50a1e 100644 --- a/services/storage/src/simcore_service_storage/simcore_s3_dsm_utils.py +++ b/services/storage/src/simcore_service_storage/simcore_s3_dsm_utils.py @@ -10,7 +10,7 @@ SimcoreS3FileID, StorageFileID, ) -from pydantic import ByteSize, NonNegativeInt, parse_obj_as +from pydantic.v1 import ByteSize, NonNegativeInt, parse_obj_as from servicelib.utils import ensure_ends_with from . import db_file_meta_data diff --git a/services/storage/src/simcore_service_storage/utils_handlers.py b/services/storage/src/simcore_service_storage/utils_handlers.py index e0438cc0c92..2c561557118 100644 --- a/services/storage/src/simcore_service_storage/utils_handlers.py +++ b/services/storage/src/simcore_service_storage/utils_handlers.py @@ -4,7 +4,7 @@ from aiohttp.typedefs import Handler from aiohttp.web_request import Request from aws_library.s3 import S3AccessError, S3KeyNotFoundError -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.aiohttp.aiopg_utils import DBAPIError from .datcore_adapter.datcore_adapter_exceptions import DatcoreAdapterTimeoutError diff --git a/services/storage/tests/conftest.py b/services/storage/tests/conftest.py index 1b3f634446c..f33903455cd 100644 --- a/services/storage/tests/conftest.py +++ b/services/storage/tests/conftest.py @@ -39,7 +39,7 @@ from models_library.projects_nodes_io import LocationID, SimcoreS3FileID from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.logging_tools import log_context diff --git a/services/storage/tests/fixtures/data_models.py b/services/storage/tests/fixtures/data_models.py index ae5816a427f..5ec3f1d3fc1 100644 --- a/services/storage/tests/fixtures/data_models.py +++ b/services/storage/tests/fixtures/data_models.py @@ -18,7 +18,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimcoreS3FileID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.faker_factories import random_project, random_user from servicelib.utils import limited_gather from simcore_postgres_database.models.project_to_groups import project_to_groups diff --git a/services/storage/tests/unit/test_dsm.py b/services/storage/tests/unit/test_dsm.py index ae07ec94c9b..259dd5f7c08 100644 --- a/services/storage/tests/unit/test_dsm.py +++ b/services/storage/tests/unit/test_dsm.py @@ -10,7 +10,7 @@ from faker import Faker from models_library.projects_nodes_io import SimcoreS3FileID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.utils import limited_gather from simcore_service_storage.models import FileMetaData, S3BucketName from simcore_service_storage.simcore_s3_dsm import SimcoreS3DataManager diff --git a/services/storage/tests/unit/test_dsm_dsmcleaner.py b/services/storage/tests/unit/test_dsm_dsmcleaner.py index fd759ca1bf2..4c4813c1942 100644 --- a/services/storage/tests/unit/test_dsm_dsmcleaner.py +++ b/services/storage/tests/unit/test_dsm_dsmcleaner.py @@ -22,7 +22,7 @@ from models_library.basic_types import SHA256Str from models_library.projects_nodes_io import SimcoreS3DirectoryID, SimcoreS3FileID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.parametrizations import byte_size_ids from simcore_postgres_database.storage_models import file_meta_data from simcore_service_storage import db_file_meta_data diff --git a/services/storage/tests/unit/test_dsm_soft_links.py b/services/storage/tests/unit/test_dsm_soft_links.py index d2d1c6acd65..9a13f60000e 100644 --- a/services/storage/tests/unit/test_dsm_soft_links.py +++ b/services/storage/tests/unit/test_dsm_soft_links.py @@ -13,7 +13,7 @@ from models_library.projects_nodes_io import SimcoreS3FileID from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import ByteSize +from pydantic.v1 import ByteSize from simcore_postgres_database.storage_models import file_meta_data from simcore_service_storage.models import FileMetaData, FileMetaDataAtDB from simcore_service_storage.simcore_s3_dsm import SimcoreS3DataManager diff --git a/services/storage/tests/unit/test_handlers_datasets.py b/services/storage/tests/unit/test_handlers_datasets.py index 92408a33136..7d38981f7b4 100644 --- a/services/storage/tests/unit/test_handlers_datasets.py +++ b/services/storage/tests/unit/test_handlers_datasets.py @@ -15,7 +15,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import SimcoreS3FileID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.parametrizations import ( diff --git a/services/storage/tests/unit/test_handlers_files.py b/services/storage/tests/unit/test_handlers_files.py index 21e3bac8c3d..952a84c4629 100644 --- a/services/storage/tests/unit/test_handlers_files.py +++ b/services/storage/tests/unit/test_handlers_files.py @@ -42,7 +42,7 @@ from models_library.projects_nodes_io import LocationID, NodeID, SimcoreS3FileID from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyHttpUrl, ByteSize, HttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, ByteSize, HttpUrl, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.logging_tools import log_context diff --git a/services/storage/tests/unit/test_handlers_files_metadata.py b/services/storage/tests/unit/test_handlers_files_metadata.py index dd0c8138ebb..77bf32d42d4 100644 --- a/services/storage/tests/unit/test_handlers_files_metadata.py +++ b/services/storage/tests/unit/test_handlers_files_metadata.py @@ -16,7 +16,7 @@ from models_library.api_schemas_storage import FileMetaDataGet, SimcoreS3FileID from models_library.projects import ProjectID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from servicelib.aiohttp import status diff --git a/services/storage/tests/unit/test_handlers_simcore_s3.py b/services/storage/tests/unit/test_handlers_simcore_s3.py index e922f1f60f0..3367ee59479 100644 --- a/services/storage/tests/unit/test_handlers_simcore_s3.py +++ b/services/storage/tests/unit/test_handlers_simcore_s3.py @@ -26,7 +26,7 @@ from models_library.projects_nodes_io import NodeID, NodeIDStr, SimcoreS3FileID from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.logging_tools import log_context from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/storage/tests/unit/test_models.py b/services/storage/tests/unit/test_models.py index 82bd900b772..98334483416 100644 --- a/services/storage/tests/unit/test_models.py +++ b/services/storage/tests/unit/test_models.py @@ -4,7 +4,7 @@ from models_library.api_schemas_storage import S3BucketName from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimcoreS3FileID, StorageFileID -from pydantic import ValidationError, parse_obj_as +from pydantic.v1 import ValidationError, parse_obj_as from simcore_service_storage.models import FileMetaData from simcore_service_storage.simcore_s3_dsm import SimcoreS3DataManager diff --git a/services/storage/tests/unit/test_simcore_s3_dsm.py b/services/storage/tests/unit/test_simcore_s3_dsm.py index 56ab5e06407..9da21290de2 100644 --- a/services/storage/tests/unit/test_simcore_s3_dsm.py +++ b/services/storage/tests/unit/test_simcore_s3_dsm.py @@ -12,7 +12,7 @@ from models_library.basic_types import SHA256Str from models_library.projects_nodes_io import SimcoreS3FileID from models_library.users import UserID -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from simcore_service_storage import db_file_meta_data from simcore_service_storage.models import FileMetaData from simcore_service_storage.s3 import get_s3_client diff --git a/services/storage/tests/unit/test_utils.py b/services/storage/tests/unit/test_utils.py index 1b71a1c29d5..6df3596fe8c 100644 --- a/services/storage/tests/unit/test_utils.py +++ b/services/storage/tests/unit/test_utils.py @@ -16,7 +16,7 @@ from faker import Faker from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, SimcoreS3FileID -from pydantic import ByteSize, HttpUrl, parse_obj_as +from pydantic.v1 import ByteSize, HttpUrl, parse_obj_as from simcore_service_storage.constants import S3_UNDEFINED_OR_EXTERNAL_MULTIPART_ID from simcore_service_storage.models import ETag, FileMetaData, S3BucketName, UploadID from simcore_service_storage.simcore_s3_dsm import SimcoreS3DataManager diff --git a/services/storage/tests/unit/test_utils_handlers.py b/services/storage/tests/unit/test_utils_handlers.py index a5f82a6b893..11a47f8cb80 100644 --- a/services/storage/tests/unit/test_utils_handlers.py +++ b/services/storage/tests/unit/test_utils_handlers.py @@ -7,7 +7,7 @@ from aiohttp import web from aiohttp.typedefs import Handler from aws_library.s3 import S3KeyNotFoundError -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError from pytest_mock import MockerFixture from servicelib.aiohttp.aiopg_utils import DBAPIError from simcore_service_storage.db_access_layer import InvalidFileIdentifierError diff --git a/services/web/server/requirements/_base.txt b/services/web/server/requirements/_base.txt index ab574d6c39f..115ce8b419e 100644 --- a/services/web/server/requirements/_base.txt +++ b/services/web/server/requirements/_base.txt @@ -72,6 +72,8 @@ alembic==1.8.1 # via # -r requirements/../../../../packages/postgres-database/requirements/_base.in # -r requirements/../../../../packages/simcore-sdk/requirements/../../../packages/postgres-database/requirements/_base.in +annotated-types==0.7.0 + # via pydantic anyio==4.3.0 # via # fast-depends @@ -88,7 +90,6 @@ async-timeout==4.0.3 # via # aiohttp # aiopg - # redis asyncpg==0.27.0 # via # -r requirements/_base.in @@ -148,7 +149,7 @@ cryptography==41.0.7 # aiohttp-session dnspython==2.2.1 # via email-validator -email-validator==1.2.1 +email-validator==2.2.0 # via pydantic et-xmlfile==1.1.0 # via openpyxl @@ -296,7 +297,7 @@ pycountry==23.12.11 # via -r requirements/_base.in pycparser==2.21 # via cffi -pydantic==1.10.17 +pydantic==2.8.2 # via # -c requirements/../../../../packages/models-library/requirements/../../../requirements/constraints.txt # -c requirements/../../../../packages/postgres-database/requirements/../../../requirements/constraints.txt @@ -329,6 +330,8 @@ pydantic==1.10.17 # -r requirements/../../../../packages/simcore-sdk/requirements/_base.in # -r requirements/_base.in # fast-depends +pydantic-core==2.20.1 + # via pydantic pygments==2.15.1 # via rich pyinstrument==4.6.1 @@ -468,6 +471,7 @@ typing-extensions==4.12.0 # aiodocker # faststream # pydantic + # pydantic-core # typer ujson==5.5.0 # via diff --git a/services/web/server/requirements/_test.txt b/services/web/server/requirements/_test.txt index 28185fac32f..24351f69d65 100644 --- a/services/web/server/requirements/_test.txt +++ b/services/web/server/requirements/_test.txt @@ -18,7 +18,6 @@ async-timeout==4.0.3 # via # -c requirements/_base.txt # aiohttp - # redis asyncpg==0.27.0 # via # -c requirements/_base.txt @@ -217,8 +216,6 @@ tenacity==8.5.0 # -r requirements/_test.in termcolor==2.4.0 # via pytest-sugar -tomli==2.0.1 - # via coverage types-aiofiles==24.1.0.20240626 # via -r requirements/_test.in types-jsonschema==4.23.0.20240813 diff --git a/services/web/server/requirements/_tools.txt b/services/web/server/requirements/_tools.txt index 4d6682cf5c2..010723ce3ae 100644 --- a/services/web/server/requirements/_tools.txt +++ b/services/web/server/requirements/_tools.txt @@ -81,14 +81,6 @@ setuptools==69.1.1 # -c requirements/_base.txt # -c requirements/_test.txt # pip-tools -tomli==2.0.1 - # via - # -c requirements/_test.txt - # black - # build - # mypy - # pip-tools - # pylint tomlkit==0.13.2 # via pylint types-cachetools==5.5.0.20240820 diff --git a/services/web/server/src/simcore_service_webserver/activity/_handlers.py b/services/web/server/src/simcore_service_webserver/activity/_handlers.py index ba7ec32557a..03f477473df 100644 --- a/services/web/server/src/simcore_service_webserver/activity/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/activity/_handlers.py @@ -4,7 +4,7 @@ import aiohttp import aiohttp.web from models_library.api_schemas_webserver.activity import ActivityStatusDict -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.aiohttp.client_session import get_client_session from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON from servicelib.request_keys import RQT_USERID_KEY diff --git a/services/web/server/src/simcore_service_webserver/announcements/_models.py b/services/web/server/src/simcore_service_webserver/announcements/_models.py index 4edb7c8d20a..86d731c17a4 100644 --- a/services/web/server/src/simcore_service_webserver/announcements/_models.py +++ b/services/web/server/src/simcore_service_webserver/announcements/_models.py @@ -2,7 +2,7 @@ from typing import Any, ClassVar, Literal import arrow -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator # NOTE: this model is used for BOTH diff --git a/services/web/server/src/simcore_service_webserver/announcements/_redis.py b/services/web/server/src/simcore_service_webserver/announcements/_redis.py index aad45ea8fee..3fec44c9782 100644 --- a/services/web/server/src/simcore_service_webserver/announcements/_redis.py +++ b/services/web/server/src/simcore_service_webserver/announcements/_redis.py @@ -6,7 +6,7 @@ import redis.asyncio as aioredis from aiohttp import web -from pydantic import ValidationError +from pydantic.v1 import ValidationError from ..redis import get_redis_announcements_client from ._models import Announcement diff --git a/services/web/server/src/simcore_service_webserver/api_keys/_handlers.py b/services/web/server/src/simcore_service_webserver/api_keys/_handlers.py index ce7a7be0943..86d14be6b4d 100644 --- a/services/web/server/src/simcore_service_webserver/api_keys/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/api_keys/_handlers.py @@ -4,7 +4,7 @@ from aiohttp.web import RouteTableDef from models_library.api_schemas_webserver.auth import ApiKeyCreate from models_library.users import UserID -from pydantic import Field +from pydantic.v1 import Field from servicelib.aiohttp.requests_validation import RequestParams, parse_request_body_as from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON from simcore_postgres_database.errors import DatabaseError diff --git a/services/web/server/src/simcore_service_webserver/application_settings.py b/services/web/server/src/simcore_service_webserver/application_settings.py index 00804af2155..e1ae9ca6bc9 100644 --- a/services/web/server/src/simcore_service_webserver/application_settings.py +++ b/services/web/server/src/simcore_service_webserver/application_settings.py @@ -11,9 +11,9 @@ VersionTag, ) from models_library.utils.change_case import snake_to_camel -from pydantic import AnyHttpUrl, parse_obj_as, root_validator, validator -from pydantic.fields import Field, ModelField -from pydantic.types import PositiveInt +from pydantic.v1 import AnyHttpUrl, parse_obj_as, root_validator, validator +from pydantic.v1.fields import Field, ModelField +from pydantic.v1.types import PositiveInt from settings_library.base import BaseCustomSettings from settings_library.email import SMTPSettings from settings_library.postgres import PostgresSettings diff --git a/services/web/server/src/simcore_service_webserver/application_settings_utils.py b/services/web/server/src/simcore_service_webserver/application_settings_utils.py index 92ac39342e0..7225a5fbff2 100644 --- a/services/web/server/src/simcore_service_webserver/application_settings_utils.py +++ b/services/web/server/src/simcore_service_webserver/application_settings_utils.py @@ -10,7 +10,7 @@ from typing import Any from aiohttp import web -from pydantic.types import SecretStr +from pydantic.v1.types import SecretStr from servicelib.aiohttp.typing_extension import Handler from ._constants import MSG_UNDER_DEVELOPMENT diff --git a/services/web/server/src/simcore_service_webserver/catalog/_api.py b/services/web/server/src/simcore_service_webserver/catalog/_api.py index 9bbbae4e43c..9855a4f8644 100644 --- a/services/web/server/src/simcore_service_webserver/catalog/_api.py +++ b/services/web/server/src/simcore_service_webserver/catalog/_api.py @@ -23,7 +23,7 @@ from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder from pint import UnitRegistry -from pydantic import BaseModel +from pydantic.v1 import BaseModel from servicelib.aiohttp.requests_validation import handle_validation_as_http_error from servicelib.rabbitmq.rpc_interfaces.catalog import services as catalog_rpc from servicelib.rest_constants import RESPONSE_MODEL_POLICY diff --git a/services/web/server/src/simcore_service_webserver/catalog/_handlers.py b/services/web/server/src/simcore_service_webserver/catalog/_handlers.py index cfaafe30ab6..ae8cfb9f4b9 100644 --- a/services/web/server/src/simcore_service_webserver/catalog/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/catalog/_handlers.py @@ -26,7 +26,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import BaseModel, Extra, Field, parse_obj_as, validator +from pydantic.v1 import BaseModel, Extra, Field, parse_obj_as, validator from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/catalog/client.py b/services/web/server/src/simcore_service_webserver/catalog/client.py index 8a8f6083252..eaad978552c 100644 --- a/services/web/server/src/simcore_service_webserver/catalog/client.py +++ b/services/web/server/src/simcore_service_webserver/catalog/client.py @@ -19,7 +19,7 @@ ) from models_library.services_resources import ServiceResourcesDict from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.aiohttp import status from servicelib.aiohttp.client_session import get_client_session from servicelib.rest_constants import X_PRODUCT_NAME_HEADER diff --git a/services/web/server/src/simcore_service_webserver/clusters/_handlers.py b/services/web/server/src/simcore_service_webserver/clusters/_handlers.py index 70752da883b..4ccd0614603 100644 --- a/services/web/server/src/simcore_service_webserver/clusters/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/clusters/_handlers.py @@ -11,7 +11,7 @@ ClusterPing, ) from models_library.users import UserID -from pydantic import BaseModel, Field, parse_obj_as +from pydantic.v1 import BaseModel, Field, parse_obj_as from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import ( parse_request_body_as, diff --git a/services/web/server/src/simcore_service_webserver/db_listener/_db_comp_tasks_listening_task.py b/services/web/server/src/simcore_service_webserver/db_listener/_db_comp_tasks_listening_task.py index eba764a2504..28f1cd4e5d3 100644 --- a/services/web/server/src/simcore_service_webserver/db_listener/_db_comp_tasks_listening_task.py +++ b/services/web/server/src/simcore_service_webserver/db_listener/_db_comp_tasks_listening_task.py @@ -17,7 +17,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.projects_state import RunningState -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt from servicelib.aiohttp.application_keys import APP_DB_ENGINE_KEY from simcore_postgres_database.webserver_models import DB_CHANNEL_NAME, projects from sqlalchemy.sql import select diff --git a/services/web/server/src/simcore_service_webserver/diagnostics/_handlers.py b/services/web/server/src/simcore_service_webserver/diagnostics/_handlers.py index 13154bf5723..c941e8839b9 100644 --- a/services/web/server/src/simcore_service_webserver/diagnostics/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/diagnostics/_handlers.py @@ -10,7 +10,7 @@ from aiohttp import ClientError, ClientSession, web from models_library.app_diagnostics import AppStatusCheck from models_library.utils.pydantic_tools_extension import FieldNotRequired -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from servicelib.aiohttp.client_session import get_client_session from servicelib.aiohttp.requests_validation import parse_request_query_parameters_as from servicelib.utils import logged_gather diff --git a/services/web/server/src/simcore_service_webserver/diagnostics/settings.py b/services/web/server/src/simcore_service_webserver/diagnostics/settings.py index 777a1ac9457..6e469d5728e 100644 --- a/services/web/server/src/simcore_service_webserver/diagnostics/settings.py +++ b/services/web/server/src/simcore_service_webserver/diagnostics/settings.py @@ -1,5 +1,5 @@ from aiohttp.web import Application -from pydantic import Field, NonNegativeFloat, PositiveFloat, validator +from pydantic.v1 import Field, NonNegativeFloat, PositiveFloat, validator from servicelib.aiohttp.application_keys import APP_SETTINGS_KEY from settings_library.base import BaseCustomSettings diff --git a/services/web/server/src/simcore_service_webserver/director_v2/_api_utils.py b/services/web/server/src/simcore_service_webserver/director_v2/_api_utils.py index e9bbca91c50..05215a92d82 100644 --- a/services/web/server/src/simcore_service_webserver/director_v2/_api_utils.py +++ b/services/web/server/src/simcore_service_webserver/director_v2/_api_utils.py @@ -2,7 +2,7 @@ from models_library.projects import ProjectID from models_library.users import UserID from models_library.wallets import WalletID, WalletInfo -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..application_settings import get_application_settings from ..products.api import Product diff --git a/services/web/server/src/simcore_service_webserver/director_v2/_core_computations.py b/services/web/server/src/simcore_service_webserver/director_v2/_core_computations.py index 950d92fa2eb..ebfe6cb28b5 100644 --- a/services/web/server/src/simcore_service_webserver/director_v2/_core_computations.py +++ b/services/web/server/src/simcore_service_webserver/director_v2/_core_computations.py @@ -26,8 +26,8 @@ from models_library.projects_pipeline import ComputationTask from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import parse_obj_as -from pydantic.types import PositiveInt +from pydantic.v1 import parse_obj_as +from pydantic.v1.types import PositiveInt from servicelib.aiohttp import status from servicelib.logging_utils import log_decorator from settings_library.utils_encoders import create_json_encoder_wo_secrets diff --git a/services/web/server/src/simcore_service_webserver/director_v2/_core_dynamic_services.py b/services/web/server/src/simcore_service_webserver/director_v2/_core_dynamic_services.py index 20cf772075e..d75d0e38a1b 100644 --- a/services/web/server/src/simcore_service_webserver/director_v2/_core_dynamic_services.py +++ b/services/web/server/src/simcore_service_webserver/director_v2/_core_dynamic_services.py @@ -10,8 +10,8 @@ from models_library.api_schemas_directorv2.dynamic_services import DynamicServiceGet from models_library.projects import ProjectID from models_library.services import ServicePortKey -from pydantic import BaseModel, NonNegativeInt, parse_obj_as -from pydantic.types import PositiveInt +from pydantic.v1 import BaseModel, NonNegativeInt, parse_obj_as +from pydantic.v1.types import PositiveInt from servicelib.logging_utils import log_decorator from yarl import URL diff --git a/services/web/server/src/simcore_service_webserver/director_v2/_handlers.py b/services/web/server/src/simcore_service_webserver/director_v2/_handlers.py index fb80f3aa3fa..5fb9ad5b1b0 100644 --- a/services/web/server/src/simcore_service_webserver/director_v2/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/director_v2/_handlers.py @@ -8,8 +8,8 @@ from models_library.projects import ProjectID from models_library.users import UserID from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Field, ValidationError, parse_obj_as -from pydantic.types import NonNegativeInt +from pydantic.v1 import BaseModel, Field, ValidationError, parse_obj_as +from pydantic.v1.types import NonNegativeInt from servicelib.aiohttp.rest_responses import ( create_http_error, exception_to_response, diff --git a/services/web/server/src/simcore_service_webserver/director_v2/_models.py b/services/web/server/src/simcore_service_webserver/director_v2/_models.py index 70dd53ff5fd..280dad61d9d 100644 --- a/services/web/server/src/simcore_service_webserver/director_v2/_models.py +++ b/services/web/server/src/simcore_service_webserver/director_v2/_models.py @@ -10,8 +10,8 @@ ExternalClusterAuthentication, ) from models_library.users import GroupID -from pydantic import AnyHttpUrl, BaseModel, Field, validator -from pydantic.networks import AnyUrl, HttpUrl +from pydantic.v1 import AnyHttpUrl, BaseModel, Field, validator +from pydantic.v1.networks import AnyUrl, HttpUrl from simcore_postgres_database.models.clusters import ClusterType diff --git a/services/web/server/src/simcore_service_webserver/director_v2/settings.py b/services/web/server/src/simcore_service_webserver/director_v2/settings.py index d182ad6df28..4f140c74c99 100644 --- a/services/web/server/src/simcore_service_webserver/director_v2/settings.py +++ b/services/web/server/src/simcore_service_webserver/director_v2/settings.py @@ -6,7 +6,7 @@ from aiohttp import ClientSession, ClientTimeout, web from models_library.basic_types import VersionTag -from pydantic import Field, PositiveInt +from pydantic.v1 import Field, PositiveInt from servicelib.aiohttp.application_keys import APP_CLIENT_SESSION_KEY from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt diff --git a/services/web/server/src/simcore_service_webserver/dynamic_scheduler/api.py b/services/web/server/src/simcore_service_webserver/dynamic_scheduler/api.py index 3c5509e449e..039bc072259 100644 --- a/services/web/server/src/simcore_service_webserver/dynamic_scheduler/api.py +++ b/services/web/server/src/simcore_service_webserver/dynamic_scheduler/api.py @@ -18,7 +18,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.rabbitmq_messages import ProgressRabbitMessageProject, ProgressType -from pydantic.types import PositiveInt +from pydantic.v1.types import PositiveInt from servicelib.progress_bar import ProgressBarData from servicelib.rabbitmq import RabbitMQClient, RPCServerError from servicelib.rabbitmq.rpc_interfaces.dynamic_scheduler import services diff --git a/services/web/server/src/simcore_service_webserver/dynamic_scheduler/settings.py b/services/web/server/src/simcore_service_webserver/dynamic_scheduler/settings.py index b92a0e2d432..c774a906d5d 100644 --- a/services/web/server/src/simcore_service_webserver/dynamic_scheduler/settings.py +++ b/services/web/server/src/simcore_service_webserver/dynamic_scheduler/settings.py @@ -1,7 +1,7 @@ from typing import Final from aiohttp import web -from pydantic import Field, NonNegativeInt +from pydantic.v1 import Field, NonNegativeInt from settings_library.base import BaseCustomSettings from settings_library.utils_service import MixinServiceSettings diff --git a/services/web/server/src/simcore_service_webserver/email/_handlers.py b/services/web/server/src/simcore_service_webserver/email/_handlers.py index 829f58e4a0b..d995ea71264 100644 --- a/services/web/server/src/simcore_service_webserver/email/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/email/_handlers.py @@ -3,7 +3,7 @@ from aiohttp import web from models_library.emails import LowerCaseEmailStr -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from servicelib.aiohttp.requests_validation import parse_request_body_as from .._meta import API_VTAG diff --git a/services/web/server/src/simcore_service_webserver/exporter/_formatter/_sds.py b/services/web/server/src/simcore_service_webserver/exporter/_formatter/_sds.py index 994d06690de..c1c135216ce 100644 --- a/services/web/server/src/simcore_service_webserver/exporter/_formatter/_sds.py +++ b/services/web/server/src/simcore_service_webserver/exporter/_formatter/_sds.py @@ -5,7 +5,7 @@ from typing import Any, Final from aiohttp import web -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.pools import non_blocking_process_pool_executor from ...catalog.client import get_service diff --git a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/code_description.py b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/code_description.py index 9c9a2ff484b..a98cb33c03d 100644 --- a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/code_description.py +++ b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/code_description.py @@ -2,7 +2,7 @@ from typing import Any, ClassVar, Final, cast from models_library.services import ServiceKey, ServiceVersion -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from .core.styling_components import TB, Backgrounds, Borders, Comment, Link, T from .core.xlsx_base import BaseXLSXCellData, BaseXLSXDocument, BaseXLSXSheet diff --git a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/core/xlsx_base.py b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/core/xlsx_base.py index c2108c7392e..de0c9953c99 100644 --- a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/core/xlsx_base.py +++ b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/core/xlsx_base.py @@ -7,7 +7,7 @@ from openpyxl.cell import Cell from openpyxl.styles import Alignment, Border from openpyxl.worksheet.worksheet import Worksheet -from pydantic import BaseModel +from pydantic.v1 import BaseModel BORDER_ATTRIBUTES: set[str] = { "left", diff --git a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/dataset_description.py b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/dataset_description.py index 3dc3c60ecfa..ad1124a2033 100644 --- a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/dataset_description.py +++ b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/dataset_description.py @@ -1,7 +1,7 @@ from typing import ClassVar, Final from openpyxl.utils import get_column_letter -from pydantic import BaseModel, Field, StrictStr +from pydantic.v1 import BaseModel, Field, StrictStr from .core.styling_components import TB, Backgrounds, Borders, Comment, Link, T from .core.xlsx_base import BaseXLSXCellData, BaseXLSXDocument, BaseXLSXSheet diff --git a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/utils.py b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/utils.py index 4b03144ab86..3d5207c30d2 100644 --- a/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/utils.py +++ b/services/web/server/src/simcore_service_webserver/exporter/_formatter/xlsx/utils.py @@ -2,7 +2,7 @@ from typing import TypeVar from openpyxl.utils import get_column_letter -from pydantic import BaseModel +from pydantic.v1 import BaseModel T = TypeVar("T") diff --git a/services/web/server/src/simcore_service_webserver/exporter/settings.py b/services/web/server/src/simcore_service_webserver/exporter/settings.py index b0c2b63b5fd..f2be3abe0ea 100644 --- a/services/web/server/src/simcore_service_webserver/exporter/settings.py +++ b/services/web/server/src/simcore_service_webserver/exporter/settings.py @@ -1,5 +1,5 @@ from aiohttp.web import Application -from pydantic import Field +from pydantic.v1 import Field from servicelib.aiohttp.application_keys import APP_SETTINGS_KEY from settings_library.base import BaseCustomSettings diff --git a/services/web/server/src/simcore_service_webserver/folders/_folders_api.py b/services/web/server/src/simcore_service_webserver/folders/_folders_api.py index ca9d0ce9899..04cb8eb448e 100644 --- a/services/web/server/src/simcore_service_webserver/folders/_folders_api.py +++ b/services/web/server/src/simcore_service_webserver/folders/_folders_api.py @@ -11,7 +11,7 @@ from models_library.projects_access import AccessRights from models_library.rest_ordering import OrderBy from models_library.users import GroupID, UserID -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from simcore_postgres_database import utils_folders as folders_db from .._constants import APP_DB_ENGINE_KEY diff --git a/services/web/server/src/simcore_service_webserver/folders/_folders_handlers.py b/services/web/server/src/simcore_service_webserver/folders/_folders_handlers.py index 313b83d8c08..0b3f3f153be 100644 --- a/services/web/server/src/simcore_service_webserver/folders/_folders_handlers.py +++ b/services/web/server/src/simcore_service_webserver/folders/_folders_handlers.py @@ -15,7 +15,7 @@ from models_library.rest_pagination_utils import paginate_data from models_library.users import UserID from models_library.utils.common_validators import null_or_none_str_to_none_validator -from pydantic import Extra, Field, Json, parse_obj_as, validator +from pydantic.v1 import Extra, Field, Json, parse_obj_as, validator from servicelib.aiohttp.requests_validation import ( RequestParams, StrictRequestParams, diff --git a/services/web/server/src/simcore_service_webserver/folders/_groups_api.py b/services/web/server/src/simcore_service_webserver/folders/_groups_api.py index 73f100ddc58..ae0e86429c9 100644 --- a/services/web/server/src/simcore_service_webserver/folders/_groups_api.py +++ b/services/web/server/src/simcore_service_webserver/folders/_groups_api.py @@ -7,7 +7,7 @@ from models_library.folders import FolderID from models_library.products import ProductName from models_library.users import GroupID, UserID -from pydantic import BaseModel +from pydantic.v1 import BaseModel log = logging.getLogger(__name__) diff --git a/services/web/server/src/simcore_service_webserver/folders/_groups_handlers.py b/services/web/server/src/simcore_service_webserver/folders/_groups_handlers.py index 0c2696f0722..ffa8dbca1ce 100644 --- a/services/web/server/src/simcore_service_webserver/folders/_groups_handlers.py +++ b/services/web/server/src/simcore_service_webserver/folders/_groups_handlers.py @@ -8,7 +8,7 @@ from aiohttp import web from models_library.folders import FolderID from models_library.users import GroupID, UserID -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/garbage_collector/settings.py b/services/web/server/src/simcore_service_webserver/garbage_collector/settings.py index 46863d45864..6ebe7e83c1d 100644 --- a/services/web/server/src/simcore_service_webserver/garbage_collector/settings.py +++ b/services/web/server/src/simcore_service_webserver/garbage_collector/settings.py @@ -1,5 +1,5 @@ from aiohttp import web -from pydantic import Field, PositiveInt +from pydantic.v1 import Field, PositiveInt from servicelib.aiohttp.application_keys import APP_SETTINGS_KEY from settings_library.base import BaseCustomSettings diff --git a/services/web/server/src/simcore_service_webserver/groups/_classifiers.py b/services/web/server/src/simcore_service_webserver/groups/_classifiers.py index 5ac89e0ee94..40e06e94b88 100644 --- a/services/web/server/src/simcore_service_webserver/groups/_classifiers.py +++ b/services/web/server/src/simcore_service_webserver/groups/_classifiers.py @@ -15,7 +15,7 @@ import sqlalchemy as sa from aiohttp import web from aiopg.sa.result import RowProxy -from pydantic import ( +from pydantic.v1 import ( BaseModel, ConstrainedStr, Field, diff --git a/services/web/server/src/simcore_service_webserver/groups/_db.py b/services/web/server/src/simcore_service_webserver/groups/_db.py index 38bbb4e7d7c..e81d9cb0b6d 100644 --- a/services/web/server/src/simcore_service_webserver/groups/_db.py +++ b/services/web/server/src/simcore_service_webserver/groups/_db.py @@ -6,7 +6,7 @@ from aiopg.sa.result import ResultProxy, RowProxy from models_library.groups import GroupAtDB from models_library.users import GroupID, UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.utils_products import get_or_create_product_group from sqlalchemy import and_, literal_column from sqlalchemy.dialects.postgresql import insert diff --git a/services/web/server/src/simcore_service_webserver/groups/_handlers.py b/services/web/server/src/simcore_service_webserver/groups/_handlers.py index 2f0b0411601..aa80d4f9d01 100644 --- a/services/web/server/src/simcore_service_webserver/groups/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/groups/_handlers.py @@ -12,7 +12,7 @@ from models_library.emails import LowerCaseEmailStr from models_library.users import GroupID, UserID from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Extra, Field, parse_obj_as +from pydantic.v1 import BaseModel, Extra, Field, parse_obj_as from servicelib.aiohttp.requests_validation import ( parse_request_path_parameters_as, parse_request_query_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/invitations/_client.py b/services/web/server/src/simcore_service_webserver/invitations/_client.py index cc427cf28ce..7b290435ffa 100644 --- a/services/web/server/src/simcore_service_webserver/invitations/_client.py +++ b/services/web/server/src/simcore_service_webserver/invitations/_client.py @@ -10,7 +10,7 @@ ApiInvitationInputs, ) from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyHttpUrl, parse_obj_as +from pydantic.v1 import AnyHttpUrl, parse_obj_as from yarl import URL from .._constants import APP_SETTINGS_KEY diff --git a/services/web/server/src/simcore_service_webserver/invitations/_core.py b/services/web/server/src/simcore_service_webserver/invitations/_core.py index b834ac55b26..319801fc12a 100644 --- a/services/web/server/src/simcore_service_webserver/invitations/_core.py +++ b/services/web/server/src/simcore_service_webserver/invitations/_core.py @@ -9,7 +9,7 @@ ApiInvitationInputs, ) from models_library.emails import LowerCaseEmailStr -from pydantic import AnyHttpUrl, ValidationError, parse_obj_as +from pydantic.v1 import AnyHttpUrl, ValidationError, parse_obj_as from servicelib.aiohttp import status from servicelib.error_codes import create_error_code diff --git a/services/web/server/src/simcore_service_webserver/invitations/settings.py b/services/web/server/src/simcore_service_webserver/invitations/settings.py index 025f89955ff..05cfdea1431 100644 --- a/services/web/server/src/simcore_service_webserver/invitations/settings.py +++ b/services/web/server/src/simcore_service_webserver/invitations/settings.py @@ -8,7 +8,7 @@ from typing import Final from aiohttp import web -from pydantic import Field, SecretStr, parse_obj_as +from pydantic.v1 import Field, SecretStr, parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.utils_service import ( diff --git a/services/web/server/src/simcore_service_webserver/login/_2fa_api.py b/services/web/server/src/simcore_service_webserver/login/_2fa_api.py index 06a96f00e6d..41a32b33d05 100644 --- a/services/web/server/src/simcore_service_webserver/login/_2fa_api.py +++ b/services/web/server/src/simcore_service_webserver/login/_2fa_api.py @@ -12,7 +12,7 @@ from aiohttp import web from models_library.users import UserID -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from servicelib.error_codes import create_error_code from servicelib.logging_utils import LogExtra, get_log_record_extra, log_decorator from servicelib.utils_secrets import generate_passcode diff --git a/services/web/server/src/simcore_service_webserver/login/_2fa_handlers.py b/services/web/server/src/simcore_service_webserver/login/_2fa_handlers.py index 7d35b2e7cca..f2140b77e96 100644 --- a/services/web/server/src/simcore_service_webserver/login/_2fa_handlers.py +++ b/services/web/server/src/simcore_service_webserver/login/_2fa_handlers.py @@ -4,7 +4,7 @@ from aiohttp import web from aiohttp.web import RouteTableDef from models_library.emails import LowerCaseEmailStr -from pydantic import Field +from pydantic.v1 import Field from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import parse_request_body_as from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON diff --git a/services/web/server/src/simcore_service_webserver/login/_auth_handlers.py b/services/web/server/src/simcore_service_webserver/login/_auth_handlers.py index a5a69504e99..15e54fe1068 100644 --- a/services/web/server/src/simcore_service_webserver/login/_auth_handlers.py +++ b/services/web/server/src/simcore_service_webserver/login/_auth_handlers.py @@ -4,7 +4,7 @@ from aiohttp.web import RouteTableDef from models_library.authentification import TwoFactorAuthentificationMethod from models_library.emails import LowerCaseEmailStr -from pydantic import BaseModel, Field, PositiveInt, SecretStr, parse_obj_as +from pydantic.v1 import BaseModel, Field, PositiveInt, SecretStr, parse_obj_as from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import parse_request_body_as from servicelib.logging_utils import get_log_record_extra, log_context diff --git a/services/web/server/src/simcore_service_webserver/login/_models.py b/services/web/server/src/simcore_service_webserver/login/_models.py index 2ac7b94f11a..5aafe7ea9de 100644 --- a/services/web/server/src/simcore_service_webserver/login/_models.py +++ b/services/web/server/src/simcore_service_webserver/login/_models.py @@ -1,6 +1,6 @@ from typing import Any, Callable -from pydantic import BaseModel, Extra, SecretStr +from pydantic.v1 import BaseModel, Extra, SecretStr from ._constants import MSG_PASSWORD_MISMATCH diff --git a/services/web/server/src/simcore_service_webserver/login/_registration.py b/services/web/server/src/simcore_service_webserver/login/_registration.py index 322dbb026c4..a81fd499084 100644 --- a/services/web/server/src/simcore_service_webserver/login/_registration.py +++ b/services/web/server/src/simcore_service_webserver/login/_registration.py @@ -13,7 +13,7 @@ from models_library.basic_types import IdInt from models_library.emails import LowerCaseEmailStr from models_library.products import ProductName -from pydantic import ( +from pydantic.v1 import ( BaseModel, Field, Json, diff --git a/services/web/server/src/simcore_service_webserver/login/_registration_api.py b/services/web/server/src/simcore_service_webserver/login/_registration_api.py index 1dfd1a5a500..927a4dde7ef 100644 --- a/services/web/server/src/simcore_service_webserver/login/_registration_api.py +++ b/services/web/server/src/simcore_service_webserver/login/_registration_api.py @@ -9,7 +9,7 @@ from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps from PIL.Image import Image -from pydantic import EmailStr, PositiveInt, ValidationError, parse_obj_as +from pydantic.v1 import EmailStr, PositiveInt, ValidationError, parse_obj_as from servicelib.utils_secrets import generate_passcode from ..email.utils import send_email_from_template diff --git a/services/web/server/src/simcore_service_webserver/login/_registration_handlers.py b/services/web/server/src/simcore_service_webserver/login/_registration_handlers.py index 2ad608e3c12..1d516d79cff 100644 --- a/services/web/server/src/simcore_service_webserver/login/_registration_handlers.py +++ b/services/web/server/src/simcore_service_webserver/login/_registration_handlers.py @@ -7,7 +7,7 @@ UnregisterCheck, ) from models_library.users import UserID -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from servicelib.aiohttp.application_keys import APP_FIRE_AND_FORGET_TASKS_KEY from servicelib.aiohttp.requests_validation import parse_request_body_as from servicelib.logging_utils import get_log_record_extra, log_context diff --git a/services/web/server/src/simcore_service_webserver/login/handlers_change.py b/services/web/server/src/simcore_service_webserver/login/handlers_change.py index f8b71ce8763..b1800d41914 100644 --- a/services/web/server/src/simcore_service_webserver/login/handlers_change.py +++ b/services/web/server/src/simcore_service_webserver/login/handlers_change.py @@ -3,7 +3,7 @@ from aiohttp import web from aiohttp.web import RouteTableDef from models_library.emails import LowerCaseEmailStr -from pydantic import SecretStr, validator +from pydantic.v1 import SecretStr, validator from servicelib.aiohttp.requests_validation import parse_request_body_as from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON from servicelib.request_keys import RQT_USERID_KEY diff --git a/services/web/server/src/simcore_service_webserver/login/handlers_confirmation.py b/services/web/server/src/simcore_service_webserver/login/handlers_confirmation.py index ecb99ce84e7..a9fd851d295 100644 --- a/services/web/server/src/simcore_service_webserver/login/handlers_confirmation.py +++ b/services/web/server/src/simcore_service_webserver/login/handlers_confirmation.py @@ -6,7 +6,7 @@ from aiohttp.web import RouteTableDef from models_library.emails import LowerCaseEmailStr from models_library.products import ProductName -from pydantic import ( +from pydantic.v1 import ( BaseModel, Field, PositiveInt, diff --git a/services/web/server/src/simcore_service_webserver/login/handlers_registration.py b/services/web/server/src/simcore_service_webserver/login/handlers_registration.py index d3f553db71c..be1352fac0d 100644 --- a/services/web/server/src/simcore_service_webserver/login/handlers_registration.py +++ b/services/web/server/src/simcore_service_webserver/login/handlers_registration.py @@ -5,7 +5,7 @@ from aiohttp import web from aiohttp.web import RouteTableDef from models_library.emails import LowerCaseEmailStr -from pydantic import BaseModel, Field, PositiveInt, SecretStr, validator +from pydantic.v1 import BaseModel, Field, PositiveInt, SecretStr, validator from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import parse_request_body_as from servicelib.error_codes import create_error_code diff --git a/services/web/server/src/simcore_service_webserver/login/plugin.py b/services/web/server/src/simcore_service_webserver/login/plugin.py index 174bcd55f4a..365651a3a07 100644 --- a/services/web/server/src/simcore_service_webserver/login/plugin.py +++ b/services/web/server/src/simcore_service_webserver/login/plugin.py @@ -3,7 +3,7 @@ import asyncpg from aiohttp import web -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.aiohttp.application_setup import ModuleCategory, app_module_setup from settings_library.email import SMTPSettings from settings_library.postgres import PostgresSettings diff --git a/services/web/server/src/simcore_service_webserver/login/settings.py b/services/web/server/src/simcore_service_webserver/login/settings.py index c32ce319c7f..b6b49ff7f25 100644 --- a/services/web/server/src/simcore_service_webserver/login/settings.py +++ b/services/web/server/src/simcore_service_webserver/login/settings.py @@ -2,9 +2,9 @@ from typing import Final, Literal from aiohttp import web -from pydantic import BaseModel, validator -from pydantic.fields import Field -from pydantic.types import PositiveFloat, PositiveInt, SecretStr +from pydantic.v1 import BaseModel, validator +from pydantic.v1.fields import Field +from pydantic.v1.types import PositiveFloat, PositiveInt, SecretStr from settings_library.base import BaseCustomSettings from settings_library.email import EmailProtocol from settings_library.twilio import TwilioSettings diff --git a/services/web/server/src/simcore_service_webserver/login/utils.py b/services/web/server/src/simcore_service_webserver/login/utils.py index 0e5c4ef47f2..79062f974f3 100644 --- a/services/web/server/src/simcore_service_webserver/login/utils.py +++ b/services/web/server/src/simcore_service_webserver/login/utils.py @@ -5,7 +5,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.utils.json_serialization import json_dumps -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.aiohttp import observer from servicelib.aiohttp.rest_models import LogMessageType from servicelib.aiohttp.status import HTTP_200_OK diff --git a/services/web/server/src/simcore_service_webserver/long_running_tasks.py b/services/web/server/src/simcore_service_webserver/long_running_tasks.py index a7e4e8c725b..a88cfd30b5a 100644 --- a/services/web/server/src/simcore_service_webserver/long_running_tasks.py +++ b/services/web/server/src/simcore_service_webserver/long_running_tasks.py @@ -3,7 +3,7 @@ from aiohttp import web from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import Field +from pydantic.v1 import Field from servicelib.aiohttp.long_running_tasks._constants import ( RQT_LONG_RUNNING_TASKS_CONTEXT_KEY, ) diff --git a/services/web/server/src/simcore_service_webserver/meta_modeling/_handlers.py b/services/web/server/src/simcore_service_webserver/meta_modeling/_handlers.py index 35244dc5363..1f42c5e21ce 100644 --- a/services/web/server/src/simcore_service_webserver/meta_modeling/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/meta_modeling/_handlers.py @@ -9,9 +9,9 @@ from models_library.projects import ProjectID from models_library.rest_pagination import Page, PageQueryParameters from models_library.rest_pagination_utils import paginate_data -from pydantic import BaseModel, ValidationError, validator -from pydantic.fields import Field -from pydantic.networks import HttpUrl +from pydantic.v1 import BaseModel, ValidationError, validator +from pydantic.v1.fields import Field +from pydantic.v1.networks import HttpUrl from servicelib.rest_constants import RESPONSE_MODEL_POLICY from .._meta import API_VTAG as VTAG diff --git a/services/web/server/src/simcore_service_webserver/meta_modeling/_iterations.py b/services/web/server/src/simcore_service_webserver/meta_modeling/_iterations.py index 05bb9ac778b..b080396d9ad 100644 --- a/services/web/server/src/simcore_service_webserver/meta_modeling/_iterations.py +++ b/services/web/server/src/simcore_service_webserver/meta_modeling/_iterations.py @@ -17,9 +17,9 @@ from models_library.projects_nodes_io import NodeID from models_library.services import ServiceMetaDataPublished from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, ValidationError -from pydantic.fields import Field -from pydantic.types import PositiveInt +from pydantic.v1 import BaseModel, ValidationError +from pydantic.v1.fields import Field +from pydantic.v1.types import PositiveInt from ..projects.models import ProjectDict from ..utils import compute_sha1_on_small_dataset, now_str diff --git a/services/web/server/src/simcore_service_webserver/meta_modeling/_results.py b/services/web/server/src/simcore_service_webserver/meta_modeling/_results.py index 68829e3489a..740cd48845f 100644 --- a/services/web/server/src/simcore_service_webserver/meta_modeling/_results.py +++ b/services/web/server/src/simcore_service_webserver/meta_modeling/_results.py @@ -11,7 +11,7 @@ from models_library.projects_nodes import OutputsDict from models_library.projects_nodes_io import NodeIDStr -from pydantic import BaseModel, ConstrainedInt, Field +from pydantic.v1 import BaseModel, ConstrainedInt, Field _logger = logging.getLogger(__name__) diff --git a/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_exclusive_queue_consumers.py b/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_exclusive_queue_consumers.py index d9a6b1f0861..945e828f4a9 100644 --- a/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_exclusive_queue_consumers.py +++ b/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_exclusive_queue_consumers.py @@ -13,7 +13,7 @@ ) from models_library.socketio import SocketMessageDict from models_library.users import GroupID -from pydantic import parse_raw_as +from pydantic.v1 import parse_raw_as from servicelib.logging_utils import log_catch, log_context from servicelib.rabbitmq import RabbitMQClient from servicelib.utils import logged_gather diff --git a/services/web/server/src/simcore_service_webserver/payments/_autorecharge_db.py b/services/web/server/src/simcore_service_webserver/payments/_autorecharge_db.py index 8aec3e45359..7aaca7f4f08 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_autorecharge_db.py +++ b/services/web/server/src/simcore_service_webserver/payments/_autorecharge_db.py @@ -6,7 +6,7 @@ from models_library.basic_types import NonNegativeDecimal from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from simcore_postgres_database.utils_payments_autorecharge import AutoRechargeStmts from ..db.plugin import get_database_engine diff --git a/services/web/server/src/simcore_service_webserver/payments/_methods_api.py b/services/web/server/src/simcore_service_webserver/payments/_methods_api.py index a1eac2b440d..6c63a570713 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_methods_api.py +++ b/services/web/server/src/simcore_service_webserver/payments/_methods_api.py @@ -15,7 +15,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from servicelib.logging_utils import log_decorator from simcore_postgres_database.models.payments_methods import InitPromptAckFlowState from yarl import URL diff --git a/services/web/server/src/simcore_service_webserver/payments/_methods_db.py b/services/web/server/src/simcore_service_webserver/payments/_methods_db.py index b5838eb171c..4077a81eccc 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_methods_db.py +++ b/services/web/server/src/simcore_service_webserver/payments/_methods_db.py @@ -8,7 +8,7 @@ from models_library.api_schemas_webserver.wallets import PaymentMethodID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from simcore_postgres_database.models.payments_methods import ( InitPromptAckFlowState, payments_methods, diff --git a/services/web/server/src/simcore_service_webserver/payments/_onetime_api.py b/services/web/server/src/simcore_service_webserver/payments/_onetime_api.py index f1c9f9df733..917caf9ad46 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_onetime_api.py +++ b/services/web/server/src/simcore_service_webserver/payments/_onetime_api.py @@ -15,7 +15,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from servicelib.logging_utils import log_decorator from simcore_postgres_database.models.payments_transactions import ( PaymentTransactionState, diff --git a/services/web/server/src/simcore_service_webserver/payments/_onetime_db.py b/services/web/server/src/simcore_service_webserver/payments/_onetime_db.py index 9f94d46b707..394a7bcc39d 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_onetime_db.py +++ b/services/web/server/src/simcore_service_webserver/payments/_onetime_db.py @@ -9,7 +9,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import BaseModel, HttpUrl, PositiveInt, parse_obj_as +from pydantic.v1 import BaseModel, HttpUrl, PositiveInt, parse_obj_as from simcore_postgres_database.models.payments_transactions import ( PaymentTransactionState, payments_transactions, diff --git a/services/web/server/src/simcore_service_webserver/payments/_rpc.py b/services/web/server/src/simcore_service_webserver/payments/_rpc.py index a2f0166fef8..d81f3cb35b2 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_rpc.py +++ b/services/web/server/src/simcore_service_webserver/payments/_rpc.py @@ -21,7 +21,7 @@ from models_library.rabbitmq_basic_types import RPCMethodName from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, HttpUrl, parse_obj_as +from pydantic.v1 import EmailStr, HttpUrl, parse_obj_as from servicelib.logging_utils import log_decorator from ..rabbitmq import get_rabbitmq_rpc_client diff --git a/services/web/server/src/simcore_service_webserver/payments/_tasks.py b/services/web/server/src/simcore_service_webserver/payments/_tasks.py index d6c8a5719fb..43a325fbd3c 100644 --- a/services/web/server/src/simcore_service_webserver/payments/_tasks.py +++ b/services/web/server/src/simcore_service_webserver/payments/_tasks.py @@ -6,7 +6,7 @@ from aiohttp import web from models_library.api_schemas_webserver.wallets import PaymentID, PaymentMethodID -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from servicelib.aiohttp.typing_extension import CleanupContextFunc from servicelib.logging_utils import log_decorator from simcore_postgres_database.models.payments_methods import InitPromptAckFlowState diff --git a/services/web/server/src/simcore_service_webserver/payments/settings.py b/services/web/server/src/simcore_service_webserver/payments/settings.py index 846e2b1e9f9..fd6f8661e88 100644 --- a/services/web/server/src/simcore_service_webserver/payments/settings.py +++ b/services/web/server/src/simcore_service_webserver/payments/settings.py @@ -3,7 +3,7 @@ from aiohttp import web from models_library.basic_types import NonNegativeDecimal -from pydantic import Field, HttpUrl, PositiveInt, SecretStr, parse_obj_as, validator +from pydantic.v1 import Field, HttpUrl, PositiveInt, SecretStr, parse_obj_as, validator from settings_library.base import BaseCustomSettings from settings_library.basic_types import PortInt, VersionTag from settings_library.utils_service import ( diff --git a/services/web/server/src/simcore_service_webserver/products/_events.py b/services/web/server/src/simcore_service_webserver/products/_events.py index 64726ce55c3..81b4edb65f0 100644 --- a/services/web/server/src/simcore_service_webserver/products/_events.py +++ b/services/web/server/src/simcore_service_webserver/products/_events.py @@ -7,7 +7,7 @@ from aiohttp import web from aiopg.sa.engine import Engine from aiopg.sa.result import RowProxy -from pydantic import ValidationError +from pydantic.v1 import ValidationError from servicelib.exceptions import InvalidConfig from simcore_postgres_database.utils_products import ( get_default_product_name, diff --git a/services/web/server/src/simcore_service_webserver/products/_handlers.py b/services/web/server/src/simcore_service_webserver/products/_handlers.py index bfdabef6d6f..0f690abfc48 100644 --- a/services/web/server/src/simcore_service_webserver/products/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/products/_handlers.py @@ -5,7 +5,7 @@ from models_library.api_schemas_webserver.product import GetCreditPrice, GetProduct from models_library.basic_types import IDStr from models_library.users import UserID -from pydantic import Extra, Field +from pydantic.v1 import Extra, Field from servicelib.aiohttp.requests_validation import ( RequestParams, StrictRequestParams, diff --git a/services/web/server/src/simcore_service_webserver/products/_invitations_handlers.py b/services/web/server/src/simcore_service_webserver/products/_invitations_handlers.py index 093e925db3d..0696240b03e 100644 --- a/services/web/server/src/simcore_service_webserver/products/_invitations_handlers.py +++ b/services/web/server/src/simcore_service_webserver/products/_invitations_handlers.py @@ -7,7 +7,7 @@ InvitationGenerated, ) from models_library.users import UserID -from pydantic import Field +from pydantic.v1 import Field from servicelib.aiohttp.requests_validation import RequestParams, parse_request_body_as from servicelib.request_keys import RQT_USERID_KEY from simcore_service_webserver.utils_aiohttp import envelope_json_response diff --git a/services/web/server/src/simcore_service_webserver/products/_model.py b/services/web/server/src/simcore_service_webserver/products/_model.py index de3955652a3..6581431f587 100644 --- a/services/web/server/src/simcore_service_webserver/products/_model.py +++ b/services/web/server/src/simcore_service_webserver/products/_model.py @@ -14,7 +14,7 @@ from models_library.emails import LowerCaseEmailStr from models_library.products import ProductName from models_library.utils.change_case import snake_to_camel -from pydantic import BaseModel, Extra, Field, PositiveInt, validator +from pydantic.v1 import BaseModel, Extra, Field, PositiveInt, validator from simcore_postgres_database.models.products import ( EmailFeedback, Forum, diff --git a/services/web/server/src/simcore_service_webserver/projects/_comments_api.py b/services/web/server/src/simcore_service_webserver/projects/_comments_api.py index a3626d099bb..d011a11e447 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_comments_api.py +++ b/services/web/server/src/simcore_service_webserver/projects/_comments_api.py @@ -8,7 +8,7 @@ ProjectsCommentsDB, ) from models_library.users import UserID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from .db import APP_PROJECT_DBAPI, ProjectDBAPI diff --git a/services/web/server/src/simcore_service_webserver/projects/_comments_db.py b/services/web/server/src/simcore_service_webserver/projects/_comments_db.py index 102e43971da..4e5136a158f 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_comments_db.py +++ b/services/web/server/src/simcore_service_webserver/projects/_comments_db.py @@ -9,8 +9,8 @@ from models_library.projects import ProjectID from models_library.projects_comments import CommentID, ProjectsCommentsDB from models_library.users import UserID -from pydantic import parse_obj_as -from pydantic.types import PositiveInt +from pydantic.v1 import parse_obj_as +from pydantic.v1.types import PositiveInt from simcore_postgres_database.models.projects_comments import projects_comments from sqlalchemy import func, literal_column from sqlalchemy.sql import select diff --git a/services/web/server/src/simcore_service_webserver/projects/_comments_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_comments_handlers.py index fff41cd016c..4714756cdb4 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_comments_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_comments_handlers.py @@ -15,7 +15,7 @@ Page, ) from models_library.rest_pagination_utils import paginate_data -from pydantic import BaseModel, Extra, Field, NonNegativeInt +from pydantic.v1 import BaseModel, Extra, Field, NonNegativeInt from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/projects/_common_models.py b/services/web/server/src/simcore_service_webserver/projects/_common_models.py index d25a0f6c24b..92826c79c8e 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_common_models.py +++ b/services/web/server/src/simcore_service_webserver/projects/_common_models.py @@ -6,7 +6,7 @@ from models_library.projects import ProjectID from models_library.users import UserID -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from servicelib.request_keys import RQT_USERID_KEY from .._constants import RQ_PRODUCT_KEY diff --git a/services/web/server/src/simcore_service_webserver/projects/_crud_api_create.py b/services/web/server/src/simcore_service_webserver/projects/_crud_api_create.py index 1d444d0d940..d899702bf61 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_crud_api_create.py +++ b/services/web/server/src/simcore_service_webserver/projects/_crud_api_create.py @@ -14,7 +14,7 @@ from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.aiohttp.long_running_tasks.server import TaskProgress from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON from simcore_postgres_database.utils_projects_nodes import ( diff --git a/services/web/server/src/simcore_service_webserver/projects/_crud_api_read.py b/services/web/server/src/simcore_service_webserver/projects/_crud_api_read.py index 44df76765aa..1e91276cdb2 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_crud_api_read.py +++ b/services/web/server/src/simcore_service_webserver/projects/_crud_api_read.py @@ -12,7 +12,7 @@ from models_library.projects import ProjectID from models_library.rest_ordering import OrderBy from models_library.users import UserID -from pydantic import NonNegativeInt +from pydantic.v1 import NonNegativeInt from servicelib.utils import logged_gather from simcore_postgres_database.webserver_models import ProjectType as ProjectTypeDB diff --git a/services/web/server/src/simcore_service_webserver/projects/_crud_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_crud_handlers.py index 79186150c90..bbc3fc8c331 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_crud_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_crud_handlers.py @@ -25,7 +25,7 @@ from models_library.rest_pagination_utils import paginate_data from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.aiohttp.long_running_tasks.server import start_long_running_task from servicelib.aiohttp.requests_validation import ( parse_request_body_as, diff --git a/services/web/server/src/simcore_service_webserver/projects/_crud_handlers_models.py b/services/web/server/src/simcore_service_webserver/projects/_crud_handlers_models.py index 0fc3489c8a6..0f086af10ce 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_crud_handlers_models.py +++ b/services/web/server/src/simcore_service_webserver/projects/_crud_handlers_models.py @@ -13,7 +13,7 @@ from models_library.rest_ordering import OrderBy, OrderDirection from models_library.rest_pagination import PageQueryParameters from models_library.utils.common_validators import null_or_none_str_to_none_validator -from pydantic import BaseModel, Extra, Field, Json, root_validator, validator +from pydantic.v1 import BaseModel, Extra, Field, Json, root_validator, validator from servicelib.common_headers import ( UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE, X_SIMCORE_PARENT_NODE_ID, diff --git a/services/web/server/src/simcore_service_webserver/projects/_db_utils.py b/services/web/server/src/simcore_service_webserver/projects/_db_utils.py index 7a8e2f9c064..a54265ef9d2 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_db_utils.py +++ b/services/web/server/src/simcore_service_webserver/projects/_db_utils.py @@ -14,7 +14,7 @@ from models_library.projects_nodes_io import NodeIDStr from models_library.users import UserID from models_library.utils.change_case import camel_to_snake, snake_to_camel -from pydantic import ValidationError +from pydantic.v1 import ValidationError from simcore_postgres_database.models.project_to_groups import project_to_groups from simcore_postgres_database.models.projects_to_products import projects_to_products from simcore_postgres_database.webserver_models import ProjectType, projects diff --git a/services/web/server/src/simcore_service_webserver/projects/_folders_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_folders_handlers.py index 303a857c6d5..780d134a8ab 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_folders_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_folders_handlers.py @@ -5,7 +5,7 @@ from models_library.folders import FolderID from models_library.projects import ProjectID from models_library.utils.common_validators import null_or_none_str_to_none_validator -from pydantic import BaseModel, Extra, validator +from pydantic.v1 import BaseModel, Extra, validator from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as from servicelib.aiohttp.typing_extension import Handler from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON diff --git a/services/web/server/src/simcore_service_webserver/projects/_groups_api.py b/services/web/server/src/simcore_service_webserver/projects/_groups_api.py index 5048c1b6a01..9035db7ce5c 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_groups_api.py +++ b/services/web/server/src/simcore_service_webserver/projects/_groups_api.py @@ -5,7 +5,7 @@ from models_library.products import ProductName from models_library.projects import ProjectID from models_library.users import GroupID, UserID -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from simcore_service_webserver.projects.models import UserProjectAccessRights from ..users import api as users_api diff --git a/services/web/server/src/simcore_service_webserver/projects/_groups_db.py b/services/web/server/src/simcore_service_webserver/projects/_groups_db.py index b0f3fccbcbc..3d272844456 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_groups_db.py +++ b/services/web/server/src/simcore_service_webserver/projects/_groups_db.py @@ -9,7 +9,7 @@ from aiohttp import web from models_library.projects import ProjectID from models_library.users import GroupID -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from simcore_postgres_database.models.project_to_groups import project_to_groups from sqlalchemy import func, literal_column from sqlalchemy.dialects.postgresql import insert as pg_insert diff --git a/services/web/server/src/simcore_service_webserver/projects/_groups_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_groups_handlers.py index 607dd499df2..e0222fe8e5c 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_groups_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_groups_handlers.py @@ -8,7 +8,7 @@ from aiohttp import web from models_library.projects import ProjectID from models_library.users import GroupID -from pydantic import BaseModel, Extra +from pydantic.v1 import BaseModel, Extra from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/projects/_metadata_api.py b/services/web/server/src/simcore_service_webserver/projects/_metadata_api.py index db27c3359bd..a174cefc719 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_metadata_api.py +++ b/services/web/server/src/simcore_service_webserver/projects/_metadata_api.py @@ -6,7 +6,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..db.plugin import get_database_engine from . import _metadata_db diff --git a/services/web/server/src/simcore_service_webserver/projects/_metadata_db.py b/services/web/server/src/simcore_service_webserver/projects/_metadata_db.py index 6a511a8ba4c..ba98bf3053f 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_metadata_db.py +++ b/services/web/server/src/simcore_service_webserver/projects/_metadata_db.py @@ -6,7 +6,7 @@ from models_library.api_schemas_webserver.projects_metadata import MetadataDict from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database import utils_projects_metadata from simcore_postgres_database.utils_projects_metadata import ( DBProjectInvalidAncestorsError, diff --git a/services/web/server/src/simcore_service_webserver/projects/_nodes_api.py b/services/web/server/src/simcore_service_webserver/projects/_nodes_api.py index ab6ba4b7d93..4a0569796fe 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_nodes_api.py +++ b/services/web/server/src/simcore_service_webserver/projects/_nodes_api.py @@ -13,7 +13,7 @@ from models_library.projects_nodes import Node from models_library.projects_nodes_io import NodeID, SimCoreFileLink from models_library.users import UserID -from pydantic import ( +from pydantic.v1 import ( BaseModel, Field, HttpUrl, diff --git a/services/web/server/src/simcore_service_webserver/projects/_nodes_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_nodes_handlers.py index b2ac322b031..7e3ad762844 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_nodes_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_nodes_handlers.py @@ -32,7 +32,7 @@ from models_library.users import GroupID from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Field, parse_obj_as +from pydantic.v1 import BaseModel, Field, parse_obj_as from servicelib.aiohttp.long_running_tasks.server import ( TaskProgress, start_long_running_task, diff --git a/services/web/server/src/simcore_service_webserver/projects/_ports_api.py b/services/web/server/src/simcore_service_webserver/projects/_ports_api.py index 95a42f32046..097a1f0a9a3 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_ports_api.py +++ b/services/web/server/src/simcore_service_webserver/projects/_ports_api.py @@ -24,7 +24,7 @@ jsonschema_validate_data, ) from models_library.utils.services_io import JsonSchemaDict, get_service_io_json_schema -from pydantic import ValidationError +from pydantic.v1 import ValidationError from ..director_v2.api import get_batch_tasks_outputs from .exceptions import InvalidInputValue diff --git a/services/web/server/src/simcore_service_webserver/projects/_ports_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_ports_handlers.py index e014014cd59..ec16e7f7ebd 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_ports_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_ports_handlers.py @@ -22,7 +22,7 @@ from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps from models_library.utils.services_io import JsonSchemaDict -from pydantic import BaseModel, Field, parse_obj_as +from pydantic.v1 import BaseModel, Field, parse_obj_as from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/projects/_projects_nodes_pricing_unit_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_projects_nodes_pricing_unit_handlers.py index 552869a0404..dbf8a113a50 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_projects_nodes_pricing_unit_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_projects_nodes_pricing_unit_handlers.py @@ -10,8 +10,8 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID, NodeIDStr from models_library.resource_tracker import PricingPlanId, PricingUnitId -from pydantic import BaseModel, Extra -from pydantic.errors import PydanticErrorMixin +from pydantic.v1 import BaseModel, Extra +from pydantic.v1.errors import PydanticErrorMixin from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as from servicelib.aiohttp.typing_extension import Handler diff --git a/services/web/server/src/simcore_service_webserver/projects/_states_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_states_handlers.py index a687aba4513..f0408f71faa 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_states_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_states_handlers.py @@ -9,7 +9,7 @@ from aiohttp import web from models_library.projects_state import ProjectState -from pydantic import BaseModel +from pydantic.v1 import BaseModel from servicelib.aiohttp.requests_validation import ( parse_request_path_parameters_as, parse_request_query_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/projects/_wallets_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_wallets_handlers.py index 04c6fd3f218..55bd2c75da9 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_wallets_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_wallets_handlers.py @@ -9,7 +9,7 @@ from models_library.api_schemas_webserver.wallets import WalletGet from models_library.projects import ProjectID from models_library.wallets import WalletID -from pydantic import BaseModel, Extra +from pydantic.v1 import BaseModel, Extra from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as from servicelib.aiohttp.typing_extension import Handler from simcore_service_webserver.utils_aiohttp import envelope_json_response diff --git a/services/web/server/src/simcore_service_webserver/projects/db.py b/services/web/server/src/simcore_service_webserver/projects/db.py index 4df9be4c3fe..5bef8fd2718 100644 --- a/services/web/server/src/simcore_service_webserver/projects/db.py +++ b/services/web/server/src/simcore_service_webserver/projects/db.py @@ -30,8 +30,8 @@ from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.wallets import WalletDB, WalletID -from pydantic import parse_obj_as -from pydantic.types import PositiveInt +from pydantic.v1 import parse_obj_as +from pydantic.v1.types import PositiveInt from servicelib.aiohttp.application_keys import APP_DB_ENGINE_KEY from servicelib.logging_utils import get_log_record_extra, log_context from simcore_postgres_database.errors import UniqueViolation diff --git a/services/web/server/src/simcore_service_webserver/projects/models.py b/services/web/server/src/simcore_service_webserver/projects/models.py index eb6bfad13c9..c4144013ed7 100644 --- a/services/web/server/src/simcore_service_webserver/projects/models.py +++ b/services/web/server/src/simcore_service_webserver/projects/models.py @@ -12,7 +12,7 @@ empty_str_to_none_pre_validator, none_to_empty_str_pre_validator, ) -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from simcore_postgres_database.models.projects import ProjectType, projects ProjectDict: TypeAlias = dict[str, Any] diff --git a/services/web/server/src/simcore_service_webserver/projects/projects_api.py b/services/web/server/src/simcore_service_webserver/projects/projects_api.py index 8d3c0783111..d444d21f304 100644 --- a/services/web/server/src/simcore_service_webserver/projects/projects_api.py +++ b/services/web/server/src/simcore_service_webserver/projects/projects_api.py @@ -62,7 +62,7 @@ from models_library.utils.fastapi_encoders import jsonable_encoder from models_library.utils.json_serialization import json_dumps from models_library.wallets import ZERO_CREDITS, WalletID, WalletInfo -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.aiohttp.application_keys import APP_FIRE_AND_FORGET_TASKS_KEY from servicelib.common_headers import ( UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE, diff --git a/services/web/server/src/simcore_service_webserver/projects/settings.py b/services/web/server/src/simcore_service_webserver/projects/settings.py index 727dcb51b35..e9acf5aee8a 100644 --- a/services/web/server/src/simcore_service_webserver/projects/settings.py +++ b/services/web/server/src/simcore_service_webserver/projects/settings.py @@ -1,7 +1,7 @@ from datetime import timedelta from aiohttp import web -from pydantic import ByteSize, Field, NonNegativeInt, parse_obj_as +from pydantic.v1 import ByteSize, Field, NonNegativeInt, parse_obj_as from settings_library.base import BaseCustomSettings from .._constants import APP_SETTINGS_KEY diff --git a/services/web/server/src/simcore_service_webserver/projects/utils.py b/services/web/server/src/simcore_service_webserver/projects/utils.py index d54bc2b433d..c576fcd0030 100644 --- a/services/web/server/src/simcore_service_webserver/projects/utils.py +++ b/services/web/server/src/simcore_service_webserver/projects/utils.py @@ -7,7 +7,7 @@ from models_library.projects_nodes_io import NodeIDStr from models_library.services import ServiceKey -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from servicelib.decorators import safe_return from yarl import URL diff --git a/services/web/server/src/simcore_service_webserver/resource_manager/settings.py b/services/web/server/src/simcore_service_webserver/resource_manager/settings.py index b3b954667ad..d2d9b2cfafa 100644 --- a/services/web/server/src/simcore_service_webserver/resource_manager/settings.py +++ b/services/web/server/src/simcore_service_webserver/resource_manager/settings.py @@ -1,5 +1,5 @@ from aiohttp import web -from pydantic import Field, PositiveInt +from pydantic.v1 import Field, PositiveInt from servicelib.aiohttp.application_keys import APP_SETTINGS_KEY from settings_library.base import BaseCustomSettings diff --git a/services/web/server/src/simcore_service_webserver/resource_usage/_client.py b/services/web/server/src/simcore_service_webserver/resource_usage/_client.py index 63763aa145b..e28058fc6a0 100644 --- a/services/web/server/src/simcore_service_webserver/resource_usage/_client.py +++ b/services/web/server/src/simcore_service_webserver/resource_usage/_client.py @@ -22,7 +22,7 @@ from models_library.resource_tracker import PricingPlanId, PricingUnitId from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from servicelib.aiohttp.client_session import get_client_session from settings_library.resource_usage_tracker import ResourceUsageTrackerSettings from yarl import URL diff --git a/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_admin_handlers.py b/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_admin_handlers.py index b71317b1aab..4b3affd5c49 100644 --- a/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_admin_handlers.py +++ b/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_admin_handlers.py @@ -20,7 +20,7 @@ PricingUnitWithCostUpdate, ) from models_library.users import UserID -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_handlers.py b/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_handlers.py index 86072f00e5e..68a5b2840f0 100644 --- a/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_handlers.py +++ b/services/web/server/src/simcore_service_webserver/resource_usage/_pricing_plans_handlers.py @@ -4,7 +4,7 @@ from models_library.api_schemas_webserver.resource_usage import PricingUnitGet from models_library.resource_tracker import PricingPlanId, PricingUnitId from models_library.users import UserID -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as from servicelib.aiohttp.typing_extension import Handler from servicelib.request_keys import RQT_USERID_KEY diff --git a/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_api.py b/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_api.py index 0b277177624..09323c950de 100644 --- a/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_api.py +++ b/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_api.py @@ -13,7 +13,7 @@ from models_library.rest_ordering import OrderBy from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import AnyUrl, NonNegativeInt +from pydantic.v1 import AnyUrl, NonNegativeInt from servicelib.rabbitmq.rpc_interfaces.resource_usage_tracker import service_runs from ..rabbitmq import get_rabbitmq_rpc_client diff --git a/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_handlers.py b/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_handlers.py index f265e45faf1..ef13e0640fb 100644 --- a/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_handlers.py +++ b/services/web/server/src/simcore_service_webserver/resource_usage/_service_runs_handlers.py @@ -22,7 +22,7 @@ from models_library.rest_pagination_utils import paginate_data from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import ( +from pydantic.v1 import ( BaseModel, Extra, Field, diff --git a/services/web/server/src/simcore_service_webserver/rest/_handlers.py b/services/web/server/src/simcore_service_webserver/rest/_handlers.py index 1cc4a52b7d1..1d04abd62f7 100644 --- a/services/web/server/src/simcore_service_webserver/rest/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/rest/_handlers.py @@ -8,7 +8,7 @@ from aiohttp import web from models_library.utils.pydantic_tools_extension import FieldNotRequired -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from servicelib.aiohttp import status from .._constants import APP_PUBLIC_CONFIG_PER_PRODUCT, APP_SETTINGS_KEY diff --git a/services/web/server/src/simcore_service_webserver/scicrunch/_resolver.py b/services/web/server/src/simcore_service_webserver/scicrunch/_resolver.py index efef7f77668..6e94f42e6da 100644 --- a/services/web/server/src/simcore_service_webserver/scicrunch/_resolver.py +++ b/services/web/server/src/simcore_service_webserver/scicrunch/_resolver.py @@ -9,9 +9,9 @@ from typing import Any from aiohttp import ClientSession -from pydantic import Field, ValidationError -from pydantic.main import BaseModel -from pydantic.types import NonNegativeInt +from pydantic.v1 import Field, ValidationError +from pydantic.v1.main import BaseModel +from pydantic.v1.types import NonNegativeInt from .settings import SciCrunchSettings diff --git a/services/web/server/src/simcore_service_webserver/scicrunch/_rest.py b/services/web/server/src/simcore_service_webserver/scicrunch/_rest.py index 70e4963fc68..12052b04774 100644 --- a/services/web/server/src/simcore_service_webserver/scicrunch/_rest.py +++ b/services/web/server/src/simcore_service_webserver/scicrunch/_rest.py @@ -18,7 +18,7 @@ from typing import Any from aiohttp import ClientSession -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from yarl import URL from .models import ResourceHit diff --git a/services/web/server/src/simcore_service_webserver/scicrunch/models.py b/services/web/server/src/simcore_service_webserver/scicrunch/models.py index 743f4bd8211..684dc3f806c 100644 --- a/services/web/server/src/simcore_service_webserver/scicrunch/models.py +++ b/services/web/server/src/simcore_service_webserver/scicrunch/models.py @@ -6,7 +6,7 @@ import re from datetime import datetime -from pydantic import BaseModel, Field, validator +from pydantic.v1 import BaseModel, Field, validator logger = logging.getLogger(__name__) diff --git a/services/web/server/src/simcore_service_webserver/scicrunch/service_client.py b/services/web/server/src/simcore_service_webserver/scicrunch/service_client.py index bcaf413b4db..9d3f27e6a12 100644 --- a/services/web/server/src/simcore_service_webserver/scicrunch/service_client.py +++ b/services/web/server/src/simcore_service_webserver/scicrunch/service_client.py @@ -8,7 +8,7 @@ import logging from aiohttp import ClientSession, client_exceptions, web -from pydantic import HttpUrl, ValidationError, parse_obj_as +from pydantic.v1 import HttpUrl, ValidationError, parse_obj_as from servicelib.aiohttp.client_session import get_client_session from yarl import URL diff --git a/services/web/server/src/simcore_service_webserver/scicrunch/settings.py b/services/web/server/src/simcore_service_webserver/scicrunch/settings.py index ecc027374c0..d720c598205 100644 --- a/services/web/server/src/simcore_service_webserver/scicrunch/settings.py +++ b/services/web/server/src/simcore_service_webserver/scicrunch/settings.py @@ -1,5 +1,5 @@ from aiohttp import web -from pydantic import Field, HttpUrl, SecretStr, parse_obj_as +from pydantic.v1 import Field, HttpUrl, SecretStr, parse_obj_as from settings_library.base import BaseCustomSettings from .._constants import APP_SETTINGS_KEY diff --git a/services/web/server/src/simcore_service_webserver/security/_authz_db.py b/services/web/server/src/simcore_service_webserver/security/_authz_db.py index dbb04f7943c..7576b38fbb8 100644 --- a/services/web/server/src/simcore_service_webserver/security/_authz_db.py +++ b/services/web/server/src/simcore_service_webserver/security/_authz_db.py @@ -7,7 +7,7 @@ from models_library.basic_types import IdInt from models_library.products import ProductName from models_library.users import UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.models.groups import user_to_groups from simcore_postgres_database.models.products import products from simcore_postgres_database.models.users import UserRole diff --git a/services/web/server/src/simcore_service_webserver/session/access_policies.py b/services/web/server/src/simcore_service_webserver/session/access_policies.py index 05736703563..904cc8b10e2 100644 --- a/services/web/server/src/simcore_service_webserver/session/access_policies.py +++ b/services/web/server/src/simcore_service_webserver/session/access_policies.py @@ -7,7 +7,7 @@ from aiohttp import web from aiohttp_session import Session -from pydantic import PositiveInt, validate_arguments +from pydantic.v1 import PositiveInt, validate_arguments from servicelib.aiohttp import status from servicelib.aiohttp.typing_extension import Handler diff --git a/services/web/server/src/simcore_service_webserver/session/settings.py b/services/web/server/src/simcore_service_webserver/session/settings.py index b5f3c333fa8..9fe5a84b2fc 100644 --- a/services/web/server/src/simcore_service_webserver/session/settings.py +++ b/services/web/server/src/simcore_service_webserver/session/settings.py @@ -1,10 +1,10 @@ from typing import Final from aiohttp import web -from pydantic import PositiveInt -from pydantic.class_validators import validator -from pydantic.fields import Field -from pydantic.types import SecretStr +from pydantic.v1 import PositiveInt +from pydantic.v1.class_validators import validator +from pydantic.v1.fields import Field +from pydantic.v1.types import SecretStr from settings_library.base import BaseCustomSettings from settings_library.utils_session import MixinSessionSettings diff --git a/services/web/server/src/simcore_service_webserver/socketio/models.py b/services/web/server/src/simcore_service_webserver/socketio/models.py index 06e5b9014cb..fd23a44db9e 100644 --- a/services/web/server/src/simcore_service_webserver/socketio/models.py +++ b/services/web/server/src/simcore_service_webserver/socketio/models.py @@ -12,7 +12,7 @@ from models_library.socketio import SocketMessageDict from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field class WebSocketMessageBase(BaseModel): diff --git a/services/web/server/src/simcore_service_webserver/statics/settings.py b/services/web/server/src/simcore_service_webserver/statics/settings.py index 275def8154b..032903d5d2f 100644 --- a/services/web/server/src/simcore_service_webserver/statics/settings.py +++ b/services/web/server/src/simcore_service_webserver/statics/settings.py @@ -7,7 +7,7 @@ import pycountry from aiohttp import web from models_library.utils.change_case import snake_to_camel -from pydantic import AnyHttpUrl, Field, parse_obj_as +from pydantic.v1 import AnyHttpUrl, Field, parse_obj_as from settings_library.base import BaseCustomSettings from .._constants import APP_SETTINGS_KEY diff --git a/services/web/server/src/simcore_service_webserver/storage/_handlers.py b/services/web/server/src/simcore_service_webserver/storage/_handlers.py index 078d26b813b..fca2d5cca5c 100644 --- a/services/web/server/src/simcore_service_webserver/storage/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/storage/_handlers.py @@ -14,7 +14,7 @@ ) from models_library.projects_nodes_io import LocationID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import AnyUrl, BaseModel, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, BaseModel, ByteSize, parse_obj_as from servicelib.aiohttp.client_session import get_client_session from servicelib.aiohttp.requests_validation import ( parse_request_body_as, diff --git a/services/web/server/src/simcore_service_webserver/storage/api.py b/services/web/server/src/simcore_service_webserver/storage/api.py index 2ddf66d8907..aedbe78197c 100644 --- a/services/web/server/src/simcore_service_webserver/storage/api.py +++ b/services/web/server/src/simcore_service_webserver/storage/api.py @@ -20,7 +20,7 @@ from models_library.projects_nodes_io import LocationID, NodeID, SimCoreFileLink from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import ByteSize, HttpUrl, parse_obj_as +from pydantic.v1 import ByteSize, HttpUrl, parse_obj_as from servicelib.aiohttp.client_session import get_client_session from servicelib.aiohttp.long_running_tasks.client import ( LRTask, diff --git a/services/web/server/src/simcore_service_webserver/storage/schemas.py b/services/web/server/src/simcore_service_webserver/storage/schemas.py index 4c47c99a8ff..473064efbbf 100644 --- a/services/web/server/src/simcore_service_webserver/storage/schemas.py +++ b/services/web/server/src/simcore_service_webserver/storage/schemas.py @@ -2,7 +2,7 @@ from typing import Any, ClassVar, TypeAlias from models_library.api_schemas_storage import TableSynchronisation -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field # NOTE: storage generates URLs that contain double encoded # slashes, and when applying validation via `StorageFileID` diff --git a/services/web/server/src/simcore_service_webserver/storage/settings.py b/services/web/server/src/simcore_service_webserver/storage/settings.py index e49e652699d..3f9e755dd50 100644 --- a/services/web/server/src/simcore_service_webserver/storage/settings.py +++ b/services/web/server/src/simcore_service_webserver/storage/settings.py @@ -2,7 +2,7 @@ from aiohttp import web from models_library.basic_types import PortInt, VersionTag -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from settings_library.base import BaseCustomSettings from settings_library.utils_service import DEFAULT_AIOHTTP_PORT, MixinServiceSettings from yarl import URL diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_catalog.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_catalog.py index 3df62ebd379..33db9701777 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_catalog.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_catalog.py @@ -9,7 +9,7 @@ from aiopg.sa.engine import Engine from models_library.groups import EVERYONE_GROUP_ID from models_library.services import ServiceKey, ServiceVersion -from pydantic import HttpUrl, PositiveInt, ValidationError, parse_obj_as +from pydantic.v1 import HttpUrl, PositiveInt, ValidationError, parse_obj_as from servicelib.logging_utils import log_decorator from simcore_postgres_database.models.services import ( services_access_rights, diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_core.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_core.py index a34a50832d9..43b0f18b8ab 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_core.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_core.py @@ -7,7 +7,7 @@ from aiohttp import web from models_library.services import ServiceVersion from models_library.utils.pydantic_tools_extension import parse_obj_or_none -from pydantic import ByteSize, ValidationError, parse_obj_as +from pydantic.v1 import ByteSize, ValidationError, parse_obj_as from servicelib.logging_utils import log_decorator from simcore_postgres_database.models.services_consume_filetypes import ( services_consume_filetypes, diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_models.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_models.py index 30aa1387269..ccaa602964f 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_models.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_models.py @@ -1,6 +1,6 @@ from aiopg.sa.result import RowProxy from models_library.services import ServiceKey, ServiceVersion -from pydantic import BaseModel, Field, HttpUrl, PositiveInt, parse_obj_as +from pydantic.v1 import BaseModel, Field, HttpUrl, PositiveInt, parse_obj_as class ServiceInfo(BaseModel): diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects.py index e4b71213ee6..e67f6e86386 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects.py @@ -18,7 +18,7 @@ from models_library.projects_nodes_io import DownloadLink, NodeID, PortLink from models_library.projects_ui import StudyUI from models_library.services import ServiceKey, ServiceVersion -from pydantic import AnyUrl, HttpUrl, parse_obj_as +from pydantic.v1 import AnyUrl, HttpUrl, parse_obj_as from servicelib.logging_utils import log_decorator from ..projects.db import ProjectDBAPI diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects_permalinks.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects_permalinks.py index 055f0f78fcf..b70acdc309f 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects_permalinks.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_projects_permalinks.py @@ -4,7 +4,7 @@ import sqlalchemy as sa from aiohttp import web from models_library.projects import ProjectID, ProjectIDStr -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from simcore_postgres_database.models.project_to_groups import project_to_groups from simcore_postgres_database.models.projects import ProjectType, projects diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_redirects_handlers.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_redirects_handlers.py index 1b60fd5f7e0..324022b3d50 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_redirects_handlers.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_redirects_handlers.py @@ -11,7 +11,7 @@ from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID from models_library.services import ServiceKey, ServiceVersion -from pydantic import BaseModel, Extra, ValidationError, validator +from pydantic.v1 import BaseModel, Extra, ValidationError, validator from servicelib.aiohttp import status from servicelib.aiohttp.requests_validation import parse_request_query_parameters_as from servicelib.aiohttp.typing_extension import Handler diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_rest_handlers.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_rest_handlers.py index 9f66cd460b0..9b6029fd44f 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_rest_handlers.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_rest_handlers.py @@ -9,8 +9,8 @@ from aiohttp.web import Request from models_library.services import ServiceKey from models_library.services_types import ServiceVersion -from pydantic import BaseModel, Field, ValidationError, parse_obj_as, validator -from pydantic.networks import HttpUrl +from pydantic.v1 import BaseModel, Field, ValidationError, parse_obj_as, validator +from pydantic.v1.networks import HttpUrl from .._meta import API_VTAG from ..products.api import get_product_name diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py index c9ff40adbd9..c1db27c7f00 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py @@ -17,7 +17,7 @@ import redis.asyncio as aioredis from aiohttp import web from models_library.emails import LowerCaseEmailStr -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from redis.exceptions import LockNotOwnedError from servicelib.aiohttp.application_keys import APP_FIRE_AND_FORGET_TASKS_KEY from servicelib.logging_utils import log_decorator diff --git a/services/web/server/src/simcore_service_webserver/studies_dispatcher/settings.py b/services/web/server/src/simcore_service_webserver/studies_dispatcher/settings.py index 3ef317631ed..89250833b9b 100644 --- a/services/web/server/src/simcore_service_webserver/studies_dispatcher/settings.py +++ b/services/web/server/src/simcore_service_webserver/studies_dispatcher/settings.py @@ -2,8 +2,8 @@ from typing import Any, ClassVar from aiohttp import web -from pydantic import ByteSize, HttpUrl, parse_obj_as, validator -from pydantic.fields import Field +from pydantic.v1 import ByteSize, HttpUrl, parse_obj_as, validator +from pydantic.v1.fields import Field from servicelib.aiohttp.application_keys import APP_SETTINGS_KEY from settings_library.base import BaseCustomSettings diff --git a/services/web/server/src/simcore_service_webserver/tags/_handlers.py b/services/web/server/src/simcore_service_webserver/tags/_handlers.py index b2f6537f5be..df56859d5b6 100644 --- a/services/web/server/src/simcore_service_webserver/tags/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/tags/_handlers.py @@ -5,7 +5,7 @@ from aiopg.sa.engine import Engine from models_library.api_schemas_webserver._base import InputSchema, OutputSchema from models_library.users import UserID -from pydantic import BaseModel, ConstrainedStr, Field, PositiveInt +from pydantic.v1 import BaseModel, ConstrainedStr, Field, PositiveInt from servicelib.aiohttp.application_keys import APP_DB_ENGINE_KEY from servicelib.aiohttp.requests_validation import ( parse_request_body_as, diff --git a/services/web/server/src/simcore_service_webserver/users/_api.py b/services/web/server/src/simcore_service_webserver/users/_api.py index a054bfe5927..06189676b26 100644 --- a/services/web/server/src/simcore_service_webserver/users/_api.py +++ b/services/web/server/src/simcore_service_webserver/users/_api.py @@ -6,7 +6,7 @@ from models_library.emails import LowerCaseEmailStr from models_library.payments import UserInvoiceAddress from models_library.users import UserBillingDetails, UserID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.models.users import UserStatus from ..db.plugin import get_database_engine diff --git a/services/web/server/src/simcore_service_webserver/users/_handlers.py b/services/web/server/src/simcore_service_webserver/users/_handlers.py index ede00340d4e..fadfae48ec5 100644 --- a/services/web/server/src/simcore_service_webserver/users/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/users/_handlers.py @@ -3,7 +3,7 @@ from aiohttp import web from models_library.users import UserID -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_query_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/users/_notifications.py b/services/web/server/src/simcore_service_webserver/users/_notifications.py index 256e521f89c..009de038f09 100644 --- a/services/web/server/src/simcore_service_webserver/users/_notifications.py +++ b/services/web/server/src/simcore_service_webserver/users/_notifications.py @@ -6,7 +6,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.utils.enums import StrAutoEnum -from pydantic import BaseModel, NonNegativeInt, validator +from pydantic.v1 import BaseModel, NonNegativeInt, validator MAX_NOTIFICATIONS_FOR_USER_TO_SHOW: Final[NonNegativeInt] = 10 MAX_NOTIFICATIONS_FOR_USER_TO_KEEP: Final[NonNegativeInt] = 100 diff --git a/services/web/server/src/simcore_service_webserver/users/_notifications_handlers.py b/services/web/server/src/simcore_service_webserver/users/_notifications_handlers.py index b30a435210b..9d1d1010a6d 100644 --- a/services/web/server/src/simcore_service_webserver/users/_notifications_handlers.py +++ b/services/web/server/src/simcore_service_webserver/users/_notifications_handlers.py @@ -3,7 +3,7 @@ import redis.asyncio as aioredis from aiohttp import web -from pydantic import BaseModel +from pydantic.v1 import BaseModel from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/users/_preferences_api.py b/services/web/server/src/simcore_service_webserver/users/_preferences_api.py index 8e17a4a25d4..30022de9ca5 100644 --- a/services/web/server/src/simcore_service_webserver/users/_preferences_api.py +++ b/services/web/server/src/simcore_service_webserver/users/_preferences_api.py @@ -13,7 +13,7 @@ PreferenceName, ) from models_library.users import UserID -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from servicelib.utils import logged_gather from simcore_postgres_database.utils_groups_extra_properties import ( GroupExtraPropertiesRepo, diff --git a/services/web/server/src/simcore_service_webserver/users/_preferences_handlers.py b/services/web/server/src/simcore_service_webserver/users/_preferences_handlers.py index 9f5513b904f..4d0596a01bf 100644 --- a/services/web/server/src/simcore_service_webserver/users/_preferences_handlers.py +++ b/services/web/server/src/simcore_service_webserver/users/_preferences_handlers.py @@ -7,7 +7,7 @@ ) from models_library.products import ProductName from models_library.users import UserID -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/users/_preferences_models.py b/services/web/server/src/simcore_service_webserver/users/_preferences_models.py index 01b6b87e377..cb9ed61bc37 100644 --- a/services/web/server/src/simcore_service_webserver/users/_preferences_models.py +++ b/services/web/server/src/simcore_service_webserver/users/_preferences_models.py @@ -10,7 +10,7 @@ PreferenceIdentifier, PreferenceName, ) -from pydantic import Field, NonNegativeInt +from pydantic.v1 import Field, NonNegativeInt from .settings import UsersSettings, get_plugin_settings diff --git a/services/web/server/src/simcore_service_webserver/users/_schemas.py b/services/web/server/src/simcore_service_webserver/users/_schemas.py index 1dd4f59992f..c75263d3417 100644 --- a/services/web/server/src/simcore_service_webserver/users/_schemas.py +++ b/services/web/server/src/simcore_service_webserver/users/_schemas.py @@ -12,7 +12,7 @@ from models_library.api_schemas_webserver._base import InputSchema, OutputSchema from models_library.emails import LowerCaseEmailStr from models_library.products import ProductName -from pydantic import Field, root_validator, validator +from pydantic.v1 import Field, root_validator, validator from simcore_postgres_database.models.users import UserStatus diff --git a/services/web/server/src/simcore_service_webserver/users/_tokens_handlers.py b/services/web/server/src/simcore_service_webserver/users/_tokens_handlers.py index ddca5a94b2f..f53f129d149 100644 --- a/services/web/server/src/simcore_service_webserver/users/_tokens_handlers.py +++ b/services/web/server/src/simcore_service_webserver/users/_tokens_handlers.py @@ -2,7 +2,7 @@ import logging from aiohttp import web -from pydantic import BaseModel +from pydantic.v1 import BaseModel from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/users/api.py b/services/web/server/src/simcore_service_webserver/users/api.py index 7b913f937cf..88e804b432b 100644 --- a/services/web/server/src/simcore_service_webserver/users/api.py +++ b/services/web/server/src/simcore_service_webserver/users/api.py @@ -16,7 +16,7 @@ from models_library.basic_types import IDStr from models_library.products import ProductName from models_library.users import GroupID, UserID -from pydantic import EmailStr, ValidationError, parse_obj_as +from pydantic.v1 import EmailStr, ValidationError, parse_obj_as from simcore_postgres_database.models.users import UserRole from ..db.models import GroupType, groups, user_to_groups, users diff --git a/services/web/server/src/simcore_service_webserver/users/schemas.py b/services/web/server/src/simcore_service_webserver/users/schemas.py index 53c9ee9b756..b4199f06ea5 100644 --- a/services/web/server/src/simcore_service_webserver/users/schemas.py +++ b/services/web/server/src/simcore_service_webserver/users/schemas.py @@ -8,7 +8,7 @@ from models_library.emails import LowerCaseEmailStr from models_library.users import FirstNameStr, LastNameStr, UserID from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Field, root_validator, validator +from pydantic.v1 import BaseModel, Field, root_validator, validator from simcore_postgres_database.models.users import UserRole from ..utils import gravatar_hash diff --git a/services/web/server/src/simcore_service_webserver/users/settings.py b/services/web/server/src/simcore_service_webserver/users/settings.py index 2b6b9f101ac..1e65d248b2c 100644 --- a/services/web/server/src/simcore_service_webserver/users/settings.py +++ b/services/web/server/src/simcore_service_webserver/users/settings.py @@ -1,5 +1,5 @@ from aiohttp import web -from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic.v1 import Field, StrictBool, StrictFloat, StrictInt, StrictStr from settings_library.base import BaseCustomSettings from settings_library.utils_service import MixinServiceSettings diff --git a/services/web/server/src/simcore_service_webserver/utils_aiohttp.py b/services/web/server/src/simcore_service_webserver/utils_aiohttp.py index ae35a58ee6f..a0f003a93fb 100644 --- a/services/web/server/src/simcore_service_webserver/utils_aiohttp.py +++ b/services/web/server/src/simcore_service_webserver/utils_aiohttp.py @@ -8,8 +8,8 @@ from aiohttp.web_routedef import RouteDef, RouteTableDef from models_library.generics import Envelope from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, Field -from pydantic.generics import GenericModel +from pydantic.v1 import BaseModel, Field +from pydantic.v1.generics import GenericModel from servicelib.common_headers import X_FORWARDED_PROTO from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON from servicelib.rest_constants import RESPONSE_MODEL_POLICY diff --git a/services/web/server/src/simcore_service_webserver/version_control/_core.py b/services/web/server/src/simcore_service_webserver/version_control/_core.py index 53f10829b48..071f7d5d5e4 100644 --- a/services/web/server/src/simcore_service_webserver/version_control/_core.py +++ b/services/web/server/src/simcore_service_webserver/version_control/_core.py @@ -12,7 +12,7 @@ from uuid import UUID from aiopg.sa.result import RowProxy -from pydantic import NonNegativeInt, PositiveInt, validate_arguments +from pydantic.v1 import NonNegativeInt, PositiveInt, validate_arguments from .db import VersionControlRepository from .errors import CleanRequiredError diff --git a/services/web/server/src/simcore_service_webserver/version_control/_handlers.py b/services/web/server/src/simcore_service_webserver/version_control/_handlers.py index 0cf849effb0..63fbe2e8f06 100644 --- a/services/web/server/src/simcore_service_webserver/version_control/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/version_control/_handlers.py @@ -4,7 +4,7 @@ from models_library.projects import ProjectID from models_library.rest_pagination import Page, PageQueryParameters from models_library.rest_pagination_utils import paginate_data -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/version_control/_handlers_base.py b/services/web/server/src/simcore_service_webserver/version_control/_handlers_base.py index 171cf937704..0a73de196fe 100644 --- a/services/web/server/src/simcore_service_webserver/version_control/_handlers_base.py +++ b/services/web/server/src/simcore_service_webserver/version_control/_handlers_base.py @@ -4,7 +4,7 @@ from aiohttp import web from models_library.utils.json_serialization import json_dumps -from pydantic.error_wrappers import ValidationError +from pydantic.v1.error_wrappers import ValidationError from servicelib.aiohttp.typing_extension import Handler from ..projects.exceptions import ProjectNotFoundError diff --git a/services/web/server/src/simcore_service_webserver/version_control/db.py b/services/web/server/src/simcore_service_webserver/version_control/db.py index 9ae6162c09e..dfc66c3d8d7 100644 --- a/services/web/server/src/simcore_service_webserver/version_control/db.py +++ b/services/web/server/src/simcore_service_webserver/version_control/db.py @@ -10,7 +10,7 @@ from models_library.basic_types import SHA1Str from models_library.projects import ProjectIDStr from models_library.utils.json_serialization import json_dumps -from pydantic.types import NonNegativeInt, PositiveInt +from pydantic.v1.types import NonNegativeInt, PositiveInt from simcore_postgres_database.models.projects import projects from simcore_postgres_database.models.projects_version_control import ( projects_vc_branches, diff --git a/services/web/server/src/simcore_service_webserver/version_control/models.py b/services/web/server/src/simcore_service_webserver/version_control/models.py index a562459547e..595785f7b32 100644 --- a/services/web/server/src/simcore_service_webserver/version_control/models.py +++ b/services/web/server/src/simcore_service_webserver/version_control/models.py @@ -5,8 +5,15 @@ from models_library.basic_types import SHA1Str from models_library.projects import ProjectID from models_library.projects_nodes import Node -from pydantic import BaseModel, Field, PositiveInt, StrictBool, StrictFloat, StrictInt -from pydantic.networks import HttpUrl +from pydantic.v1 import ( + BaseModel, + Field, + PositiveInt, + StrictBool, + StrictFloat, + StrictInt, +) +from pydantic.v1.networks import HttpUrl BuiltinTypes: TypeAlias = Union[StrictBool, StrictInt, StrictFloat, str] diff --git a/services/web/server/src/simcore_service_webserver/wallets/_api.py b/services/web/server/src/simcore_service_webserver/wallets/_api.py index 2f4752277da..0bfe02b1720 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_api.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_api.py @@ -13,7 +13,7 @@ from models_library.products import ProductName from models_library.users import UserID from models_library.wallets import UserWalletDB, WalletDB, WalletID, WalletStatus -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from ..resource_usage.api import get_wallet_total_available_credits from ..users import api as users_api diff --git a/services/web/server/src/simcore_service_webserver/wallets/_db.py b/services/web/server/src/simcore_service_webserver/wallets/_db.py index bea1610be37..71940fb3cc3 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_db.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_db.py @@ -9,7 +9,7 @@ from models_library.products import ProductName from models_library.users import GroupID, UserID from models_library.wallets import UserWalletDB, WalletDB, WalletID, WalletStatus -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_postgres_database.models.groups import user_to_groups from simcore_postgres_database.models.wallet_to_groups import wallet_to_groups from simcore_postgres_database.models.wallets import wallets diff --git a/services/web/server/src/simcore_service_webserver/wallets/_events.py b/services/web/server/src/simcore_service_webserver/wallets/_events.py index 67d5ebcd259..0da376e9951 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_events.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_events.py @@ -4,7 +4,7 @@ from models_library.basic_types import IDStr from models_library.products import ProductName from models_library.users import UserID -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from servicelib.aiohttp.observer import register_observer, setup_observer_registry from ..products.api import get_product diff --git a/services/web/server/src/simcore_service_webserver/wallets/_groups_api.py b/services/web/server/src/simcore_service_webserver/wallets/_groups_api.py index ec0cf2a0515..3ce91a7bd62 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_groups_api.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_groups_api.py @@ -5,7 +5,7 @@ from models_library.products import ProductName from models_library.users import GroupID, UserID from models_library.wallets import UserWalletDB, WalletID -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from ..users import api as users_api from . import _db as wallets_db diff --git a/services/web/server/src/simcore_service_webserver/wallets/_groups_db.py b/services/web/server/src/simcore_service_webserver/wallets/_groups_db.py index f9d42cc6ddd..35c030d3c1e 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_groups_db.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_groups_db.py @@ -9,7 +9,7 @@ from aiohttp import web from models_library.users import GroupID from models_library.wallets import WalletID -from pydantic import BaseModel, parse_obj_as +from pydantic.v1 import BaseModel, parse_obj_as from simcore_postgres_database.models.wallet_to_groups import wallet_to_groups from sqlalchemy import func, literal_column from sqlalchemy.sql import select diff --git a/services/web/server/src/simcore_service_webserver/wallets/_groups_handlers.py b/services/web/server/src/simcore_service_webserver/wallets/_groups_handlers.py index 6690d6d41e4..fb01af1ad50 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_groups_handlers.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_groups_handlers.py @@ -8,7 +8,7 @@ from aiohttp import web from models_library.users import GroupID, UserID from models_library.wallets import WalletID -from pydantic import BaseModel, Extra, Field +from pydantic.v1 import BaseModel, Extra, Field from servicelib.aiohttp.requests_validation import ( parse_request_body_as, parse_request_path_parameters_as, diff --git a/services/web/server/src/simcore_service_webserver/wallets/_handlers.py b/services/web/server/src/simcore_service_webserver/wallets/_handlers.py index 0b43bbea59a..cafb7ff3269 100644 --- a/services/web/server/src/simcore_service_webserver/wallets/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/wallets/_handlers.py @@ -10,7 +10,7 @@ ) from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import Field +from pydantic.v1 import Field from servicelib.aiohttp.requests_validation import ( RequestParams, StrictRequestParams, diff --git a/services/web/server/tests/unit/isolated/test_application_settings.py b/services/web/server/tests/unit/isolated/test_application_settings.py index 9b03e109202..5b4409d9820 100644 --- a/services/web/server/tests/unit/isolated/test_application_settings.py +++ b/services/web/server/tests/unit/isolated/test_application_settings.py @@ -8,7 +8,7 @@ import pytest from aiohttp import web from models_library.utils.json_serialization import json_dumps -from pydantic import HttpUrl, parse_obj_as +from pydantic.v1 import HttpUrl, parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import ( setenvs_from_dict, setenvs_from_envfile, diff --git a/services/web/server/tests/unit/isolated/test_login_settings.py b/services/web/server/tests/unit/isolated/test_login_settings.py index b6872fce92d..8c184632ab0 100644 --- a/services/web/server/tests/unit/isolated/test_login_settings.py +++ b/services/web/server/tests/unit/isolated/test_login_settings.py @@ -7,7 +7,7 @@ import pytest from models_library.errors import ErrorDict -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from settings_library.email import SMTPSettings from simcore_postgres_database.models.products import ProductLoginSettingsDict diff --git a/services/web/server/tests/unit/isolated/test_products_model.py b/services/web/server/tests/unit/isolated/test_products_model.py index b3ee823a37e..41b1649d58d 100644 --- a/services/web/server/tests/unit/isolated/test_products_model.py +++ b/services/web/server/tests/unit/isolated/test_products_model.py @@ -7,7 +7,7 @@ import pytest from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel +from pydantic.v1 import BaseModel from simcore_service_webserver.products._db import Product diff --git a/services/web/server/tests/unit/isolated/test_projects__nodes_api.py b/services/web/server/tests/unit/isolated/test_projects__nodes_api.py index ef58b4b2451..9033b13b6de 100644 --- a/services/web/server/tests/unit/isolated/test_projects__nodes_api.py +++ b/services/web/server/tests/unit/isolated/test_projects__nodes_api.py @@ -3,7 +3,7 @@ import pytest from models_library.api_schemas_storage import FileMetaDataGet -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_webserver.projects._nodes_api import ( _SUPPORTED_PREVIEW_FILE_EXTENSIONS, _FileWithThumbnail, diff --git a/services/web/server/tests/unit/isolated/test_projects__nodes_resources.py b/services/web/server/tests/unit/isolated/test_projects__nodes_resources.py index 12f6bfc23b4..3d7ebdbe455 100644 --- a/services/web/server/tests/unit/isolated/test_projects__nodes_resources.py +++ b/services/web/server/tests/unit/isolated/test_projects__nodes_resources.py @@ -5,7 +5,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from simcore_service_webserver.projects._nodes_utils import ( validate_new_service_resources, ) diff --git a/services/web/server/tests/unit/isolated/test_security_api.py b/services/web/server/tests/unit/isolated/test_security_api.py index f7e73620435..48bb42ced95 100644 --- a/services/web/server/tests/unit/isolated/test_security_api.py +++ b/services/web/server/tests/unit/isolated/test_security_api.py @@ -17,7 +17,7 @@ from aiohttp_session import get_session from models_library.emails import LowerCaseEmailStr from models_library.products import ProductName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.typing_env import EnvVarsDict from servicelib.aiohttp import status diff --git a/services/web/server/tests/unit/isolated/test_statics_settings.py b/services/web/server/tests/unit/isolated/test_statics_settings.py index 376a8330eb9..e5295f4939c 100644 --- a/services/web/server/tests/unit/isolated/test_statics_settings.py +++ b/services/web/server/tests/unit/isolated/test_statics_settings.py @@ -4,7 +4,7 @@ import json -from pydantic import AnyHttpUrl, BaseModel, parse_obj_as +from pydantic.v1 import AnyHttpUrl, BaseModel, parse_obj_as from simcore_service_webserver.statics.settings import ( _THIRD_PARTY_REFERENCES, FrontEndAppSettings, diff --git a/services/web/server/tests/unit/isolated/test_storage_schemas.py b/services/web/server/tests/unit/isolated/test_storage_schemas.py index c11ce1f1345..2c23ff80f5f 100644 --- a/services/web/server/tests/unit/isolated/test_storage_schemas.py +++ b/services/web/server/tests/unit/isolated/test_storage_schemas.py @@ -8,7 +8,7 @@ import pytest import simcore_service_webserver.storage.schemas -from pydantic import BaseModel +from pydantic.v1 import BaseModel from pytest_simcore.pydantic_models import iter_model_examples_in_module diff --git a/services/web/server/tests/unit/isolated/test_studies_dispatcher_core.py b/services/web/server/tests/unit/isolated/test_studies_dispatcher_core.py index 8faada91005..d19a61fbbc4 100644 --- a/services/web/server/tests/unit/isolated/test_studies_dispatcher_core.py +++ b/services/web/server/tests/unit/isolated/test_studies_dispatcher_core.py @@ -12,9 +12,9 @@ import pytest from models_library.projects import Project, ProjectID from models_library.projects_nodes_io import NodeID -from pydantic import validator -from pydantic.main import BaseModel -from pydantic.networks import HttpUrl +from pydantic.v1 import validator +from pydantic.v1.main import BaseModel +from pydantic.v1.networks import HttpUrl from pytest_simcore.helpers.webserver_fake_services_data import list_fake_file_consumers from simcore_service_webserver.studies_dispatcher._projects import ( UserInfo, diff --git a/services/web/server/tests/unit/isolated/test_studies_dispatcher_models.py b/services/web/server/tests/unit/isolated/test_studies_dispatcher_models.py index 0ab58dfd77e..11ab71db7bd 100644 --- a/services/web/server/tests/unit/isolated/test_studies_dispatcher_models.py +++ b/services/web/server/tests/unit/isolated/test_studies_dispatcher_models.py @@ -11,7 +11,7 @@ import pytest from aiohttp.test_utils import make_mocked_request from models_library.utils.pydantic_tools_extension import parse_obj_or_none -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from servicelib.aiohttp.requests_validation import parse_request_query_parameters_as from simcore_service_webserver.studies_dispatcher._models import ( FileParams, diff --git a/services/web/server/tests/unit/isolated/test_studies_dispatcher_settings.py b/services/web/server/tests/unit/isolated/test_studies_dispatcher_settings.py index 91364e64beb..1ceffd68300 100644 --- a/services/web/server/tests/unit/isolated/test_studies_dispatcher_settings.py +++ b/services/web/server/tests/unit/isolated/test_studies_dispatcher_settings.py @@ -9,7 +9,7 @@ import pytest from models_library.errors import ErrorDict -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from simcore_service_webserver.studies_dispatcher.settings import ( diff --git a/services/web/server/tests/unit/isolated/test_users_models.py b/services/web/server/tests/unit/isolated/test_users_models.py index ef5ee03c7b0..69f24cd72e8 100644 --- a/services/web/server/tests/unit/isolated/test_users_models.py +++ b/services/web/server/tests/unit/isolated/test_users_models.py @@ -7,7 +7,7 @@ from faker import Faker from models_library.generics import Envelope from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import BaseModel +from pydantic.v1 import BaseModel from servicelib.rest_constants import RESPONSE_MODEL_POLICY from simcore_postgres_database.models.users import UserRole from simcore_service_webserver.users.schemas import ProfileGet, ThirdPartyToken diff --git a/services/web/server/tests/unit/isolated/test_utils_aiohttp.py b/services/web/server/tests/unit/isolated/test_utils_aiohttp.py index e07914929bd..5823fd28613 100644 --- a/services/web/server/tests/unit/isolated/test_utils_aiohttp.py +++ b/services/web/server/tests/unit/isolated/test_utils_aiohttp.py @@ -10,7 +10,7 @@ import pytest from aiohttp import web from faker import Faker -from pydantic import BaseModel +from pydantic.v1 import BaseModel from simcore_service_webserver.utils_aiohttp import envelope_json_response diff --git a/services/web/server/tests/unit/isolated/test_utils_rate_limiting.py b/services/web/server/tests/unit/isolated/test_utils_rate_limiting.py index 5e2b5a891b0..68ab8aef65e 100644 --- a/services/web/server/tests/unit/isolated/test_utils_rate_limiting.py +++ b/services/web/server/tests/unit/isolated/test_utils_rate_limiting.py @@ -10,7 +10,7 @@ from aiohttp import web from aiohttp.test_utils import TestClient from aiohttp.web_exceptions import HTTPOk, HTTPTooManyRequests -from pydantic import ValidationError, conint, parse_obj_as +from pydantic.v1 import ValidationError, conint, parse_obj_as from simcore_service_webserver.utils_rate_limiting import global_rate_limit_route TOTAL_TEST_TIME = 1 # secs diff --git a/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_handlers.py b/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_handlers.py index 7933270984a..cc5006ee47f 100644 --- a/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_handlers.py +++ b/services/web/server/tests/unit/with_dbs/01/studies_dispatcher/test_studies_dispatcher_handlers.py @@ -18,7 +18,7 @@ from aioresponses import aioresponses from models_library.projects_state import ProjectLocked, ProjectStatus from models_library.utils.json_serialization import json_dumps -from pydantic import BaseModel, ByteSize, parse_obj_as +from pydantic.v1 import BaseModel, ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict, UserRole diff --git a/services/web/server/tests/unit/with_dbs/01/test_api_keys_rpc.py b/services/web/server/tests/unit/with_dbs/01/test_api_keys_rpc.py index 7ad51c739d7..ffcf6331dc0 100644 --- a/services/web/server/tests/unit/with_dbs/01/test_api_keys_rpc.py +++ b/services/web/server/tests/unit/with_dbs/01/test_api_keys_rpc.py @@ -12,7 +12,7 @@ from models_library.api_schemas_webserver.auth import ApiKeyCreate from models_library.products import ProductName from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__pricing_plan.py b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__pricing_plan.py index b328ddc4c7d..a383e71a648 100644 --- a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__pricing_plan.py +++ b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__pricing_plan.py @@ -13,7 +13,7 @@ PricingPlanGet, ) from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.aioresponses_mocker import AioResponsesMock from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py index 4b97d4fc34b..b465c9d8edf 100644 --- a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py +++ b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py @@ -19,7 +19,7 @@ from models_library.services_types import ServiceKey, ServiceVersion from models_library.users import UserID from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeInt, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict diff --git a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services_resources.py b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services_resources.py index afffca3652a..1e4630684fd 100644 --- a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services_resources.py +++ b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services_resources.py @@ -13,7 +13,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.aioresponses_mocker import AioResponsesMock from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/02/conftest.py b/services/web/server/tests/unit/with_dbs/02/conftest.py index 425756375b1..5881400b99c 100644 --- a/services/web/server/tests/unit/with_dbs/02/conftest.py +++ b/services/web/server/tests/unit/with_dbs/02/conftest.py @@ -24,7 +24,7 @@ ServiceResourcesDict, ServiceResourcesDictHelpers, ) -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict diff --git a/services/web/server/tests/unit/with_dbs/02/test_announcements.py b/services/web/server/tests/unit/with_dbs/02/test_announcements.py index cd87e2526c6..1c507227941 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_announcements.py +++ b/services/web/server/tests/unit/with_dbs/02/test_announcements.py @@ -16,7 +16,7 @@ import simcore_service_webserver.announcements._models from aiohttp.test_utils import TestClient from faker import Faker -from pydantic import BaseModel, ValidationError +from pydantic.v1 import BaseModel, ValidationError from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/web/server/tests/unit/with_dbs/02/test_project_lock.py b/services/web/server/tests/unit/with_dbs/02/test_project_lock.py index 8233994b2ef..27d12fa7123 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_project_lock.py +++ b/services/web/server/tests/unit/with_dbs/02/test_project_lock.py @@ -12,7 +12,7 @@ from models_library.projects_access import Owner from models_library.projects_state import ProjectLocked, ProjectStatus from models_library.users import UserID -from pydantic import parse_raw_as +from pydantic.v1 import parse_raw_as from simcore_service_webserver.projects.lock import ( PROJECT_REDIS_LOCK_KEY, ProjectLockError, diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_cancellations.py b/services/web/server/tests/unit/with_dbs/02/test_projects_cancellations.py index 6c841fa8650..a7aba2e12df 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_cancellations.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_cancellations.py @@ -9,7 +9,7 @@ import pytest from aiohttp.test_utils import TestClient -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers.py index 482a4ced098..bb510633dd8 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers.py @@ -23,7 +23,7 @@ from models_library.projects_state import ProjectState from models_library.services import ServiceKey from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict from pytest_simcore.helpers.webserver_parametrizations import ( diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone.py b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone.py index be67e5c5bc9..432b9b70e8c 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__clone.py @@ -14,7 +14,7 @@ from faker import Faker from models_library.api_schemas_webserver.projects import ProjectGet from models_library.projects import ProjectID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.webserver_login import UserInfoDict from pytest_simcore.helpers.webserver_parametrizations import MockedStorageSubsystem from servicelib.aiohttp.long_running_tasks.client import long_running_task_request diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py index b93d33ef94b..55cf719b4f5 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_crud_handlers__list_with_query_params.py @@ -17,7 +17,7 @@ from models_library.folders import FolderID from models_library.projects import ProjectID from models_library.users import UserID -from pydantic import BaseModel, PositiveInt +from pydantic.v1 import BaseModel, PositiveInt from pytest_mock import MockerFixture from pytest_simcore.helpers.webserver_login import UserInfoDict from pytest_simcore.helpers.webserver_parametrizations import ( diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_metadata_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_metadata_handlers.py index 7a7056d7bbc..d2bc0904665 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_metadata_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_metadata_handlers.py @@ -18,7 +18,7 @@ ) from models_library.projects import ProjectID from models_library.projects_nodes_io import NodeID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict from pytest_simcore.helpers.webserver_parametrizations import ( diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_handler.py b/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_handler.py index 8243228681b..89fc18040f3 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_handler.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_handler.py @@ -33,7 +33,7 @@ ServiceResourcesDictHelpers, ) from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import NonNegativeFloat, NonNegativeInt, parse_obj_as +from pydantic.v1 import NonNegativeFloat, NonNegativeInt, parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.webserver_parametrizations import ( diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py index 06957402de2..0d104323655 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_nodes_pricing_unit_handlers.py @@ -18,7 +18,7 @@ PricingUnitGet, ) from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.aioresponses_mocker import AioResponsesMock from pytest_simcore.helpers.assert_checks import assert_status diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_ports_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_ports_handlers.py index ae1b62e0558..73ea8a85c53 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_ports_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_ports_handlers.py @@ -15,7 +15,7 @@ from models_library.api_schemas_directorv2.comp_tasks import TasksOutputs from models_library.api_schemas_webserver.projects import ProjectGet from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_fake_ports_data import ( PROJECTS_METADATA_PORTS_RESPONSE_BODY_DATA, diff --git a/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py b/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py index 9443f773c03..6e153a0d0a0 100644 --- a/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py +++ b/services/web/server/tests/unit/with_dbs/02/test_projects_wallet_handlers.py @@ -12,7 +12,7 @@ import sqlalchemy as sa from aiohttp.test_utils import TestClient from models_library.api_schemas_webserver.wallets import WalletGet -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import LoggedUser, UserInfoDict from servicelib.aiohttp import status diff --git a/services/web/server/tests/unit/with_dbs/03/invitations/test_login_handlers_registration_invitations.py b/services/web/server/tests/unit/with_dbs/03/invitations/test_login_handlers_registration_invitations.py index 7fa3ee144a7..9178416e56c 100644 --- a/services/web/server/tests/unit/with_dbs/03/invitations/test_login_handlers_registration_invitations.py +++ b/services/web/server/tests/unit/with_dbs/03/invitations/test_login_handlers_registration_invitations.py @@ -11,7 +11,7 @@ ApiInvitationInputs, ) from models_library.products import ProductName -from pydantic import HttpUrl +from pydantic.v1 import HttpUrl from pytest_mock import MockerFixture from pytest_simcore.aioresponses_mocker import AioResponsesMock from pytest_simcore.helpers.assert_checks import assert_status diff --git a/services/web/server/tests/unit/with_dbs/03/invitations/test_products__invitations_handlers.py b/services/web/server/tests/unit/with_dbs/03/invitations/test_products__invitations_handlers.py index c3246184dd0..9f391f7225d 100644 --- a/services/web/server/tests/unit/with_dbs/03/invitations/test_products__invitations_handlers.py +++ b/services/web/server/tests/unit/with_dbs/03/invitations/test_products__invitations_handlers.py @@ -15,7 +15,7 @@ GenerateInvitation, InvitationGenerated, ) -from pydantic import PositiveInt +from pydantic.v1 import PositiveInt from pytest_simcore.aioresponses_mocker import AioResponsesMock from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.faker_factories import DEFAULT_TEST_PASSWORD diff --git a/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa_resend.py b/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa_resend.py index 7139811a6b1..b5203dfe08f 100644 --- a/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa_resend.py +++ b/services/web/server/tests/unit/with_dbs/03/login/test_login_2fa_resend.py @@ -6,7 +6,7 @@ import pytest import sqlalchemy as sa from aiohttp.test_utils import TestClient -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict diff --git a/services/web/server/tests/unit/with_dbs/03/meta_modeling/test_meta_modeling_results.py b/services/web/server/tests/unit/with_dbs/03/meta_modeling/test_meta_modeling_results.py index 8c86119bfc1..d3ee13fb942 100644 --- a/services/web/server/tests/unit/with_dbs/03/meta_modeling/test_meta_modeling_results.py +++ b/services/web/server/tests/unit/with_dbs/03/meta_modeling/test_meta_modeling_results.py @@ -7,7 +7,7 @@ from typing import Any import pytest -from pydantic import BaseModel +from pydantic.v1 import BaseModel from simcore_service_webserver.meta_modeling._results import ( ExtractedResults, extract_project_results, diff --git a/services/web/server/tests/unit/with_dbs/03/products/test_products_rpc.py b/services/web/server/tests/unit/with_dbs/03/products/test_products_rpc.py index 3de1f7a95c8..3ff92e27237 100644 --- a/services/web/server/tests/unit/with_dbs/03/products/test_products_rpc.py +++ b/services/web/server/tests/unit/with_dbs/03/products/test_products_rpc.py @@ -10,7 +10,7 @@ from models_library.api_schemas_webserver import WEBSERVER_RPC_NAMESPACE from models_library.products import CreditResultGet, ProductName from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/web/server/tests/unit/with_dbs/03/resource_usage/test_admin_pricing_plans.py b/services/web/server/tests/unit/with_dbs/03/resource_usage/test_admin_pricing_plans.py index 6e67883e357..7f0b93cca2d 100644 --- a/services/web/server/tests/unit/with_dbs/03/resource_usage/test_admin_pricing_plans.py +++ b/services/web/server/tests/unit/with_dbs/03/resource_usage/test_admin_pricing_plans.py @@ -17,7 +17,7 @@ PricingUnitGet, ) from models_library.resource_tracker import PricingPlanClassification -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/03/resource_usage/test_pricing_plans.py b/services/web/server/tests/unit/with_dbs/03/resource_usage/test_pricing_plans.py index 7b25e33a799..aa89b7f1b1c 100644 --- a/services/web/server/tests/unit/with_dbs/03/resource_usage/test_pricing_plans.py +++ b/services/web/server/tests/unit/with_dbs/03/resource_usage/test_pricing_plans.py @@ -15,7 +15,7 @@ PricingUnitGet, ) from models_library.utils.fastapi_encoders import jsonable_encoder -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.aioresponses_mocker import AioResponsesMock from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/03/resource_usage/test_usage_services__export.py b/services/web/server/tests/unit/with_dbs/03/resource_usage/test_usage_services__export.py index 6a80bccca0d..c0ef35f26dd 100644 --- a/services/web/server/tests/unit/with_dbs/03/resource_usage/test_usage_services__export.py +++ b/services/web/server/tests/unit/with_dbs/03/resource_usage/test_usage_services__export.py @@ -16,7 +16,7 @@ from aiohttp.test_utils import TestClient from models_library.resource_tracker import ServiceResourceUsagesFilters from models_library.rest_ordering import OrderBy -from pydantic import AnyUrl, parse_obj_as +from pydantic.v1 import AnyUrl, parse_obj_as from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.webserver_login import UserInfoDict from servicelib.aiohttp import status diff --git a/services/web/server/tests/unit/with_dbs/03/test_email.py b/services/web/server/tests/unit/with_dbs/03/test_email.py index e2164071c16..7212e501b5a 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_email.py +++ b/services/web/server/tests/unit/with_dbs/03/test_email.py @@ -16,7 +16,7 @@ from aiohttp import web from aiohttp.test_utils import TestClient, make_mocked_request from faker import Faker -from pydantic import ValidationError +from pydantic.v1 import ValidationError from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict diff --git a/services/web/server/tests/unit/with_dbs/03/test_storage_handlers.py b/services/web/server/tests/unit/with_dbs/03/test_storage_handlers.py index b047fd2c9a7..5aebe3d6a00 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_storage_handlers.py +++ b/services/web/server/tests/unit/with_dbs/03/test_storage_handlers.py @@ -14,7 +14,7 @@ FileUploadLinks, FileUploadSchema, ) -from pydantic import AnyUrl, ByteSize, parse_obj_as +from pydantic.v1 import AnyUrl, ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/services/web/server/tests/unit/with_dbs/03/test_users__notifications.py b/services/web/server/tests/unit/with_dbs/03/test_users__notifications.py index 77aaccade51..f690ee3a442 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_users__notifications.py +++ b/services/web/server/tests/unit/with_dbs/03/test_users__notifications.py @@ -18,7 +18,7 @@ import redis.asyncio as aioredis from aiohttp.test_utils import TestClient from models_library.products import ProductName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/03/test_users__preferences_api.py b/services/web/server/tests/unit/with_dbs/03/test_users__preferences_api.py index 3835883af8b..afd54c56024 100644 --- a/services/web/server/tests/unit/with_dbs/03/test_users__preferences_api.py +++ b/services/web/server/tests/unit/with_dbs/03/test_users__preferences_api.py @@ -15,8 +15,8 @@ from models_library.products import ProductName from models_library.user_preferences import FrontendUserPreference from models_library.users import UserID -from pydantic import BaseModel -from pydantic.fields import ModelField +from pydantic.v1 import BaseModel +from pydantic.v1.fields import ModelField from pytest_simcore.helpers.monkeypatch_envs import EnvVarsDict, setenvs_from_dict from pytest_simcore.helpers.webserver_login import NewUser from simcore_postgres_database.models.groups_extra_properties import ( diff --git a/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control.py b/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control.py index ed04b3728e2..afb21df9c48 100644 --- a/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control.py +++ b/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control.py @@ -4,7 +4,7 @@ from models_library.projects import NodesDict -from pydantic import BaseModel +from pydantic.v1 import BaseModel from simcore_service_webserver.projects.models import ProjectDict from simcore_service_webserver.version_control.db import compute_workbench_checksum diff --git a/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control_handlers.py b/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control_handlers.py index 05ab31ccdf8..2903ecec3cd 100644 --- a/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control_handlers.py +++ b/services/web/server/tests/unit/with_dbs/03/version_control/test_version_control_handlers.py @@ -12,7 +12,7 @@ from models_library.projects import Project, ProjectID from models_library.rest_pagination import Page from models_library.users import UserID -from pydantic.main import BaseModel +from pydantic.v1.main import BaseModel from pytest_simcore.helpers.assert_checks import assert_status from servicelib.aiohttp import status from simcore_service_webserver._meta import API_VTAG as VX diff --git a/services/web/server/tests/unit/with_dbs/03/wallets/payments/conftest.py b/services/web/server/tests/unit/with_dbs/03/wallets/payments/conftest.py index 2b59b77c3b5..b2f034dfe5e 100644 --- a/services/web/server/tests/unit/with_dbs/03/wallets/payments/conftest.py +++ b/services/web/server/tests/unit/with_dbs/03/wallets/payments/conftest.py @@ -28,7 +28,7 @@ from models_library.products import ProductName, StripePriceID, StripeTaxRateID from models_library.users import UserID from models_library.wallets import WalletID -from pydantic import EmailStr, HttpUrl +from pydantic.v1 import EmailStr, HttpUrl from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments.py b/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments.py index ed8b2868481..13a57efd754 100644 --- a/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments.py +++ b/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments.py @@ -17,7 +17,7 @@ WalletPaymentInitiated, ) from models_library.rest_pagination import Page -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from pytest_simcore.helpers.webserver_login import LoggedUser, NewUser, UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_methods.py b/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_methods.py index 0980e45caa2..832a940e13a 100644 --- a/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_methods.py +++ b/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_methods.py @@ -22,7 +22,7 @@ ) from models_library.rest_pagination import Page from models_library.wallets import WalletID -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.assert_checks import assert_status from servicelib.aiohttp import status diff --git a/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_rpc.py b/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_rpc.py index 756c008adba..2ea65e1274d 100644 --- a/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_rpc.py +++ b/services/web/server/tests/unit/with_dbs/03/wallets/payments/test_payments_rpc.py @@ -12,7 +12,7 @@ from models_library.api_schemas_webserver import WEBSERVER_RPC_NAMESPACE from models_library.payments import InvoiceDataGet from models_library.rabbitmq_basic_types import RPCMethodName -from pydantic import parse_obj_as +from pydantic.v1 import parse_obj_as from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict from pytest_simcore.helpers.typing_env import EnvVarsDict from pytest_simcore.helpers.webserver_login import UserInfoDict diff --git a/services/web/server/tests/unit/with_dbs/conftest.py b/services/web/server/tests/unit/with_dbs/conftest.py index ba3bed4b593..051ee3fcaf5 100644 --- a/services/web/server/tests/unit/with_dbs/conftest.py +++ b/services/web/server/tests/unit/with_dbs/conftest.py @@ -38,7 +38,7 @@ from models_library.api_schemas_directorv2.dynamic_services import DynamicServiceGet from models_library.products import ProductName from models_library.services_enums import ServiceState -from pydantic import ByteSize, parse_obj_as +from pydantic.v1 import ByteSize, parse_obj_as from pytest_mock import MockerFixture from pytest_simcore.helpers.dict_tools import ConfigDict from pytest_simcore.helpers.typing_env import EnvVarsDict diff --git a/tests/e2e-playwright/tests/conftest.py b/tests/e2e-playwright/tests/conftest.py index d7104c6fe70..8b9d9ff9a4f 100644 --- a/tests/e2e-playwright/tests/conftest.py +++ b/tests/e2e-playwright/tests/conftest.py @@ -21,12 +21,12 @@ from faker import Faker from playwright.sync_api import APIRequestContext, BrowserContext, Page, WebSocket from playwright.sync_api._generated import Playwright -from pydantic import AnyUrl, TypeAdapter +from pydantic.v1 import AnyUrl, TypeAdapter from pytest import Item from pytest_simcore.helpers.logging_tools import log_context from pytest_simcore.helpers.playwright import ( - SECOND, MINUTE, + SECOND, AutoRegisteredUser, RunningState, ServiceType, @@ -410,12 +410,17 @@ def _( f"Open project in {product_url=} as {product_billable=}", ) as ctx: waiter = SocketIOProjectStateUpdatedWaiter(expected_states=expected_states) - timeout = _OPENING_TUTORIAL_MAX_WAIT_TIME if template_id is not None else _OPENING_NEW_EMPTY_PROJECT_MAX_WAIT_TIME + timeout = ( + _OPENING_TUTORIAL_MAX_WAIT_TIME + if template_id is not None + else _OPENING_NEW_EMPTY_PROJECT_MAX_WAIT_TIME + ) with ( - log_in_and_out.expect_event("framereceived", waiter, timeout=timeout + 10 * SECOND), + log_in_and_out.expect_event( + "framereceived", waiter, timeout=timeout + 10 * SECOND + ), page.expect_response( - re.compile(r"/projects/[^:]+:open"), - timeout=timeout + 5 * SECOND + re.compile(r"/projects/[^:]+:open"), timeout=timeout + 5 * SECOND ) as response_info, ): # Project detail view pop-ups shows @@ -436,8 +441,11 @@ def _( # From the long running tasks response's urls, only their path is relevant def url_to_path(url): return urllib.parse.urlparse(url).path + def wait_for_done(response): - if url_to_path(response.url) == url_to_path(lrt_data["status_href"]): + if url_to_path(response.url) == url_to_path( + lrt_data["status_href"] + ): resp_data = response.json() resp_data = resp_data["data"] assert "task_progress" in resp_data @@ -448,10 +456,13 @@ def wait_for_done(response): task_progress["message"], ) return False - if url_to_path(response.url) == url_to_path(lrt_data["result_href"]): + if url_to_path(response.url) == url_to_path( + lrt_data["result_href"] + ): copying_logger.logger.info("project created") return response.status == 201 return False + with page.expect_response(wait_for_done, timeout=timeout): # if the above calls go to fast, this test could fail # not expected in the sim4life context though diff --git a/tests/e2e-playwright/tests/jupyterlabs/conftest.py b/tests/e2e-playwright/tests/jupyterlabs/conftest.py index c98c06ee783..a12059e2da5 100644 --- a/tests/e2e-playwright/tests/jupyterlabs/conftest.py +++ b/tests/e2e-playwright/tests/jupyterlabs/conftest.py @@ -6,7 +6,7 @@ # pylint: disable=no-name-in-module import pytest -from pydantic import ByteSize, TypeAdapter +from pydantic.v1 import ByteSize, TypeAdapter def pytest_addoption(parser: pytest.Parser) -> None: diff --git a/tests/e2e-playwright/tests/jupyterlabs/test_jupyterlab.py b/tests/e2e-playwright/tests/jupyterlabs/test_jupyterlab.py index 6afc2bb1f13..4ccfadef1a8 100644 --- a/tests/e2e-playwright/tests/jupyterlabs/test_jupyterlab.py +++ b/tests/e2e-playwright/tests/jupyterlabs/test_jupyterlab.py @@ -14,7 +14,7 @@ from typing import Any, Final, Literal from playwright.sync_api import Page, WebSocket -from pydantic import ByteSize +from pydantic.v1 import ByteSize from pytest_simcore.helpers.logging_tools import log_context from pytest_simcore.helpers.playwright import MINUTE, SECOND, ServiceType diff --git a/tests/e2e-playwright/tests/resource_usage_tracker/test_resource_usage_tracker.py b/tests/e2e-playwright/tests/resource_usage_tracker/test_resource_usage_tracker.py index 76557dbfa46..9bac19e11a1 100644 --- a/tests/e2e-playwright/tests/resource_usage_tracker/test_resource_usage_tracker.py +++ b/tests/e2e-playwright/tests/resource_usage_tracker/test_resource_usage_tracker.py @@ -13,7 +13,7 @@ import pytest from playwright.sync_api import APIRequestContext -from pydantic import AnyUrl +from pydantic.v1 import AnyUrl from pytest_simcore.helpers.logging_tools import test_logger from tenacity import Retrying from tenacity.retry import retry_if_exception_type diff --git a/tests/e2e-playwright/tests/sim4life/conftest.py b/tests/e2e-playwright/tests/sim4life/conftest.py index 0f927d22f13..07e1c8955bf 100644 --- a/tests/e2e-playwright/tests/sim4life/conftest.py +++ b/tests/e2e-playwright/tests/sim4life/conftest.py @@ -6,7 +6,7 @@ # pylint: disable=no-name-in-module import pytest -from pydantic import TypeAdapter +from pydantic.v1 import TypeAdapter def pytest_addoption(parser: pytest.Parser) -> None: diff --git a/tests/performance/locust_files/locustfile.py b/tests/performance/locust_files/locustfile.py index ed67dcfb831..e7acef60f42 100644 --- a/tests/performance/locust_files/locustfile.py +++ b/tests/performance/locust_files/locustfile.py @@ -7,8 +7,8 @@ import faker from locust import HttpUser, between, task -from pydantic import Field -from pydantic_settings import BaseSettings +from pydantic.v1 import Field +from pydantic.v1_settings import BaseSettings logging.basicConfig(level=logging.INFO) diff --git a/tests/performance/locust_files/metamodeling/workflow.py b/tests/performance/locust_files/metamodeling/workflow.py index 8ab44e90dbe..b24bc57d9fe 100644 --- a/tests/performance/locust_files/metamodeling/workflow.py +++ b/tests/performance/locust_files/metamodeling/workflow.py @@ -5,8 +5,8 @@ from uuid import UUID from locust import HttpUser, task -from pydantic import Field -from pydantic_settings import BaseSettings +from pydantic.v1 import Field +from pydantic.v1_settings import BaseSettings from requests.auth import HTTPBasicAuth from tenacity import ( Retrying, diff --git a/tests/performance/locust_files/platform_ping_test.py b/tests/performance/locust_files/platform_ping_test.py index 61cb0733458..45238b3317f 100644 --- a/tests/performance/locust_files/platform_ping_test.py +++ b/tests/performance/locust_files/platform_ping_test.py @@ -7,8 +7,8 @@ import locust_plugins from locust import task from locust.contrib.fasthttp import FastHttpUser -from pydantic import Field -from pydantic_settings import BaseSettings +from pydantic.v1 import Field +from pydantic.v1_settings import BaseSettings logging.basicConfig(level=logging.INFO) diff --git a/tests/performance/locust_settings.py b/tests/performance/locust_settings.py index 24f896180fd..9a608b2a9ad 100644 --- a/tests/performance/locust_settings.py +++ b/tests/performance/locust_settings.py @@ -8,7 +8,7 @@ from typing import Final from parse import Result, parse -from pydantic import ( +from pydantic.v1 import ( AnyHttpUrl, Field, NonNegativeInt, @@ -18,7 +18,7 @@ field_serializer, field_validator, ) -from pydantic_settings import BaseSettings, SettingsConfigDict +from pydantic.v1_settings import BaseSettings, SettingsConfigDict _TEST_DIR: Final[Path] = Path(__file__).parent.resolve() _LOCUST_FILES_DIR: Final[Path] = _TEST_DIR / "locust_files" From 9d396145af9eebf176fbba8d63a0f33c9c4bf826 Mon Sep 17 00:00:00 2001 From: Giancarlo Romeo Date: Wed, 28 Aug 2024 22:19:06 +0200 Subject: [PATCH 2/2] revert changes in director service --- .../director/src/simcore_service_director/services_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/director/src/simcore_service_director/services_common.py b/services/director/src/simcore_service_director/services_common.py index cb4db0e378e..f1aef5ac668 100644 --- a/services/director/src/simcore_service_director/services_common.py +++ b/services/director/src/simcore_service_director/services_common.py @@ -3,7 +3,7 @@ # since this service is frozen and MUST NOT ADD ANY MORE DEPENDENCIES # # -from pydantic.v1 import BaseSettings, Field, PositiveInt +from pydantic import BaseSettings, Field, PositiveInt _BASE_TIMEOUT_FOR_STOPPING_SERVICES = 60 * 60