Commit Graph

1451 Commits

Author SHA1 Message Date
Samuel Colvin a7656fcd09 Support extracting attributes from the parent namespace (#4663)
* support extracting attributes from the parent namespace

* fix more tested test

* move parent_frame_namespace
2022-11-08 10:26:24 +00:00
Samuel Colvin 8d98c499df url parsing in pydantic-core (#4732)
* url parsing in pydantic-core

* fix tests

* fix mypy tests
2022-11-08 09:42:38 +00:00
Adrian Garcia Badaracco 9e1f2a6f7c feat: add strict to Field (#4713)
* feat: add strict to Field

* skip if not set

* Update pydantic/fields.py

* Move model into fixture
2022-11-07 16:40:19 +00:00
Samuel Colvin a57346ac49 Move to ruff for linting (#4709)
* WIP to move to ruff for linting

* add extend-select, fix string
2022-11-03 13:45:34 +00:00
Evorage 5cbfcba510 Trivial Markdown Fix (#4711) 2022-11-03 11:42:13 +00:00
Adrian Garcia Badaracco c381e5b73e replace U+2019 with U+0027 in docstrings (#4714) 2022-11-03 07:46:18 +00:00
Samuel Colvin 594effa279 Switching to pydantic_core (#4516)
* working on core schema generation

* adapting main.py

* getting tests to run

* fix tests

* disable pyright, fix mypy

* moving to class-based model generation

* working on validators

* change how models are created

* start fixing test_main.py

* fixing mypy

* SelfType

* recursive models working, more tests fixed

* fix tests on <3.10

* get docs build to pass

* starting to cleanup types.py

* starting works on custom types

* working on using annotated-types

* using annoated types for constraints

* lots of cleanup, fixing network tests

* network tests passing 🎉

* working on types

* working on types and cleanup

* fixing UUID type, restructing again

* more types and newer pydantic-core

* working on Iterable

* more test_types tests

* support newer pydantic-core, fixing more test_types.py

* working through more test_types.py

* test_types.py at last passing locally 🎉

* fixing more tests in test_types.py

* fix datetime_parse tests and linting

* get tests running again, rename to test_datetime.py

* renaming internal modules

* working through mypy errors

* fixing mypy

* refactoring _generate_schema.py

* test_main.py passing

* uprev deps

* fix conftest and linting?

* importing Annotated

* ltining

* import Annotated from typing_extensions

* fixing 3.7 compatibility

* fixing tests on 3.9

* fix linting

* fixing SecretField and 3.9 tests

* customising get_type_hints

* ignore warnings on 3.11

* spliting repr out of utils

* removing unused bits of _repr, fix tests for 3.7

* more cleanup, removing many type aliases

* clean up repr

* support namedtuples and typeddicts

* test is_union

* removing errors, uprev pydantic-core

* fix tests on 3.8

* fixing private attributes and model_post_init

* renaming and cleanup

* remove unnecessary PydanticMetadata inheritance

* fixing forward refs and mypy tests

* fix signatures, change how xfail works

* revert mypy tests to 3.7 syntax

* correct model title

* try to fix tests

* fixing ClassVar forward refs

* uprev pydantic-core, new error format

* add "force" argument to model_rebuild

* Apply suggestions from code review

Suggestions from @tiangolo and @hramezani 🙏

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>

* more suggestions from @tiangolo

* extra -> json_schema_extra on Field

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-02 12:01:17 +00:00
Mòrian 5dd9b4f5ca Add postgresql+psycopg as allowed scheme for PostgreDsn (#4689) (#4690) 2022-10-31 10:37:57 +00:00
Samuel Colvin f7ff485fd7 use released version of 3.11 (#4661) 2022-10-27 12:48:55 +00:00
Sviatoslav Sydorenko da7e6f89a7 Introduce a gate/check GHA job (#4615)
* Introduce a gate/check GHA job

This adds a GHA job that reliably determines if all the required
dependencies have succeeded or not.

It also allows to reduce the list of required branch protection CI
statuses to just one — `check`. This reduces the maintenance burden
by a lot and have been battle-tested across a small bunch of projects
in its action form and in-house implementations of other people.

It is now in use in aiohttp (and other aio-libs projects), CherryPy,
attrs, coveragepy, some of the Ansible repositories, pip-tools,
spaceship-prompt, all of the jaraco's projects (like `setuptools`,
`importlib_metadata`), some PyCQA, PyCA, PyPA and pytest projects, a
few AWS Labs projects.

The story behind this is explained in more detail at
https://github.com/marketplace/actions/alls-green#why.

* Stop allowing `test-old-mypy` to fail

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* Fix a typo in "commend"

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2022-10-20 07:55:05 +01:00
chaojie 02d4e18839 Docs add awesome-pydantic (#4616) 2022-10-17 16:02:17 +01:00
Rémy HUBSCHER 0a6e413866 Add missing typing to example (#4596)
* Add missing typing to example

* Update example typing.
2022-10-10 13:36:03 +02:00
Zach Kirsch a44d373f1f Fix "trough" typo in Model Config docs (#4593) 2022-10-07 09:15:47 +02:00
dependabot[bot] 12158b8943 build(deps): bump actions/checkout from 2 to 3 (#4579)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 09:10:24 +02:00
dependabot[bot] bb9b9a4c4b build(deps): bump carloscastrojumo/github-cherry-pick-action (#4580)
Bumps [carloscastrojumo/github-cherry-pick-action](https://github.com/carloscastrojumo/github-cherry-pick-action) from 1.0.1 to 1.0.3.
- [Release notes](https://github.com/carloscastrojumo/github-cherry-pick-action/releases)
- [Commits](https://github.com/carloscastrojumo/github-cherry-pick-action/compare/v1.0.1...v1.0.3)

---
updated-dependencies:
- dependency-name: carloscastrojumo/github-cherry-pick-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-07 09:09:23 +02:00
Samuel Colvin 1a5b56e1b2 lower coverage threshold during V2 development 2022-09-24 21:18:19 +01:00
Samuel Colvin 60cad30b2c Remove superfluous (???) files from sdist (#4542)
* remove superfluous files from sdist

* split TOML tables

* remove unnecessary stars

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>

* switch to "include" in preference to "exclude"

Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
2022-09-22 09:15:23 +00:00
Miloš Mandić c22fe9a8f3 v2 docs broken link fix (#4533)
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2022-09-21 21:40:07 +02:00
Samuel Colvin 80f016ecd6 add label when cherry-picking 2022-09-20 18:38:33 +01:00
Samuel Colvin 7d5ba748a4 tweak cherry-pick.yml action 2022-09-20 18:32:56 +01:00
Samuel Colvin e071a3e368 remove repeat newline in docs (again) (#4545) 2022-09-20 14:19:33 +00:00
Samuel Colvin c3e3fafae0 remove repeat newline in docs (#4544) 2022-09-20 14:01:22 +00:00
Samuel Colvin e4a0561dbc add github token to cherry-pick 2022-09-20 14:50:46 +01:00
Samuel Colvin e0b8e0530b tiny tweak to docs (#4543) 2022-09-20 14:48:59 +01:00
Samuel Colvin 2e834fecfb add cherry-pick action 2022-09-20 14:21:16 +01:00
Ofek Lev 523c62252a Restore PyPI landing page (#4520)
* Restore PyPI landing page

* address

* add license expression

* tweak fancy-pypi-readme setup

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-09-20 10:58:51 +00:00
Marcelo Trylesinski abd687700a Update mkdocs.yml (#4524) 2022-09-16 10:47:37 +02:00
Samuel Colvin eaa5eaafa1 fix license in pyproject.toml before it bites us 2022-09-15 16:34:23 +01:00
Dmitry Lavrentev 996101b8ba fix: missing file extension in model_config.md link (#4512) 2022-09-13 09:39:31 +02:00
Samuel Colvin ee52496101 Email tweaks (#988)
* small tweaks to email validation

* more test examples

* change and better error messages

* remove duplicate tests

* linting

* tweak from @hramezani
2022-09-08 15:46:58 +00:00
Samuel Colvin c475a67690 add hooky config to pyproject.toml 2022-09-08 16:34:03 +01:00
Hasan Ramezani 81b8cda305 Remove remaining parts of settings management (#4504) 2022-09-07 23:15:48 +02:00
Samuel Colvin 2df1ee69e9 use "field_specifiers", fix #4500 2022-09-07 15:48:55 +01:00
Samuel Colvin 85e4596958 Move settings to pydantic-settings (#4492)
* Move settings to pydantic-settings

* fix docs, remove dotenv

* fix coverage

* removing unused test fixture
2022-09-07 13:05:51 +01:00
Samuel Colvin f341049b9e Remove Cython & Move to pyproject.toml (#4473)
* 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
2022-09-06 17:15:51 +01:00
Samuel Colvin bc74342b39 prepare for v1.10.2 2022-09-05 17:35:13 +01:00
Eric Jolibois f1e9883157 fix: dataclass wrapper was not always called (#4484) 2022-09-05 17:32:29 +01:00
Sveinung Gundersen 91bb8d4482 Basic fix of GenericModel cache to detect order of args in Union models [#4474] (#4482) 2022-09-05 15:51:20 +01:00
Samuel Colvin eccd85e4d0 prevent long strings as int inputs (#4480)
* prevent long strings as int inputs, fix #1477

* fix tests 🤦

* fix length in change file
2022-09-05 12:35:08 +01:00
Samuel Colvin a4367c1c58 Revert percent encoding in URLs. (#4470)
* Revert "Fix `AnyUrl.build` doesn't do percent encoding (#3061) (#4224)"

This reverts commit e34ff9255f.

* change and warning
2022-09-05 11:02:43 +01:00
Samuel Colvin 02cf7f5d7b fix mypy with default_factory=list etc. (#4471)
* fix mypy with default_factory=list etc.

* fix tests

* add error case
2022-09-05 11:01:43 +01:00
Shantanu 5a2ddec9b2 Use tomllib on Python 3.11 (#4476)
* Use tomllib on Python 3.11

* changelog
2022-09-05 11:00:56 +01:00
dependabot[bot] 317bef33b0 build(deps): bump black from 22.6.0 to 22.8.0 (#4465)
Bumps [black](https://github.com/psf/black) from 22.6.0 to 22.8.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.6.0...22.8.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:49:25 +02:00
dependabot[bot] 2add8a9482 build(deps): bump hypothesis from 6.54.3 to 6.54.4 (#4464)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.54.3 to 6.54.4.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.54.3...hypothesis-python-6.54.4)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:49:06 +02:00
dependabot[bot] f1fb4f20b4 build(deps): bump mkdocs-material from 8.4.0 to 8.4.2 (#4463)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.4.0 to 8.4.2.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/8.4.0...8.4.2)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:48:47 +02:00
dependabot[bot] 85cd9ff5d1 build(deps): bump autoflake from 1.4 to 1.5.3 (#4462)
Bumps [autoflake](https://github.com/PyCQA/autoflake) from 1.4 to 1.5.3.
- [Release notes](https://github.com/PyCQA/autoflake/releases)
- [Commits](https://github.com/PyCQA/autoflake/compare/v1.4...v1.5.3)

---
updated-dependencies:
- dependency-name: autoflake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:48:25 +02:00
Samuel Colvin 32ea885345 prepare for v1.10.1 2022-08-31 10:57:25 +01:00
Grzegorz Bokota 3a2e83ce64 Add __hash__ operator to Color class (#4455)
* add __hash__ operator to Color

* add changes file

* fix code style

* add type annotation

* Update changes/4455-czaki.md

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2022-08-31 10:53:59 +01:00
Samuel Colvin 64f24726d1 v1.10 💥 (#4452) 2022-08-30 16:51:46 +01:00
Samuel Colvin b065908490 fix type hints in BaseSettings.Config (#4450)
* fix type hints in BaseSettings.Config

* add tests and change notice
2022-08-30 13:08:23 +01:00