From fac8f73c4f827cb5cba49d55f4ee780508025c8a Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Sun, 15 Dec 2024 22:37:36 +0400 Subject: [PATCH 1/6] chore: Add Typing in Ci --- .github/workflows/tests.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 172d8c7..818a05a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,3 +37,19 @@ jobs: cache-dependency-path: requirements*/*.txt - run: pip install tox - run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} + typing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: '3.x' + cache: pip + cache-dependency-path: requirements*/*.txt + - name: cache mypy + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: ./.mypy_cache + key: mypy|${{ hashFiles('pyproject.toml') }} + - run: pip install tox + - run: tox run -e typing \ No newline at end of file From 45f029861fdcae79208e2f5fb8767c50345eb781 Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Sun, 15 Dec 2024 22:48:50 +0400 Subject: [PATCH 2/6] chore: Add typing to tox.ini --- tox.ini | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tox.ini b/tox.ini index 01606ec..60551d7 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py3{12,11,10,9,8} minimal + typing style docs skip_missing_interpreters = true @@ -23,6 +24,13 @@ deps = pre-commit skip_install = true commands = pre-commit run --all-files +[testenv:typing] +deps = -r requirements/typing.txt +commands = + mypy + pyright + pyright --verifytypes flask_principal --ignoreexternal + [testenv:docs] deps = -r requirements/docs.txt commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml From 4d1880f4663576fe9bbd5a2e56c0ed16ede21505 Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Sun, 15 Dec 2024 23:23:02 +0400 Subject: [PATCH 3/6] chore: update typing deps --- requirements/typing.in | 1 + requirements/typing.txt | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/requirements/typing.in b/requirements/typing.in index f7d9470..278e04d 100644 --- a/requirements/typing.in +++ b/requirements/typing.in @@ -1,2 +1,3 @@ pyright pytest +mypy \ No newline at end of file diff --git a/requirements/typing.txt b/requirements/typing.txt index a1e763c..a8e3af3 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -1,11 +1,15 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile typing.in +# pip-compile --output-file=requirements/typing.txt requirements/typing.in # iniconfig==2.0.0 # via pytest +mypy==1.13.0 + # via -r requirements/typing.in +mypy-extensions==1.0.0 + # via mypy nodeenv==1.8.0 # via pyright packaging==24.0 @@ -13,11 +17,13 @@ packaging==24.0 pluggy==1.5.0 # via pytest pyright==1.1.387 - # via -r typing.in + # via -r requirements/typing.in pytest==8.3.3 - # via -r typing.in + # via -r requirements/typing.in typing-extensions==4.12.2 - # via pyright + # via + # mypy + # pyright # The following packages are considered to be unsafe in a requirements file: # setuptools From 4ee2d265bc3955256fe9e0705394165c33f82979 Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Mon, 16 Dec 2024 07:54:43 +0400 Subject: [PATCH 4/6] fix: Add mypy command --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 60551d7..b14d265 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ commands = pre-commit run --all-files [testenv:typing] deps = -r requirements/typing.txt commands = - mypy + mypy src pyright pyright --verifytypes flask_principal --ignoreexternal From 04ec09c4a4aa52761dd64a28f1e06cd000dea196 Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Mon, 16 Dec 2024 08:01:54 +0400 Subject: [PATCH 5/6] chore: specify pyright command --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b14d265..7546216 100644 --- a/tox.ini +++ b/tox.ini @@ -28,7 +28,7 @@ commands = pre-commit run --all-files deps = -r requirements/typing.txt commands = mypy src - pyright + pyright src pyright --verifytypes flask_principal --ignoreexternal [testenv:docs] From 283736b5bff263b3e9bf96f83ea9cb8258228131 Mon Sep 17 00:00:00 2001 From: Abdur-RahmaanJ Date: Mon, 16 Dec 2024 08:04:12 +0400 Subject: [PATCH 6/6] chore: specify pyright command --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7546216..837b9fb 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,6 @@ deps = -r requirements/typing.txt commands = mypy src pyright src - pyright --verifytypes flask_principal --ignoreexternal [testenv:docs] deps = -r requirements/docs.txt