From 2c84315735d9b1520a0e42582ffdcecd8787155a Mon Sep 17 00:00:00 2001 From: Daniel Barutov Date: Sun, 13 Jul 2025 12:58:04 +0300 Subject: [PATCH 1/6] Tested Commit --- .gitignore | 101 +++++++++++++++++++++++++++++++++++++++++++---------- test.db | Bin 0 -> 16384 bytes todo.db | Bin 0 -> 40960 bytes 3 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 test.db create mode 100644 todo.db diff --git a/.gitignore b/.gitignore index a9ff831..b7faf40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Byte-compiled / optimized / DLL files __pycache__/ -*.py[cod] +*.py[codz] *$py.class # C extensions @@ -20,7 +20,6 @@ parts/ sdist/ var/ wheels/ -pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg @@ -47,9 +46,10 @@ htmlcov/ nosetests.xml coverage.xml *.cover -*.py,cover +*.py.cover .hypothesis/ .pytest_cache/ +cover/ # Translations *.mo @@ -72,6 +72,7 @@ instance/ docs/_build/ # PyBuilder +.pybuilder/ target/ # Jupyter Notebook @@ -82,7 +83,9 @@ profile_default/ ipython_config.py # pyenv -.python-version +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -91,7 +94,37 @@ ipython_config.py # install all needed dependencies. #Pipfile.lock -# PEP 582; used by e.g. github.com/David-OConnor/pyflow +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +#uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock +#poetry.toml + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. +# https://pdm-project.org/en/latest/usage/project/#working-with-version-control +#pdm.lock +#pdm.toml +.pdm-python +.pdm-build/ + +# pixi +# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. +#pixi.lock +# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one +# in the .venv directory. It is recommended not to include this directory in version control. +.pixi + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff @@ -103,6 +136,7 @@ celerybeat.pid # Environments .env +.envrc .venv env/ venv/ @@ -128,17 +162,46 @@ dmypy.json # Pyre type checker .pyre/ -# Database -*.db -*.sqlite -*.sqlite3 - -# IDE -.vscode/ -.idea/ -*.swp -*.swo - -# OS -.DS_Store -Thumbs.db \ No newline at end of file +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# Abstra +# Abstra is an AI-powered process automation framework. +# Ignore directories containing user credentials, local state, and settings. +# Learn more at https://abstra.io/docs +.abstra/ + +# Visual Studio Code +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore +# and can be added to the global gitignore or merged into this file. However, if you prefer, +# you could uncomment the following to ignore the entire vscode folder +# .vscode/ + +# Ruff stuff: +.ruff_cache/ + +# PyPI configuration file +.pypirc + +# Cursor +# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to +# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data +# refer to https://docs.cursor.com/context/ignore-files +.cursorignore +.cursorindexingignore + +# Marimo +marimo/_static/ +marimo/_lsp/ +__marimo__/ diff --git a/test.db b/test.db new file mode 100644 index 0000000000000000000000000000000000000000..9870c10c861c10cfcadded5e55b1dfd1b0611d3d GIT binary patch literal 16384 zcmeI&F$w}P5CzbQYpd)LQrNDI7w`Z!;t4EPun#?c_eZ=}*U*p<}009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBml2`tL8{_(G= X2oNAZfB*pk1PBlyK!5;&KNI)>5gQ3V literal 0 HcmV?d00001 diff --git a/todo.db b/todo.db new file mode 100644 index 0000000000000000000000000000000000000000..1ff9cc231a777f05d8956a01c1bd43c5530b8515 GIT binary patch literal 40960 zcmeI*PjA~~9KdnA>5@8I>z%MT@gOvJ#PH6>aVAcTZN$zcu6f&ziYv{<`+= z>Tjz*-T3i_ef@V?#RCBZ5I_I{1Q0*~f&aHa#mHLkS^9C<_k*Y5Q};9qMv)u(YMb9{ zI^~ul_Ul#WOEJ+Z8g-$1i1pC7n=4t%w)AK^M$q%ZuIgl5glX6J58MBWrut0;RQvW< zxvceprGGyiGY;4HdVvbN^2V@f*NMn!mHj-I%~_VE|IizIC*35P3YohI*(z6RPCCN8 z5&Dv#<$UTiMZM7y^>(fHzQ`MCJn==jx%XLlx-l8nyq2LCMc)iY{@laPypGrJe4Dn# zKc+JZym8>Wa>7)V*=X$_IHKx&Qf}8;VtudOY&!Lp8`mDS$_Ec^b!J0<_K>*xVRQeW z+&mT!oMV-^yj{6Ao&K>GJ&x0_w%OVAr>(K6Dyt|DmR0(LG*wBjaX9V#t2s5`3P%A4Hu|I2?zA{v>i3xt&38C{H=?MWxZG zIpz9)jsMKnbJoU&{@hSw^}0dtB<#3n@);=4Zf19BYWy>evBbq;ZvV8G4s5+tw5P7v zy+-}0)hx@4SiU?7XXovYm$KI3hOVh3M^CzP7Vmnenqyr(mQXLw5rz+gKote$s7Nlog^Fo(fvp9Cw<(NAD^(jy}h+tEEP-D;H)u>ikrpl zJDaJ%zPj2boIL^vAbst%0vMgRc> Y5I_I{1Q0*~0R#|00D(6NWHN^F4>1s}pa1{> literal 0 HcmV?d00001 From 16f24be36a16e821f964aaec23775553153a318b Mon Sep 17 00:00:00 2001 From: Daniel Barutov Date: Sun, 13 Jul 2025 13:19:04 +0300 Subject: [PATCH 2/6] Fix P Version in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 728cae3..25d7c96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - python-version: [3.9, 3.10, 3.11] + python-version: [3.9, 3.10, 3.11, 3.12] steps: - uses: actions/checkout@v4 From e8abe7acb27d12f3df57698d1083a9f7bde4322f Mon Sep 17 00:00:00 2001 From: Daniel Barutov Date: Sun, 13 Jul 2025 13:39:51 +0300 Subject: [PATCH 3/6] FIX main without Templates --- app/main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/main.py b/app/main.py index ced3f66..37f1216 100644 --- a/app/main.py +++ b/app/main.py @@ -34,12 +34,9 @@ app.mount("/public", StaticFiles(directory="app/public"), name="public") @app.get("/") def create_page(): - return templates.TemplateResponse("create.html", {"request": {}}) + return {"message": "ToDo API, version 1.0.0"} + -@app.get("/tasks") -def tasks_page(): - tasks = get_tasks_from_db() - return templates.TemplateResponse("tasks.html", {"request": {}, "tasks": tasks}) @app.get("/health") def health_check(): From 99604fb656aff1efb3a8ba6c16d6166722d6b1b0 Mon Sep 17 00:00:00 2001 From: Daniel Barutov Date: Sun, 13 Jul 2025 13:44:21 +0300 Subject: [PATCH 4/6] Added Format code to ci.yml --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25d7c96..35f28eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,12 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 black isort - + + - name: Format code + run: | + black app/ tests/ + isort app/ tests/ + - name: Run linters run: | flake8 app/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics From 6d128290ceb2618f73ce8a3165f26c0ac273256f Mon Sep 17 00:00:00 2001 From: Daniel Barutov Date: Sun, 13 Jul 2025 13:48:10 +0300 Subject: [PATCH 5/6] Format python Version in string --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35f28eb..dcf96df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - python-version: [3.9, 3.10, 3.11, 3.12] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -67,7 +67,7 @@ jobs: run: | black app/ tests/ isort app/ tests/ - + - name: Run linters run: | flake8 app/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics From 5ca81b057f4d8acc208c35b599de84c356d17db5 Mon Sep 17 00:00:00 2001 From: Daniel Barutov Date: Sun, 13 Jul 2025 13:51:39 +0300 Subject: [PATCH 6/6] Codecov temporarily disabled --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf96df..9c25584 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,13 +39,13 @@ jobs: run: | pytest tests/ -v --cov=app --cov-report=xml - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - file: ./coverage.xml - flags: unittests - name: codecov-umbrella - fail_ci_if_error: true + # - name: Upload coverage to Codecov(disabled) + # uses: codecov/codecov-action@v3 + # with: + # file: ./coverage.xml + # flags: unittests + # name: codecov-umbrella + # fail_ci_if_error: true lint: runs-on: ubuntu-latest