diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 096a9345..4bcab6df 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -15,12 +15,12 @@ jobs: strategy: matrix: py: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - - "pypy-3.8" + - "3.12" + - "pypy-3.10" os: - "ubuntu-latest" - "windows-latest" @@ -72,7 +72,7 @@ jobs: - name: Setup python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.11 architecture: x64 - name: Install requirements run: | diff --git a/deform/field.py b/deform/field.py index 750ab635..c039e1bf 100644 --- a/deform/field.py +++ b/deform/field.py @@ -235,7 +235,7 @@ def __init__( focus == "on" and not focused and type(child.typ) in Field.focusable_input_types - and type(child.widget) != Field.hidden_type + and type(child.widget) is not Field.hidden_type and not self.have_first_input ): first_input_index = child_count @@ -331,7 +331,6 @@ def set_default_renderer(cls, renderer): @classmethod def set_default_resource_registry(cls, registry): - """Set the callable that will act as a default :term:`resource registry` for instances of the associated class when no ``resource_registry`` argument is provided to @@ -407,7 +406,7 @@ def widget(self): self.schema.typ.__class__ ) if widget_maker is None: - for (cls, wgt) in schema.default_widget_makers.items(): + for cls, wgt in schema.default_widget_makers.items(): if isinstance(self.schema.typ, cls): widget_maker = wgt break diff --git a/deform/tests/test_widget.py b/deform/tests/test_widget.py index 69c8ae4b..9e62236f 100644 --- a/deform/tests/test_widget.py +++ b/deform/tests/test_widget.py @@ -1066,7 +1066,7 @@ def choices_generator(): widget = self._makeOne(values=choices) with self.assertRaises(TypeError) as e: widget.serialize(field, None) - self.assertTrue(type(e.exception) == TypeError) + self.assertEqual(type(e.exception), TypeError) self.assertEqual( e.exception.args[0], "Values must be a sequence type (list, tuple, or range).", @@ -1195,7 +1195,7 @@ def choices_generator(): widget = self._makeOne(values=choices) with self.assertRaises(TypeError) as e: widget.serialize(field, None) - self.assertTrue(type(e.exception) == TypeError) + self.assertEqual(type(e.exception), TypeError) self.assertEqual( e.exception.args[0], "Values must be a sequence type (list, tuple, or range).", diff --git a/setup.py b/setup.py index 7787b033..bbb4ec48 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ def readfile(name): "flake8-bugbear", "flake8-builtins", "isort", + "rstcheck", "readme_renderer", ] diff --git a/tox.ini b/tox.ini index 7b790342..238ea1ea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = lint,docs, - py37,py38,py39,py310,py311,pypy3, + py38,py39,py310,py311,py312,pypy3, py311cover,coverage, functional3 @@ -26,7 +26,9 @@ commands = flake8 deform setup.py isort --check-only --df deform setup.py black --check --diff deform setup.py - python setup.py check -r -s -m + # XXX -r reports now warnings too so we fail + python setup.py check -s -m + rstcheck README.rst CHANGES.txt check-manifest extras = lint