From 2bf22c03290982424115e68635ba947d2352b7d3 Mon Sep 17 00:00:00 2001 From: Masahiro Wada Date: Thu, 28 Apr 2022 01:44:29 +0000 Subject: [PATCH] chore: Check type and poetry config in ci --- .github/workflows/ci-testing.yml | 10 ++++++++++ .pre-commit-config.yaml | 16 +++++----------- poetry.lock | 19 ++++--------------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index a831036..c5e7ce0 100755 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -24,6 +24,12 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/setup-node@v2 + with: + node-version: '16' + cache: npm + - name: Setup pyright + run: npm install -g pyright - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: @@ -49,6 +55,10 @@ jobs: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - --preview poetry install + - name: Type check + run: | + poetry run pyright --warnings + - name: Tests run: | poetry run coverage run --source alfort_dom -m pytest -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc83239..34993b8 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,6 +22,11 @@ ci: # submodules: true repos: + - repo: https://github.com/python-poetry/poetry + rev: '' # add version here + hooks: + - id: poetry-check + - id: poetry-lock - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.1.0 hooks: @@ -77,14 +82,3 @@ repos: hooks: - id: flake8 name: PEP8 - - - repo: local - hooks: - - id: pyright - args: [ --warnings ] - name: pyright - entry: pyright - language: node - pass_filenames: false - types: [python] - additional_dependencies: ['pyright@1.1.238'] diff --git a/poetry.lock b/poetry.lock index f96ba72..c100d32 100755 --- a/poetry.lock +++ b/poetry.lock @@ -350,14 +350,6 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -[[package]] -name = "pyodide" -version = "0.0.2" -description = "Python with the scientific stack, compiled to WebAssembly." -category = "dev" -optional = false -python-versions = ">=3.9" - [[package]] name = "pyparsing" version = "3.0.8" @@ -379,7 +371,7 @@ python-versions = "*" [[package]] name = "pyright" -version = "1.1.239" +version = "1.1.241" description = "Command line wrapper for pyright" category = "dev" optional = false @@ -563,7 +555,7 @@ python-versions = "*" [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "f6abe58dca0da665c74bd6b659e7a1946d3a138568c72625b90b9de80d48e5fc" +content-hash = "7df7bfa7d60e0de41046c9739d0124d99636348238ee8e32c340103b4fc5f067" [metadata.files] alfort = [ @@ -758,9 +750,6 @@ pyflakes = [ {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, ] -pyodide = [ - {file = "pyodide-0.0.2.tar.gz", hash = "sha256:ca79db85c1ce8ebfde2f6b44d294e9dc9ccbb89b59304a68f26e75da7ddfb673"}, -] pyparsing = [ {file = "pyparsing-3.0.8-py3-none-any.whl", hash = "sha256:ef7b523f6356f763771559412c0d7134753f037822dad1b16945b7b846f7ad06"}, {file = "pyparsing-3.0.8.tar.gz", hash = "sha256:7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954"}, @@ -769,8 +758,8 @@ pyperclip = [ {file = "pyperclip-1.8.2.tar.gz", hash = "sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57"}, ] pyright = [ - {file = "pyright-1.1.239-py3-none-any.whl", hash = "sha256:0d3929aba6f8add95a303fd2c008ea9a0d91e0f0b782c6cf5a2b41ffef023769"}, - {file = "pyright-1.1.239.tar.gz", hash = "sha256:a870792c6b194c98d096b58315ba781a2c994a328d3f6c38d1a7bcc61b9f215a"}, + {file = "pyright-1.1.241-py3-none-any.whl", hash = "sha256:2c3778220f6285b330df7e4875af6ac453118c63b79d75828be57bf7ff17f886"}, + {file = "pyright-1.1.241.tar.gz", hash = "sha256:8a61266da68aa8f5b1248266472003b09866898377a06def32bce22409af39e1"}, ] pytest = [ {file = "pytest-7.1.2-py3-none-any.whl", hash = "sha256:13d0e3ccfc2b6e26be000cb6568c832ba67ba32e719443bfe725814d3c42433c"},