From 768d07ffa94117e4393aaaeb2f404ed043f2838e Mon Sep 17 00:00:00 2001 From: Airscript Date: Sun, 15 Oct 2023 19:36:40 +0200 Subject: [PATCH 1/4] ci: add lint workflow --- .github/workflows/lint.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..92aac48 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,34 @@ +name: lint + +on: + push: + branches: [main] + + pull_request: + types: [opened] + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v3 + + - name: Setting Up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + + with: + python-version: ${{ matrix.python-version }} + + - name: Install Dependencies + + run: | + python -m pip install --upgrade pip + pip install pylint + + - name: Analysing The Code With pylint + run: pylint $(git ls-files '*.py') \ No newline at end of file From f57e5122393245ed4393b17288a09a83e88ca7a2 Mon Sep 17 00:00:00 2001 From: Airscript Date: Sun, 15 Oct 2023 19:43:16 +0200 Subject: [PATCH 2/4] ci(lint): add pdm install --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 92aac48..bce33a4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,7 +28,8 @@ jobs: run: | python -m pip install --upgrade pip - pip install pylint + pip install pdm + pdm install - name: Analysing The Code With pylint run: pylint $(git ls-files '*.py') \ No newline at end of file From 21d964895c9397f20340c0ffa395ad5a7843a29c Mon Sep 17 00:00:00 2001 From: Airscript Date: Sun, 15 Oct 2023 19:44:08 +0200 Subject: [PATCH 3/4] ci(lint): fix pipeline run on every push --- .github/workflows/lint.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bce33a4..bfa66d9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,11 +1,5 @@ name: lint - -on: - push: - branches: [main] - - pull_request: - types: [opened] +on: [push] jobs: lint: From 36a43a16090f5a1e7958b1fdaab28dc282a916ae Mon Sep 17 00:00:00 2001 From: Airscript Date: Sun, 15 Oct 2023 19:48:56 +0200 Subject: [PATCH 4/4] fix: remove cyclic import --- .github/workflows/lint.yml | 2 +- src/cacca/types/layers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bfa66d9..c32fd62 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,4 +26,4 @@ jobs: pdm install - name: Analysing The Code With pylint - run: pylint $(git ls-files '*.py') \ No newline at end of file + run: pdm run pylint $(git ls-files '*.py') \ No newline at end of file diff --git a/src/cacca/types/layers.py b/src/cacca/types/layers.py index 36290b0..8eb9deb 100644 --- a/src/cacca/types/layers.py +++ b/src/cacca/types/layers.py @@ -1,6 +1,6 @@ from typing import Any, Generic, List, NewType, NotRequired, TypedDict, final -from cacca.types import Action, Guard, Hook, T +from cacca.types.generics import Action, Guard, Hook, T @final