mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
6d0aa20aa6
* ci: add python 3.11.0b4
* ignore both deprecation warnings
* handle specific tuple[()] case
`tuple` and `typing.Tuple` are now the same.
But `get_args(tuple[()]) == get_args(tuple) == ()`
even though `get_args(tuple[()]).__args__ = ()` and `tuple.__args__` is not defined.
* Handle type properly
Since `type` and `Type` are now the same, it triggers `_generic_get_args`
in our custom `get_args`
```py
if hasattr(tp, '_nparams'):
return (Any,) * tp._nparams
```
So we have `class_ is Any` for generic `type` type
* Handle enum in schemas
Enums have now a (huge) doc generated by inspect.getdoc.
It's very verbose and doesn't add anything.
I reckon it's best to keep the old generic description unless
a specific doc is provided (a test exists for this)
* add test that fails with python 3.9+
* fix test for python 3.11
* fix cython
85 lines
2.1 KiB
INI
85 lines
2.1 KiB
INI
[tool:pytest]
|
|
testpaths = tests
|
|
addopts = -p no:hypothesispytest
|
|
filterwarnings =
|
|
error
|
|
ignore::DeprecationWarning:distutils
|
|
ignore::DeprecationWarning:Cython
|
|
# for Python 3.10+: mypy still relies on distutils on windows. We hence ignore those warnings
|
|
ignore:The distutils package is deprecated and slated for removal in Python 3.12:DeprecationWarning
|
|
ignore:The distutils.sysconfig module is deprecated, use sysconfig instead:DeprecationWarning
|
|
# for Python 3.11
|
|
ignore:path is deprecated.*:DeprecationWarning:certifi
|
|
ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources
|
|
|
|
[flake8]
|
|
max-line-length = 120
|
|
max-complexity = 14
|
|
inline-quotes = single
|
|
multiline-quotes = double
|
|
ignore = E203, W503
|
|
per-file-ignores =
|
|
docs/examples/schema_unenforced_constraints.py: F811
|
|
docs/examples/validation_decorator_async.py: E402
|
|
docs/examples/types_constrained.py: F722
|
|
|
|
[coverage:run]
|
|
source = pydantic
|
|
branch = True
|
|
context = ${CONTEXT}
|
|
|
|
[coverage:report]
|
|
precision = 2
|
|
exclude_lines =
|
|
pragma: no cover
|
|
raise NotImplementedError
|
|
raise NotImplemented
|
|
if TYPE_CHECKING:
|
|
@overload
|
|
|
|
[coverage:paths]
|
|
source =
|
|
pydantic/
|
|
/Users/runner/work/pydantic/pydantic/pydantic/
|
|
D:\a\pydantic\pydantic\pydantic
|
|
|
|
[isort]
|
|
line_length=120
|
|
known_first_party=pydantic
|
|
multi_line_output=3
|
|
include_trailing_comma=True
|
|
force_grid_wrap=0
|
|
combine_as_imports=True
|
|
|
|
[mypy]
|
|
python_version = 3.9
|
|
show_error_codes = True
|
|
follow_imports = silent
|
|
strict_optional = True
|
|
warn_redundant_casts = True
|
|
warn_unused_ignores = True
|
|
disallow_any_generics = True
|
|
check_untyped_defs = True
|
|
no_implicit_reexport = True
|
|
warn_unused_configs = True
|
|
disallow_subclassing_any = True
|
|
disallow_incomplete_defs = True
|
|
disallow_untyped_decorators = True
|
|
disallow_untyped_calls = True
|
|
|
|
# for strict mypy: (this is the tricky one :-))
|
|
disallow_untyped_defs = True
|
|
|
|
# remaining arguments from `mypy --strict` which cause errors
|
|
;no_implicit_optional = True
|
|
;warn_return_any = True
|
|
|
|
[mypy-email_validator]
|
|
ignore_missing_imports = true
|
|
|
|
[mypy-dotenv]
|
|
ignore_missing_imports = true
|
|
|
|
[mypy-toml]
|
|
ignore_missing_imports = true
|