From e8a82cbc72654ccd4eec7cd306040322a08de934 Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 16:50:51 +0100 Subject: [PATCH 1/8] Create pylint.yml action --- .github/workflows/pylint.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..a536e7c --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v3 + - name: Set 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') From 5f72f8f2dcdaa96ec77d2acf222586b8a8156c8f Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 16:52:22 +0100 Subject: [PATCH 2/8] Make pylint check only python files in src dir --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a536e7c..57dd4e1 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -20,4 +20,4 @@ jobs: pip install pylint - name: Analysing the code with pylint run: | - pylint $(git ls-files '*.py') + pylint src/ From c74cab2a4e3fde4c81b80dc05635379c8d4ae976 Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 16:58:59 +0100 Subject: [PATCH 3/8] Update pylint workflow --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 57dd4e1..011582c 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -20,4 +20,4 @@ jobs: pip install pylint - name: Analysing the code with pylint run: | - pylint src/ + pylint --fail-under=8 $(git ls-files 'src/*.py') From 0a31212361b804937430a5fa5df3b6a24bbf766a Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 18:53:49 +0100 Subject: [PATCH 4/8] Update pylint.yml --- .github/workflows/pylint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 011582c..c3838fa 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -20,4 +20,5 @@ jobs: pip install pylint - name: Analysing the code with pylint run: | + export PYTHONPATH=$(pwd) pylint --fail-under=8 $(git ls-files 'src/*.py') From 64582b722579bed7ed1c2deec00dc117befe4ddd Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 18:55:58 +0100 Subject: [PATCH 5/8] Install dev requirements before running pylint --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index c3838fa..a6b773f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pylint + pip install -r requirements/dev-requirements.txt - name: Analysing the code with pylint run: | export PYTHONPATH=$(pwd) From 8d07b0992e47843071bf30b1101b8d59158578cd Mon Sep 17 00:00:00 2001 From: Gauthier Imbert Date: Sat, 23 Mar 2024 18:58:32 +0100 Subject: [PATCH 6/8] Remove unused code from species --- src/router/species.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/router/species.py b/src/router/species.py index 3d1de5b..a492942 100644 --- a/src/router/species.py +++ b/src/router/species.py @@ -1,22 +1,13 @@ -from os import path +""" +TODO: species spefic endpoints: + - get the list of species + - get the list of sub-species (for each species) +""" -from fastapi import APIRouter, Depends, status, HTTPException -from fastapi.responses import FileResponse -from sqlalchemy.orm import Session - -from src.dependencies import get_db - -from src.models.responses import ErrorMessage - -from src.database.crud import get_image +from fastapi import APIRouter router = APIRouter( prefix="/species", tags=["species"], ) - - -# TODO: species spefic endpoints: -# - get the list of species -# - get the list of sub-species (for each species) From 3c4882102f9bf4a7e110f3a5e8a9a384587ee8c0 Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 19:05:31 +0100 Subject: [PATCH 7/8] Update pylint.yml --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a6b773f..615e5c6 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -21,4 +21,4 @@ jobs: - name: Analysing the code with pylint run: | export PYTHONPATH=$(pwd) - pylint --fail-under=8 $(git ls-files 'src/*.py') + pylint --fail-under=8 $(git ls-files 'src/*.py') --disable=C0114,C0115,C0116 From b3f3193c23eaf083dbdc8f65dce6e9ecae6e6886 Mon Sep 17 00:00:00 2001 From: Iglesys Date: Sat, 23 Mar 2024 19:26:06 +0100 Subject: [PATCH 8/8] Remove 3.12 from tested versions --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 615e5c6..1b06968 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }}