Commit Graph

861 Commits

Author SHA1 Message Date
PrettyWood 3aacec4e17 feat(schema): support custom title, description and default for enums (#1749)
* refactor(schema): put schema data from fieldinfo in dedicated function

* feat(schema): support custom title, description and default for enums

closes #1748

* refactor: replace $ref by allOf + $ref to be supported by doc generation tools

* fix: do not set title by default for enums

* refactor: make code more explicit

* fix: run linter
2020-10-18 20:23:06 +01:00
PrettyWood 29e3877a44 chore(deps-dev): bump mypy from 0.782 to 0.790 (#1998)
* Bump mypy from 0.782 to 0.790

Bumps [mypy](https://github.com/python/mypy) from 0.782 to 0.790.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](https://github.com/python/mypy/compare/v0.782...v0.790)

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

* chore: remove mypy issues

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-18 19:59:22 +01:00
Samuel Colvin 8ccc5708f1 remove data.json, fix #1992 (#1994) 2020-10-11 19:34:37 +01:00
Louis Sautier e8326f899e Include tests in source distributions (#1976) 2020-10-09 14:32:27 +01:00
Hmvp c6a24f28c5 Fix const validator not running when class validators are present (#1957) 2020-10-09 13:26:11 +01:00
Davis Kirkendall 30ee8e2203 Force fields.Undefined to be a singleton objectIn various places of the code, we compare directly to fields.Undefinedsince we assume it to be constant.When new models get created however, the object is deepcopied andis no longer identical with the original object.We therefore add __copy__ and __deepcopy__ methods to ensurethat the copied objects are actually the same original object. (#1981) 2020-10-09 13:25:24 +01:00
Louis Sautier d2972362c5 test_config_file_settings_nornir: use less common env. var names (#1977)
Gentoo's Portage sets A during the test phase, switching to less common
environment variable names reduces the likelihood of something similar
happening.
2020-10-09 13:23:31 +01:00
Samuel Colvin fd3f2b0f55 fix linting 2020-10-09 13:14:53 +01:00
Jason Wu 130c9903d7 docs: fix typo (#1959) 2020-10-09 13:06:47 +01:00
Stefan Götz 9d4ba6d4b5 - fix typo in docs/index.md (#1921) 2020-10-09 12:52:08 +01:00
Gary Donovan 7d0df22690 Fix typo in docstring (#1866) 2020-10-09 12:11:59 +01:00
Brian Maissy a89c97a3e3 add a __call__ stub to PyObject for mypy (#1849)
Co-authored-by: Brian Maissy <brian@medigate.io>
2020-10-09 12:11:23 +01:00
Brian Maissy dbb1ed0aaa remove strict_optional from sample mypy.ini in doc (#1830)
Really not critical, but strict_optional=True is the default for mypy since 0.600, so its presence in the sample mypy.ini in the docs seems redundant.

https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-strict-optional
2020-10-09 11:28:42 +01:00
Geon Kim - KimMachineGun be8ef63a33 docs: Fix incorrect description of copy method (#1821)
* docs: Fix typo

* docs: Fix incorrect description of copy method

* changes: Add changes description file

* docs: Add space before parentheses

Co-authored-by: PrettyWood <em.jolibois@gmail.com>

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2020-10-09 11:28:04 +01:00
PrettyWood 75859a9d58 feat(tools): add parse_raw_as util (#1813)
closes #1812
2020-10-09 10:35:07 +01:00
dependabot[bot] 87aeab3672 Bump isort from 5.5.4 to 5.6.1 (#1980)
Bumps [isort](https://github.com/pycqa/isort) from 5.5.4 to 5.6.1.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/pycqa/isort/compare/5.5.4...5.6.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-09 10:32:16 +01:00
PrettyWood 76fdbe92be feat(dotenv): support home directory relative paths (e.g. ~/.env) (#1804)
closes #1803

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-10-09 10:23:28 +01:00
Samuel Colvin c5fc921620 combined uprev of dependencies (#1978) 2020-10-09 10:20:36 +01:00
dependabot[bot] 078e7090d0 Bump pytest from 6.0.1 to 6.1.1 (#1965)
* Bump pytest from 6.0.1 to 6.1.1

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.1 to 6.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.0.1...6.1.1)

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

* add pytest-mock to binaries build

* unchange build step of ci

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-10-09 10:20:08 +01:00
Matthew Davis 094da94da9 clarify argument type to parse_file (#1795)
Co-authored-by: Matthew Davis <Matthew.Davis.2@team.telstra.com>
2020-10-08 21:10:09 +01:00
Selim Belhaouane b99c37e3d0 Fix #1770 (#1771) 2020-10-08 21:07:22 +01:00
PrettyWood 55e78cc106 fix(schema): add basic support of Pattern type in schema generation (#1768)
closes #1767
2020-10-08 20:42:14 +01:00
PrettyWood a2fc01a59b fix: forward ref with nested models and optional fields (#1752)
* fix: forward ref with nested models and optional fields

PR #1712 introduced a regression for forward refs in `ModelField.prepare`
as it would not return early for forward refs anymore.
Optional fields would hence have `required` set to `True`.

closes #1736

* test: skip python 3.6 as __future__.annotations is not defined
2020-10-08 20:26:30 +01:00
Arseny Boykov d5e9d9abc8 add smart_deepcopy (originaly from #1679) (#1920)
* add smart_deepcopy

* uncomment tuple in BUILTIN_COLLECTIONS, fix doc a bit

* Fix grammar

Co-authored-by: PrettyWood <em.jolibois@gmail.com>

* replace map() usage with generator comprehension, fix comment

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2020-10-08 19:50:54 +01:00
dependabot[bot] bf9cc4a5e7 Bump black from 19.10b0 to 20.8b1 (#1909)
* Bump black from 19.10b0 to 20.8b1

Bumps [black](https://github.com/psf/black) from 19.10b0 to 20.8b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

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

* fix: run `make format`

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2020-09-10 00:53:24 +02:00
Samuel Colvin 9c4860ce96 Valdiate arguments config (#1663)
* add `configs` to validate_arguments

* simplify `validate_arguments` and add annotation for parameter `configs`

* change double quotes to single quotes

* reformat code

* fix mypy error

* fix mypy 'maximum semantic analysis' error

* rename 'configs' > 'config_params'

* change name and usage, start tests

* prevent setting fields on custom config

* add docs and fix mypy

* tweak docs

* add change

Co-authored-by: quantpy <quantpy@qq.com>
2020-09-06 23:17:52 +01:00
Samuel Colvin ddc7697072 more draconian issue templates 2020-09-06 18:36:13 +01:00
Yury Paykov 0a465b6216 Fix #1561 - apply Config env names for fields defined in the parent c… (#1585)
* Fix #1561 - apply Config env names for fields defined in the parent class

* Changes

* Fix lint

* Fix typing

* More tests
2020-09-06 16:51:38 +01:00
Samuel Colvin 296d929904 updating all deps (#1907)
* updating all deps

* uprev github actions docs
2020-09-06 13:04:41 +01:00
Samuel Colvin 6125a29ba3 fix dependabot 2020-09-06 12:31:41 +01:00
dependabot[bot] 44616e35cb Bump isort from 5.1.1 to 5.1.4 (#1742)
Bumps [isort](https://github.com/timothycrosley/isort) from 5.1.1 to 5.1.4.
- [Release notes](https://github.com/timothycrosley/isort/releases)
- [Changelog](https://github.com/timothycrosley/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/timothycrosley/isort/compare/5.1.1...5.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-21 10:07:24 +01:00
dependabot[bot] e985857e5a Bump isort from 4.3.21 to 5.1.1 (#1730)
* Bump isort from 4.3.21 to 5.1.1

Bumps [isort](https://github.com/timothycrosley/isort) from 4.3.21 to 5.1.1.
- [Release notes](https://github.com/timothycrosley/isort/releases)
- [Changelog](https://github.com/timothycrosley/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/timothycrosley/isort/compare/4.3.21...5.1.1)

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

* isort 5 compatibility

* fix known_standard_library and apply isort changes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-07-16 10:28:44 +01:00
Samuel Colvin d2b050176e uprev 2020-07-15 20:24:20 +01:00
PrettyWood e2fcab52b9 fix: validate and parse nested models properly with default_factory (#1712)
* fix: validate nested models with `default_factory`

PR #1504 introduced a regression by bypassing `populate_validators()`,
which would skip the validation of children in nested models
with `default_factory`

closes #1710

* test: add example of nested models parsing with `default_factory`

closes #1717

* add testcase from #1722

* bodge for benchmarks

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-07-15 20:23:18 +01:00
dependabot[bot] ba56a6746b Bump pytest-mock from 3.1.1 to 3.2.0 (#1719)
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.1.1...v3.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-15 20:10:14 +01:00
Jordan Côté f1f944fbc1 Update datamode_code_generator:typo in pip install (#1713)
As seen in https://koxudaxi.github.io/datamodel-code-generator, the correct command is 
`pip install datamodel-code-generator`
not
`pip install datamodel-code-generato`
2020-07-13 18:33:48 +01:00
Samuel Colvin 5dbb1272f6 use codecov github action to do retries (#1709) 2020-07-11 13:00:53 +01:00
Samuel Colvin 2440ab931e uprev and changes 2020-07-11 11:45:15 +01:00
Spiros Dontas 1f4ecd0785 Fix nested all include exclude (#1588)
* Fix nested all include exclude

* Ensure original exclude value is not modified

This commit also fixes some weird cases in the recursive
`update_normalized_all` call and Ellipsis values.

* Add docstring, parametrize tests
2020-07-11 11:28:53 +01:00
Samuel Colvin 853a6bbb76 fix coverage for 'conset()' (#1704) 2020-07-11 11:24:24 +01:00
Lordran 527c35a856 remove duplicate "an" (#1708) 2020-07-11 11:23:29 +01:00
Samuel Colvin f977709d43 add dependabot.yml (#1705) 2020-07-10 13:04:29 +01:00
dependabot-preview[bot] 3c0eafdea4 Bump python-dotenv from 0.13.0 to 0.14.0 (#1688)
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.13.0...v0.14.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-10 10:40:52 +01:00
dependabot-preview[bot] 5ccf3ec8d1 Bump pytest-sugar from 0.9.3 to 0.9.4 (#1690)
Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/Teemu/pytest-sugar/releases)
- [Changelog](https://github.com/Teemu/pytest-sugar/blob/master/CHANGES.rst)
- [Commits](https://github.com/Teemu/pytest-sugar/commits)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-10 10:40:35 +01:00
dependabot-preview[bot] 90faeab523 Bump coverage from 5.1 to 5.2 (#1692)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.1 to 5.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.1...coverage-5.2)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-10 10:40:21 +01:00
dependabot-preview[bot] bcb69d83cc Bump cython from 0.29.20 to 0.29.21 (#1697)
Bumps [cython](https://github.com/cython/cython) from 0.29.20 to 0.29.21.
- [Release notes](https://github.com/cython/cython/releases)
- [Changelog](https://github.com/cython/cython/blob/master/CHANGES.rst)
- [Commits](https://github.com/cython/cython/compare/0.29.20...0.29.21)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-07-09 17:44:38 +01:00
Samuel Colvin 03d9aa5f4b windows CI wrongly passing (#1700)
* break try_assert.py

* break linting

* split steps to fix windows issue

* fix try_assert.py break pytest main tests

* fix pytest tests

* undo make change
2020-07-09 15:03:38 +01:00
Samuel Colvin a913c37560 Fix master (#1682)
* Fix master

* Fix master 2 (#1694)

* test: add regression test with wrong type default

* fix: remove always on conlist and conset

* fix: use utf8 as default encoding on all OS

* conset invalid defualt test

* add change

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2020-07-09 14:26:27 +01:00
flapili dac6764575 Url port check (#1678)
* add url port check

* add change

* Update pydantic/networks.py

fix typo

Co-authored-by: PrettyWood <em.jolibois@gmail.com>

* Update 1654-flapili.md

* Update 1654-flapili.md

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2020-07-03 20:56:36 +01:00
Patrick Wang dca98559d5 Add conset (#1627)
* Add conset

* Add changes doc

* Fix too-long lines

* bump

* Update conset change doc formatting

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

* Robustify test_conset

* Move conlist and conset tests to test_types

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2020-07-03 20:51:23 +01:00