Skip to content

TypeError: tuple object expected; got list site-packages/pydantic/env_settings.py:23 #19907

@ra-coder

Description

@ra-coder

Crash Report

requirements-dev.txt
requirements.txt

#29 [codequality_and_tests_stage 10/14] RUN mypy /src/ --show-traceback
#29 19.08 /usr/local/lib/python3.12/site-packages/pydantic/env_settings.py:23: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
#29 19.08 https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
#29 19.08 Please report a bug at https://github.com/python/mypy/issues
#29 19.08 version: 1.18.2
#29 19.08 Traceback (most recent call last):
#29 19.08 File "mypy/semanal.py", line 7350, in accept
#29 19.08 File "mypy/nodes.py", line 1440, in accept
#29 19.08 File "mypy/semanal.py", line 1775, in visit_class_def
#29 19.08 File "mypy/semanal.py", line 1991, in analyze_class
#29 19.08 File "mypy/semanal.py", line 2038, in analyze_class_body_common
#29 19.08 File "mypy/semanal.py", line 2123, in apply_class_plugin_hooks
#29 19.08 File "pydantic/mypy.py", line 156, in pydantic.mypy.PydanticPlugin._pydantic_model_class_maker_callback
#29 19.08 File "pydantic/mypy.py", line 319, in pydantic.mypy.PydanticModelTransformer.transform
#29 19.08 File "pydantic/mypy.py", line 529, in pydantic.mypy.PydanticModelTransformer.add_construct_method
#29 19.08 File "pydantic/mypy.py", line 868, in pydantic.mypy.add_method
#29 19.08 TypeError: tuple object expected; got list
#29 19.08 /usr/local/lib/python3.12/site-packages/pydantic/env_settings.py:23: : note: use --pdb to drop into pdb
#29 ERROR: process "/bin/sh -c mypy /src/ --show-traceback" did not complete successfully: exit code: 2

[codequality_and_tests_stage 10/14] RUN mypy /src/ --show-traceback:
19.08 File "mypy/semanal.py", line 1775, in visit_class_def
19.08 File "mypy/semanal.py", line 1991, in analyze_class
19.08 File "mypy/semanal.py", line 2038, in analyze_class_body_common
19.08 File "mypy/semanal.py", line 2123, in apply_class_plugin_hooks
19.08 File "pydantic/mypy.py", line 156, in pydantic.mypy.PydanticPlugin._pydantic_model_class_maker_callback
19.08 File "pydantic/mypy.py", line 319, in pydantic.mypy.PydanticModelTransformer.transform
19.08 File "pydantic/mypy.py", line 529, in pydantic.mypy.PydanticModelTransformer.add_construct_method
19.08 File "pydantic/mypy.py", line 868, in pydantic.mypy.add_method
19.08 TypeError: tuple object expected; got list
19.08 /usr/local/lib/python3.12/site-packages/pydantic/env_settings.py:23: : note: use --pdb to drop into pdb


Dockerfile:61

Traceback

(Insert traceback and other messages from mypy here -- use `--show-traceback`.)

To Reproduce

(Write what you did to reproduce the crash. Full source code is
appreciated. We also very much appreciate it if you try to narrow the
source down to a small stand-alone example.)

# Ideally, a small sample program that demonstrates the problem.
# Or even better, a reproducible playground link https://mypy-play.net/ (use the "Gist" button)

Your Environment

  • Mypy version used:

mypy==1.17.1

  • Mypy command-line flags:

  • Mypy configuration options from mypy.ini (and other config files):

[mypy]
check_untyped_defs = True
enable_error_code = explicit-override,unused-awaitable,ignore-without-code,truthy-bool,possibly-undefined,redundant-expr,redundant-self
plugins = sqlalchemy.ext.mypy.plugin,pydantic.mypy
pretty = True
show_error_context = True
strict = True
untyped_calls_exclude = sqlalchemy.dialects.postgresql.array,sqlalchemy.sql.functions
warn_unreachable = True

[mypy-asyncpg]
ignore_missing_imports = True

[mypy-aiobotocore.*]
ignore_missing_imports = True

[mypy-pgpy]
ignore_missing_imports = True

[mypy-sky_calendar.*]
disallow_any_generics = False
warn_return_any = False
ignore_missing_imports = True
ignore_errors = True

[mypy-aiokafka.*]
ignore_missing_imports = True

[mypy-initial_cost_utils.*]
ignore_errors = True

[mypy-curlify2]
ignore_errors = True
ignore_missing_imports = True

[mypy-business_files.*]
ignore_errors = True

[mypy-my_errors.*]
ignore_errors = True

[mypy-my_utils.*]
ignore_errors = True

[mypy-mysky_orm.*]
ignore_errors = True
ignore_missing_imports = True

[mypy-myocean_core.*]
ignore_errors = True
ignore_missing_imports = True

[mypy-filesystem.*]
disable_error_code = arg-type,call-arg

[mypy-sqlalchemy_extension.*]
disable_error_code = type-arg

[mypy-mysky_fms_util.*]
ignore_errors = True

[mypy-sky_auto_matcher]
ignore_errors = True
ignore_missing_imports = True

[mypy-sky_margins.*]
ignore_errors = True

[mypy-rfc3986]
ignore_missing_imports = True

[mypy-boto3]
ignore_missing_imports = True

[mypy-botocore]
ignore_missing_imports = True

[mypy-fastapi_extension.*]
disallow_any_generics = False
warn_return_any = False

[mypy-graypy]
ignore_errors = True
ignore_missing_imports = True

[mypy-sky_integrations_fuel.*]
ignore_errors = True
ignore_missing_imports = True

[mypy-async_asgi_testclient]
ignore_missing_imports = True

[mypy-flydenity]
ignore_missing_imports = True

[mypy-xecd_rates_client]
ignore_missing_imports = True

  • Python version used:
    Dockerfile

FROM python:3.12-slim

  • Operating system and version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashpendingIssues that may be closedtopic-pluginsThe plugin API and ideas for new plugins

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions