dependabot[bot]
c4986ded1c
Bump markdown from 3.3 to 3.3.1 ( #2016 )
...
Bumps [markdown](https://github.com/Python-Markdown/markdown ) from 3.3 to 3.3.1.
- [Release notes](https://github.com/Python-Markdown/markdown/releases )
- [Commits](https://github.com/Python-Markdown/markdown/compare/3.3...3.3.1 )
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-25 12:16:28 +00:00
dependabot[bot]
893fb8b6a0
Bump mkdocs-material from 6.0.2 to 6.1.0 ( #2015 )
...
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material ) from 6.0.2 to 6.1.0.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases )
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/docs/changelog.md )
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/6.0.2...6.1.0 )
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-25 12:16:14 +00:00
Arseny Boykov
6b53cabe03
Add pickle support to dynamically created models and generics ( #1686 )
...
* Add pickle support to dynamically created models
* Add created model module check
* Use globals() to retrieve model
* Use single quotes
* use mocker instead of mock
Co-authored-by: PrettyWood <em.jolibois@gmail.com >
* remove unused import
* add test for dynamic forward ref
* move generic test to test_generics.py
* fix test_generic_model_pickle test, add additional check for <locals> in create_model
* fix code style
* resolve issues with global/local models
* make ensure_picklable return given model
* remove ensure_picklable, use test_is_call_from_module only in generics
* reformat code after updating black==20.8b1
* move get_caller_module_name and is_call_from_module to generics
* apply suggestions from @samuelcolvin
* add tests for get_caller_module and is_call_from_module called from module
* fix linting
* fix path to modules in test_module fixture, capture stderr and stdout
* fix broken test module
* fix subprocess call for windows
* enhance create_module fixture, add run_as_module fixture
this will allow run modules in subprocess and define module code in functions-containers
* add test for redefined concrete model without cache
* add changes file
* remove unused variable
* rewrite tests with pytest.raises
* fix linting
* rewrite test_create_model_pickle and test_forward_ref_with_create_model with module definition in function
* Update create_model docstring
Co-authored-by: PrettyWood <em.jolibois@gmail.com >
Co-authored-by: Samuel Colvin <s@muelcolvin.com >
2020-10-18 20:55:44 +01:00
PrettyWood
ab671a3670
feat(field): add Enum and IntEnum as valid types for fields ( #1737 )
...
* feat(field): add Enum type support
closes #1735
* test: add extra cases and rename to be more explicit
* refactor: rename enum_validator
* feat: add Enum and IntEnum types support
* docs: add new types
* chore: update change message
2020-10-18 20:53:29 +01:00
PrettyWood
794d0bccf9
feat: add basic support for python 3.9 ( #1844 )
...
* feat: use partially get_origin and get_args from typing
Rework of d86a184072655d93652d6ea941421005f34de962 by @hmvp
We cannot directly use `typing.get_origin` and `typing.get_args` for
our custom types for which args and origin are wrong by default.
But at least we now have a unified behaviour, which can be improved
in the near future
* feat: add fallback in `get_args` for generics in python 3.9
* feat: add new `_evaluate` for python 3.9
In python 3.9, `typing._evaluate` has a new required
positional argument `recursive_guard`
* chore: add pragma no cover for python 3.9 fallbacks
* chore: add change file
* chore: add comments
* feat(ci): add python 3.9 support
* fix: mypy assumption is wrong
2020-10-18 20:36:18 +01:00
dependabot[bot]
c8c895bbc5
Bump isort from 5.6.1 to 5.6.4 ( #2013 )
...
Bumps [isort](https://github.com/pycqa/isort ) from 5.6.1 to 5.6.4.
- [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.6.1...5.6.4 )
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-18 20:23:45 +01:00
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