From 492cac1e6a1c160dd782b9764d51b327523d69b5 Mon Sep 17 00:00:00 2001 From: gram Date: Fri, 18 Aug 2023 11:21:42 +0200 Subject: [PATCH 1/4] fix type errors, lock typeguard --- pyproject.toml | 38 ++++++++++++++++---------------------- tests/test_schemes.py | 6 ++++-- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 200f4b1e..d1f3daeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ description-file = "README.md" requires-python = ">=3.7" keywords = "deal,contracts,pre,post,invariant,decorators,validation,pythonic,functional" requires = [] -classifiers=[ +classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", "Intended Audience :: Developers", @@ -25,19 +25,19 @@ classifiers=[ [tool.flit.metadata.requires-extra] all = [ - "astroid>=2.11.0", - "deal-solver", - "hypothesis", - "pygments", - "typeguard>=3.0.0", - "vaa>=0.2.1", + "astroid>=2.11.0", # for tyupe inference in linter + "deal-solver", # for formal verification + "hypothesis", # for test generation + "pygments", # for syntax highlighting in exceptions + "typeguard>=3.0.0", # for runtime type checking in tests + "vaa>=0.2.1", # for supporting schemes (like marshmallow) as validators ] -integration = [ # integration tests +integration = [ # integration tests "astroid>=2.11.0", "deal-solver", "hypothesis", "pygments", - "typeguard", + "typeguard<4.0.0", "vaa>=0.2.1", "sphinx>=4.5.0", "flake8", @@ -64,12 +64,12 @@ lint = [ "deal-solver", "hypothesis", "pygments", - "typeguard", + "typeguard<4.0.0", ] docs = [ - "m2r2", - "myst-parser", - "sphinx==3.5.*", + "m2r2", # markdown support in docstrings for sphinx + "myst-parser", # markdown support for dcs in sphinx + "sphinx==3.5.*", # documentation "sphinx-rtd-theme==0.5.*", ] @@ -87,13 +87,8 @@ addopts = [ [tool.coverage.run] branch = true -omit = [ - "deal/linter/_template.py", - "deal/mypy.py", -] -plugins = [ - "coverage_conditional_plugin", -] +omit = ["deal/linter/_template.py", "deal/mypy.py"] +plugins = ["coverage_conditional_plugin"] [tool.coverage.report] exclude_lines = [ @@ -111,7 +106,7 @@ has-astroid = "not is_installed('astroid')" [tool.mypy] files = ["deal"] -python_version = 3.7 +python_version = 3.8 plugins = ["deal.mypy"] ignore_missing_imports = true show_error_codes = true @@ -136,4 +131,3 @@ lines_after_imports = 2 skip = ".venvs/" multi_line_output = 5 include_trailing_comma = true - diff --git a/tests/test_schemes.py b/tests/test_schemes.py index 871eb38c..af3c46e8 100644 --- a/tests/test_schemes.py +++ b/tests/test_schemes.py @@ -10,8 +10,10 @@ except ImportError: vaa = None -MarshMallowScheme = None -if vaa is not None: +MarshMallowScheme: object | None +if vaa is None: + MarshMallowScheme = None +else: import marshmallow @vaa.marshmallow From 7f0f977c780d0aa4d48f385fbcdfe8b32c897152 Mon Sep 17 00:00:00 2001 From: gram Date: Fri, 18 Aug 2023 11:23:42 +0200 Subject: [PATCH 2/4] Bump minimal python version, test 3.12 --- .github/workflows/main.yml | 7 ++++++- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e19ce1c..55572f12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12.0rc1" steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/pyproject.toml b/pyproject.toml index d1f3daeb..d0500bea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ author = "Gram" author-email = "gram@orsinium.dev" home-page = "https://github.com/life4/deal" description-file = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" keywords = "deal,contracts,pre,post,invariant,decorators,validation,pythonic,functional" requires = [] classifiers = [ From 3212ba3bf0ab5f7429776f9c98d2e176292e90e2 Mon Sep 17 00:00:00 2001 From: gram Date: Fri, 18 Aug 2023 11:24:59 +0200 Subject: [PATCH 3/4] fix 3.12 version manifest --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55572f12..1085a300 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: - "3.9" - "3.10" - "3.11" - - "3.12.0rc1" + - "3.12.0-rc.1" steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 From 54cfb287643fee4aef69b565801ce40991eb3960 Mon Sep 17 00:00:00 2001 From: gram Date: Fri, 18 Aug 2023 11:28:20 +0200 Subject: [PATCH 4/4] Don't use 3.12 yet --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1085a300..b2d0adf7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: - "3.9" - "3.10" - "3.11" - - "3.12.0-rc.1" + # - "3.12.0-rc.1" steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4