From e67124dfe415f6f6dd36e0924c8ea60b625555eb Mon Sep 17 00:00:00 2001 From: Rakesh7295 <75466904+Rakesh7295@users.noreply.github.com> Date: Tue, 22 Jun 2021 15:39:48 +0530 Subject: [PATCH 1/4] workflow --- .github/workflows/Test with pytest.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/Test with pytest.yml diff --git a/.github/workflows/Test with pytest.yml b/.github/workflows/Test with pytest.yml new file mode 100644 index 0000000..8d22b55 --- /dev/null +++ b/.github/workflows/Test with pytest.yml @@ -0,0 +1,37 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + flask init-db + pytest From 9c43cb01ff5fb3469817332861b8e37e869fcb60 Mon Sep 17 00:00:00 2001 From: Rakesh7295 <75466904+Rakesh7295@users.noreply.github.com> Date: Tue, 22 Jun 2021 15:43:38 +0530 Subject: [PATCH 2/4] corrected the error --- handlers/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/routes.py b/handlers/routes.py index d9d3b6e..06d5684 100644 --- a/handlers/routes.py +++ b/handlers/routes.py @@ -35,7 +35,7 @@ def remove_value(): db = get_db() db.execute( "DELETE FROM shoppinglist WHERE item = ?", - (item) # change this to (item,) <- the comma is what matters - don't ask me why... + (item,) # change this to (item,) <- the comma is what matters - don't ask me why... ) db.commit() return redirect("/", code=302) From 411d669c20f993ab985eaf6113d4bdf8929da860 Mon Sep 17 00:00:00 2001 From: rakesh7295 <75466904+rakesh7295@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:45:23 +0530 Subject: [PATCH 3/4] Create test --- test | 1 + 1 file changed, 1 insertion(+) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000..54e00db --- /dev/null +++ b/test @@ -0,0 +1 @@ +#check From c9e8537be264f28e4130e6c2158d1bac193d76d7 Mon Sep 17 00:00:00 2001 From: rakesh7295 <75466904+rakesh7295@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:49:16 +0530 Subject: [PATCH 4/4] Update Dockerfile --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4cebcda..e5d1fa6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,6 @@ RUN pip3 install -r requirements.txt COPY database /app/database COPY handlers /app/handlers COPY templates /app/templates -COPY instance /app/instance COPY app.py /app/app.py COPY schema.sql /app/schema.sql @@ -23,4 +22,4 @@ RUN flask init-db EXPOSE 5000 CMD [ "python3", "app.py" ] - \ No newline at end of file +