From af9a6a803bf1978363cec0d29500ae2d7c9d9034 Mon Sep 17 00:00:00 2001 From: Kunal Bhattacharya Date: Sun, 15 Sep 2024 21:24:04 +0530 Subject: [PATCH 1/4] Updated Pipfiles with pylint module --- Pipfile | 7 ++++--- Pipfile.lock | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 75ff046..5bbd559 100644 --- a/Pipfile +++ b/Pipfile @@ -4,14 +4,15 @@ verify_ssl = true name = "pypi" [packages] -google-api-python-client = "*" -google-auth-httplib2 = "*" -google-auth-oauthlib = "*" +google-api-python-client = "==2.145.0" +google-auth-httplib2 = "==0.2.0" +google-auth-oauthlib = "==1.2.1" sqlalchemy = "*" openpyxl = "*" pandas = "*" pytest = "*" oauth2client = "*" +pylint = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index ebc5a1a..ee7b998 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7b1063c9932a18451bacae5431ea2cfbb03f304e2a0bc8e46fa3c7a8b65cf974" + "sha256": "d42d069137d7a07ba0bfff348d97b377f35037f0c7d9f8c6f921674fcda6487d" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,14 @@ ] }, "default": { + "astroid": { + "hashes": [ + "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a", + "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25" + ], + "markers": "python_full_version >= '3.8.0'", + "version": "==3.2.4" + }, "cachetools": { "hashes": [ "sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292", @@ -128,6 +136,14 @@ "markers": "python_full_version >= '3.7.0'", "version": "==3.3.2" }, + "dill": { + "hashes": [ + "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca", + "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7" + ], + "markers": "python_version >= '3.11'", + "version": "==0.3.8" + }, "et-xmlfile": { "hashes": [ "sha256:8eb9e2bc2f8c97e37a2dc85a09ecdcdec9d8a396530a6d5a33b30b9a92da0c5c", @@ -210,6 +226,22 @@ "markers": "python_version >= '3.7'", "version": "==2.0.0" }, + "isort": { + "hashes": [ + "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109", + "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6" + ], + "markers": "python_full_version >= '3.8.0'", + "version": "==5.13.2" + }, + "mccabe": { + "hashes": [ + "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", + "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" + ], + "markers": "python_version >= '3.6'", + "version": "==0.7.0" + }, "numpy": { "hashes": [ "sha256:046356b19d7ad1890c751b99acad5e82dc4a02232013bd9a9a712fddf8eb60f5", @@ -338,6 +370,14 @@ "markers": "python_version >= '3.9'", "version": "==2.2.2" }, + "platformdirs": { + "hashes": [ + "sha256:50a5450e2e84f44539718293cbb1da0a0885c9d14adf21b77bae4e66fc99d9b5", + "sha256:d4e0b7d8ec176b341fb03cb11ca12d0276faa8c485f9cd218f613840463fc2c0" + ], + "markers": "python_version >= '3.8'", + "version": "==4.3.3" + }, "pluggy": { "hashes": [ "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", @@ -387,6 +427,15 @@ "markers": "python_version >= '3.8'", "version": "==0.4.1" }, + "pylint": { + "hashes": [ + "sha256:02f4aedeac91be69fb3b4bea997ce580a4ac68ce58b89eaefeaf06749df73f4b", + "sha256:1b7a721b575eaeaa7d39db076b6e7743c993ea44f57979127c517c6c572c803e" + ], + "index": "pypi", + "markers": "python_full_version >= '3.8.0'", + "version": "==3.2.7" + }, "pyparsing": { "hashes": [ "sha256:a6a7ee4235a3f944aa1fa2249307708f893fe5717dc603503c6c7969c070fb7c", @@ -507,6 +556,14 @@ "markers": "python_version >= '3.7'", "version": "==2.0.34" }, + "tomlkit": { + "hashes": [ + "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde", + "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79" + ], + "markers": "python_version >= '3.8'", + "version": "==0.13.2" + }, "typing-extensions": { "hashes": [ "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", From 9fe7e749f55887f075565b528e43f27d9a6210da Mon Sep 17 00:00:00 2001 From: Kunal Bhattacharya Date: Sun, 15 Sep 2024 21:24:30 +0530 Subject: [PATCH 2/4] Adding pylint test to PR workflow --- .github/workflows/pr.yaml | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..d71058f --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,41 @@ +name: pr-build + +on: + workflow_dispatch: + + pull_request: + types: + - labeled + - opened + - synchronize + - reopened + +jobs: + test_imports: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 + + - name: Install pipenv + run: python -m pip install --upgrade pip && pip install pipenv -q + + - name: Cache pipenv + id: cache-pipenv + uses: actions/cache@v4.0.2 + with: + path: ~/.local/share/virtualenvs + key: ${{ runner.os }}-pipenv-public-${{ hashFiles('**/Pipfile.lock') }} + + - name: Install dependencies + if: steps.cache-pipenv.outputs.cache-hit != 'true' + run: pipenv sync -d + + - name: pylink checker for imports + run: pipenv run pylint --disable=all --enable=import-error --jobs=3 tests src utils From f1ec74f585c809e7f66d6f502260cd9d76c4f5aa Mon Sep 17 00:00:00 2001 From: Kunal Bhattacharya Date: Sun, 15 Sep 2024 21:27:29 +0530 Subject: [PATCH 3/4] Dummy commit to validate Pylint is catching missing or wrong imports --- tests/test_auth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_auth.py b/tests/test_auth.py index 2f9d07e..5cac45b 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,4 +1,5 @@ import pytest +import hahahahaah from src.main import Clingy def test_authentication(): From b3bc9014b3963fb0e3885addd67664ccf0d55d1a Mon Sep 17 00:00:00 2001 From: Kunal Bhattacharya Date: Sun, 15 Sep 2024 21:28:39 +0530 Subject: [PATCH 4/4] Reverting dummy commit --- tests/test_auth.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index 5cac45b..2f9d07e 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,5 +1,4 @@ import pytest -import hahahahaah from src.main import Clingy def test_authentication():