From 76ebdb915d16d7a93bda050f7ff56212ddfefa80 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Wed, 15 Apr 2020 16:40:21 +0100 Subject: [PATCH] combined uprev of packages (#1395) * combined uprev of packages * unused f-strings * scroll-spy on docs --- docs/extra/{ad.css => tweaks.css} | 11 +++++++++++ docs/requirements.txt | 2 +- mkdocs.yml | 2 +- pydantic/generics.py | 2 +- pydantic/main.py | 6 +++--- pydantic/utils.py | 4 ++-- tests/requirements.txt | 8 ++++---- tests/test_generics.py | 2 +- tests/test_types.py | 2 +- tests/try_assert.py | 2 +- 10 files changed, 26 insertions(+), 15 deletions(-) rename docs/extra/{ad.css => tweaks.css} (67%) diff --git a/docs/extra/ad.css b/docs/extra/tweaks.css similarity index 67% rename from docs/extra/ad.css rename to docs/extra/tweaks.css index fe37a41..53e4dae 100644 --- a/docs/extra/ad.css +++ b/docs/extra/tweaks.css @@ -3,14 +3,25 @@ padding: 0.525rem 0.6rem; min-height: 80px; } + @media screen and (max-width: 799px) { #bsa-cpc { display: none; } } + #bsa-cpc.loaded { background: hsla(0, 0%, 92.5%, 0.5); } + #_default_ a._default_, #_default_ .default-text { width: 100% !important; } + +.md-nav__link[data-md-state=blur]:not(.md-nav__link--active) { + color: rgba(0, 0, 0, 0.87); +} + +.md-nav__link--active { + font-weight: 700; +} diff --git a/docs/requirements.txt b/docs/requirements.txt index 6658ff5..89383a2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,7 +2,7 @@ ansi2html==1.5.2 mkdocs==1.1.0 markdown==3.2.1 mkdocs-exclude==1.0.2 -mkdocs-material==4.6.3 +mkdocs-material==5.1 markdown-include==0.5.1 pygments==2.6.1 sqlalchemy # pyup: ignore diff --git a/mkdocs.yml b/mkdocs.yml index 5bec020..bb7392a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,7 +20,7 @@ google_analytics: extra_css: - 'extra/terminal.css' -- 'extra/ad.css' +- 'extra/tweaks.css' extra_javascript: - 'extra/redirects.js' - 'extra/ad.js' diff --git a/pydantic/generics.py b/pydantic/generics.py index 0ff2f05..b8d6ea6 100644 --- a/pydantic/generics.py +++ b/pydantic/generics.py @@ -30,7 +30,7 @@ class GenericModel(BaseModel): if not isinstance(params, tuple): params = (params,) if cls is GenericModel and any(isinstance(param, TypeVar) for param in params): # type: ignore - raise TypeError(f'Type parameters should be placed on typing.Generic, not GenericModel') + raise TypeError('Type parameters should be placed on typing.Generic, not GenericModel') if not hasattr(cls, '__parameters__'): raise TypeError(f'Type {cls.__name__} must inherit from typing.Generic before being parameterized') diff --git a/pydantic/main.py b/pydantic/main.py index 29d9895..6427e6a 100644 --- a/pydantic/main.py +++ b/pydantic/main.py @@ -791,9 +791,9 @@ def create_model( f_annotation, f_value = f_def except ValueError as e: raise ConfigError( - f'field definitions should either be a tuple of (, ) or just a ' - f'default value, unfortunately this means tuples as ' - f'default values are not allowed' + 'field definitions should either be a tuple of (, ) or just a ' + 'default value, unfortunately this means tuples as ' + 'default values are not allowed' ) from e else: f_annotation, f_value = None, f_def diff --git a/pydantic/utils.py b/pydantic/utils.py index 5b988d6..8249a95 100644 --- a/pydantic/utils.py +++ b/pydantic/utils.py @@ -349,8 +349,8 @@ class ValueItems(Representation): items = self._normalize_indexes(items, len(value)) except TypeError as e: raise TypeError( - f'Excluding fields from a sequence of sub-models or dicts must be performed index-wise: ' - f'expected integer keys or keyword "__all__"' + 'Excluding fields from a sequence of sub-models or dicts must be performed index-wise: ' + 'expected integer keys or keyword "__all__"' ) from e self._items = items diff --git a/tests/requirements.txt b/tests/requirements.txt index ca51a1a..7471728 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,14 +1,14 @@ black==19.10b0 -coverage==5.0.4 -Cython==0.29.15;sys_platform!='win32' +coverage==5.1 +Cython==0.29.16;sys_platform!='win32' flake8==3.7.9 -flake8-quotes==2.1.1 +flake8-quotes==3 isort==4.3.21 mypy==0.770 pycodestyle==2.5.0 pyflakes==2.1.1 pytest==5.3.5 pytest-cov==2.8.1 -pytest-mock==2.0.0 +pytest-mock==3 pytest-sugar==0.9.2 twine==3.1.1 diff --git a/tests/test_generics.py b/tests/test_generics.py index 2680b5a..b1821e7 100644 --- a/tests/test_generics.py +++ b/tests/test_generics.py @@ -170,7 +170,7 @@ def test_must_inherit_from_generic(): Result[int] - assert str(exc_info.value) == f'Type Result must inherit from typing.Generic before being parameterized' + assert str(exc_info.value) == 'Type Result must inherit from typing.Generic before being parameterized' @skip_36 diff --git a/tests/test_types.py b/tests/test_types.py index 51750dc..f20b94a 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -1849,7 +1849,7 @@ def test_pattern_error(): pattern: Pattern with pytest.raises(ValidationError) as exc_info: - Foobar(pattern=f'[xx') + Foobar(pattern='[xx') assert exc_info.value.errors() == [ {'loc': ('pattern',), 'msg': 'Invalid regular expression', 'type': 'value_error.regex_pattern'} ] diff --git a/tests/try_assert.py b/tests/try_assert.py index efb26d1..b29eac0 100644 --- a/tests/try_assert.py +++ b/tests/try_assert.py @@ -16,7 +16,7 @@ def test_assert_raises_validation_error(): return v Model(a='a') - expected_errors = [{'loc': ('a',), 'msg': f'invalid a', 'type': 'assertion_error'}] + expected_errors = [{'loc': ('a',), 'msg': 'invalid a', 'type': 'assertion_error'}] try: Model(a='snap')