From 2f768de2c3bd5374a04a282fa980e2e3e3e2e81f Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Sun, 26 Nov 2023 23:56:08 -0300 Subject: [PATCH 1/7] mypy added main.yml --- .github/workflows/main.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4e4820c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ +name: FastAPI CI/CD Pipeline + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + type-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + + - name: Install Dependencies with Poetry + run: | + poetry install + working-directory: ./src + + - name: Install mypy and Type Stubs + run: | + pip install mypy types-requests types-redis sqlalchemy + + - name: Run mypy for Type Checking + run: | + mypy --config-file mypy.ini src/ From ac7e6d4618454bdfad982b99343e43f29d057d7b Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Sun, 26 Nov 2023 23:58:11 -0300 Subject: [PATCH 2/7] Update mypy.ini --- mypy.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index a1a2bc0..b7e2c55 100644 --- a/mypy.ini +++ b/mypy.ini @@ -3,6 +3,7 @@ python_version = 3.11 warn_return_any = True warn_unused_configs = True ignore_missing_imports = True +plugins = sqlalchemy.ext.mypy.plugin [mypy-src.app.*] -disallow_untyped_defs = True \ No newline at end of file +disallow_untyped_defs = True From 58d4a348f52cda1f67e26f654f02404981f00907 Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:09:15 -0300 Subject: [PATCH 3/7] Update main.yml --- .github/workflows/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e4820c..1ca305e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,9 +28,13 @@ jobs: poetry install working-directory: ./src - - name: Install mypy and Type Stubs + - name: Install mypy run: | - pip install mypy types-requests types-redis sqlalchemy + pip install mypy + + - name: Mypy Install Types + run: | + mypy --install-types - name: Run mypy for Type Checking run: | From f8f00876fd5123e8fa10138b2a99f8a54aee62e9 Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:18:10 -0300 Subject: [PATCH 4/7] Update main.yml --- .github/workflows/main.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ca305e..0d8c322 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,13 +28,9 @@ jobs: poetry install working-directory: ./src - - name: Install mypy + - name: Install mypy and Type Stubs run: | - pip install mypy - - - name: Mypy Install Types - run: | - mypy --install-types + pip install mypy==1.7.1 types-requests types-redis sqlalchemy - name: Run mypy for Type Checking run: | From 6f818499d170eef4d19baa84e5f2d17aaa08a2d6 Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:20:45 -0300 Subject: [PATCH 5/7] Update main.yml --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d8c322..5a77969 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,9 @@ jobs: with: python-version: '3.11' + - name: Set PYTHONPATH + run: echo "PYTHONPATH=./src" >> $GITHUB_ENV + - name: Install Poetry run: | curl -sSL https://install.python-poetry.org | python3 - From 8747c5ce31387e70458308bfc7d4fa7bb547b3cf Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:25:43 -0300 Subject: [PATCH 6/7] Update main.yml --- .github/workflows/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a77969..3eff7c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,21 +19,23 @@ jobs: with: python-version: '3.11' - - name: Set PYTHONPATH - run: echo "PYTHONPATH=./src" >> $GITHUB_ENV - - name: Install Poetry run: | curl -sSL https://install.python-poetry.org | python3 - - - name: Install Dependencies with Poetry + - name: Export Poetry dependencies to requirements.txt + run: | + poetry export -f requirements.txt --output requirements.txt --without-hashes + working-directory: ./src + + - name: Install Dependencies run: | - poetry install + pip install -r requirements.txt working-directory: ./src - name: Install mypy and Type Stubs run: | - pip install mypy==1.7.1 types-requests types-redis sqlalchemy + pip install mypy types-requests types-redis - name: Run mypy for Type Checking run: | From 5ae48eb893fc016101d1c21cd4e72f1c1c9fb500 Mon Sep 17 00:00:00 2001 From: Igor Benav <43156212+igorbenav@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:29:13 -0300 Subject: [PATCH 7/7] Update main.yml --- .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 3eff7c9..347376d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: - name: Install mypy and Type Stubs run: | - pip install mypy types-requests types-redis + pip install mypy==1.7.1 types-requests types-redis - name: Run mypy for Type Checking run: |