* Remove Cython
* fix CI
* fix coverage
* fix tests
* switching to pypyroject.toml
* pre-commit all and use pre-commit for linting
* no mypy tests on macos and windows on ci, use flake8-pyproject
* fix docs and tests CI
* check build is working
* drop pytest-cov
* window and macos ci with 3.11, reduce filtering
* use pip-tools to pin all dependencies
* fix docs and fastapi tests
* fix test deps for 3.7
* no cache on tests job
* revert fastapi changes, fix coverage
* fix mypy coverage
* test with older mypy
* dotenv not required for mypy tests
* split testing requirements std and extra
* typo
* @PrettyWood comments
* correct branch name
* mypy python_version and pr template
* Generate docs exampels for Python 3.10 and above
Code quality is not great and main intent here is to show the result.
* Fix docs build on 3.9
* Build docs on 3.10
* What's Python 3.1?
* Create temp dir if not exists
* Refactor and improve imlementetion
* Keep runtime typing in examples
* Revert unrelated formatting changes
* Add changes file
* Allow specifying requirements in examples
* Pin autoflake and pyupgrade
* Add docs/build to Makefile lint/format/mypy
* ignore_missing_imports for ansi2html and devtools
* Add .tmp-projections to .gitignore
* Remove dont-upgrade now when Pattern is supported
* Update postponed evaluation examples
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* 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
* fix: `Config.copy_on_model_validation` does a deep copy and not a shallow one
closes#3641
* fix: typo
* use python 3.10 to run fastapi tests
* fix fastapi test call
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* refactor: rename `is_union` into `is_union_origin`
* fix: "new" union and generic types are not the same as `typing.GenericAlias`
* chore: rename param
* fix(ci): name changed for 3.10
* fix: mypy
* chore(ci): update python 3.10 version
* Revert "fix: enum repr is different with 3.10+"
This reverts commit b1c8d9ef1396959ff9d88bb2ed16d99dd3146151.
* refactor: extra `BaseConfig` and `Extra` in dedicated `config` module
* refactor: clean useless `#noqa: F401`
* refactor: clean useless `#noqa: F811`
* refactor: replace enum check
Error with 3.10
> DeprecationWarning: accessing one member from another is not supported
* refactor: avoid using `distutils` directly
error with python 3.10
> DeprecationWarning: The distutils package is deprecated and slated
> for removal in Python 3.12.
> Use setuptools or check PEP 632 for potential alternatives
* fix: `__annotations__` always exists
* fix: origin of `typing.Hashable` is not `None`
* ci: add run with 3.10.0b2
* docs: add 3.10
* feat: support `|` union operator properly
`|` operator has origin `types.Union` (and not `typing.Union`)
* fix: enum repr is different with 3.10+
* fix: error message changed a bit
change from basic `__init__` to `test_hashable_required.<locals>.MyDataclass.__init__()` (with `__qualname__`)
* fix: always exists and is not inherited anymore
* fix: avoid calling `asyncio.get_event_loop` directly
With python 3.10, calling it results in
> DeprecationWarning: There is no current event loop
* fix(ci): do not run 3.10 on linux for now
For now it can not be compiled.
Let's just skip the check on linux for now instead of tuning the CI pipeline
* fix(ci): ignore DeprecationWarning raised by `mypy` on windows
* docs: add change file