From da1a776b2b1fe43b74ea26a3e333d27dc333407b Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:56:58 +0200 Subject: [PATCH 1/7] Modify GitHub Action Python application + poetry changes --- .github/workflows/python_app.yml | 28 ++++++----- backend-app/poetry.lock | 84 +++++++++++++++++++++++++++++++- backend-app/pyproject.toml | 2 + 3 files changed, 102 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python_app.yml b/.github/workflows/python_app.yml index ce8d1a38..7e3e25e1 100644 --- a/.github/workflows/python_app.yml +++ b/.github/workflows/python_app.yml @@ -1,7 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Python application +name: FastAPI Backend on: push: @@ -14,8 +11,8 @@ permissions: jobs: build: - runs-on: ubuntu-latest + working-directory: backend-app env: FASTAPI_SECRET_KEY: ${{secrets.FASTAPI_SECRET_KEY}} FASTAPI_HASH_ALGORITHM: ${{secrets.FASTAPI_HASH_ALGORITHM}} @@ -25,24 +22,33 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.12" - 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 + pip install poetry==1.8.3 + poetry install --no-cache + if [ -f pyproject.toml]; then poetry install + elif [-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: Black check + run: | + black --check app/ + enforce: + always: - name: Test with pytest run: | # Test backend - cd backend-app - pytest --cov=app tests + coverage run --source=app -m pytest tests + coverage report -m + diff --git a/backend-app/poetry.lock b/backend-app/poetry.lock index 81a3f35f..2678eb4b 100644 --- a/backend-app/poetry.lock +++ b/backend-app/poetry.lock @@ -175,6 +175,70 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "coverage" +version = "7.6.0" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "coverage-7.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dff044f661f59dace805eedb4a7404c573b6ff0cdba4a524141bc63d7be5c7fd"}, + {file = "coverage-7.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a8659fd33ee9e6ca03950cfdcdf271d645cf681609153f218826dd9805ab585c"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7792f0ab20df8071d669d929c75c97fecfa6bcab82c10ee4adb91c7a54055463"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4b3cd1ca7cd73d229487fa5caca9e4bc1f0bca96526b922d61053ea751fe791"}, + {file = "coverage-7.6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7e128f85c0b419907d1f38e616c4f1e9f1d1b37a7949f44df9a73d5da5cd53c"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a94925102c89247530ae1dab7dc02c690942566f22e189cbd53579b0693c0783"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:dcd070b5b585b50e6617e8972f3fbbee786afca71b1936ac06257f7e178f00f6"}, + {file = "coverage-7.6.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d50a252b23b9b4dfeefc1f663c568a221092cbaded20a05a11665d0dbec9b8fb"}, + {file = "coverage-7.6.0-cp310-cp310-win32.whl", hash = "sha256:0e7b27d04131c46e6894f23a4ae186a6a2207209a05df5b6ad4caee6d54a222c"}, + {file = "coverage-7.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:54dece71673b3187c86226c3ca793c5f891f9fc3d8aa183f2e3653da18566169"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7b525ab52ce18c57ae232ba6f7010297a87ced82a2383b1afd238849c1ff933"}, + {file = "coverage-7.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bea27c4269234e06f621f3fac3925f56ff34bc14521484b8f66a580aacc2e7d"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed8d1d1821ba5fc88d4a4f45387b65de52382fa3ef1f0115a4f7a20cdfab0e94"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01c322ef2bbe15057bc4bf132b525b7e3f7206f071799eb8aa6ad1940bcf5fb1"}, + {file = "coverage-7.6.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03cafe82c1b32b770a29fd6de923625ccac3185a54a5e66606da26d105f37dac"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0d1b923fc4a40c5832be4f35a5dab0e5ff89cddf83bb4174499e02ea089daf57"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4b03741e70fb811d1a9a1d75355cf391f274ed85847f4b78e35459899f57af4d"}, + {file = "coverage-7.6.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a73d18625f6a8a1cbb11eadc1d03929f9510f4131879288e3f7922097a429f63"}, + {file = "coverage-7.6.0-cp311-cp311-win32.whl", hash = "sha256:65fa405b837060db569a61ec368b74688f429b32fa47a8929a7a2f9b47183713"}, + {file = "coverage-7.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:6379688fb4cfa921ae349c76eb1a9ab26b65f32b03d46bb0eed841fd4cb6afb1"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f7db0b6ae1f96ae41afe626095149ecd1b212b424626175a6633c2999eaad45b"}, + {file = "coverage-7.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bbdf9a72403110a3bdae77948b8011f644571311c2fb35ee15f0f10a8fc082e8"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc44bf0315268e253bf563f3560e6c004efe38f76db03a1558274a6e04bf5d5"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:da8549d17489cd52f85a9829d0e1d91059359b3c54a26f28bec2c5d369524807"}, + {file = "coverage-7.6.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0086cd4fc71b7d485ac93ca4239c8f75732c2ae3ba83f6be1c9be59d9e2c6382"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1fad32ee9b27350687035cb5fdf9145bc9cf0a094a9577d43e909948ebcfa27b"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:044a0985a4f25b335882b0966625270a8d9db3d3409ddc49a4eb00b0ef5e8cee"}, + {file = "coverage-7.6.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:76d5f82213aa78098b9b964ea89de4617e70e0d43e97900c2778a50856dac605"}, + {file = "coverage-7.6.0-cp312-cp312-win32.whl", hash = "sha256:3c59105f8d58ce500f348c5b56163a4113a440dad6daa2294b5052a10db866da"}, + {file = "coverage-7.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:ca5d79cfdae420a1d52bf177de4bc2289c321d6c961ae321503b2ca59c17ae67"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d39bd10f0ae453554798b125d2f39884290c480f56e8a02ba7a6ed552005243b"}, + {file = "coverage-7.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:beb08e8508e53a568811016e59f3234d29c2583f6b6e28572f0954a6b4f7e03d"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b2e16f4cd2bc4d88ba30ca2d3bbf2f21f00f382cf4e1ce3b1ddc96c634bc48ca"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6616d1c9bf1e3faea78711ee42a8b972367d82ceae233ec0ac61cc7fec09fa6b"}, + {file = "coverage-7.6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad4567d6c334c46046d1c4c20024de2a1c3abc626817ae21ae3da600f5779b44"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d17c6a415d68cfe1091d3296ba5749d3d8696e42c37fca5d4860c5bf7b729f03"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:9146579352d7b5f6412735d0f203bbd8d00113a680b66565e205bc605ef81bc6"}, + {file = "coverage-7.6.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:cdab02a0a941af190df8782aafc591ef3ad08824f97850b015c8c6a8b3877b0b"}, + {file = "coverage-7.6.0-cp38-cp38-win32.whl", hash = "sha256:df423f351b162a702c053d5dddc0fc0ef9a9e27ea3f449781ace5f906b664428"}, + {file = "coverage-7.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:f2501d60d7497fd55e391f423f965bbe9e650e9ffc3c627d5f0ac516026000b8"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7221f9ac9dad9492cecab6f676b3eaf9185141539d5c9689d13fd6b0d7de840c"}, + {file = "coverage-7.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ddaaa91bfc4477d2871442bbf30a125e8fe6b05da8a0015507bfbf4718228ab2"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4cbe651f3904e28f3a55d6f371203049034b4ddbce65a54527a3f189ca3b390"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:831b476d79408ab6ccfadaaf199906c833f02fdb32c9ab907b1d4aa0713cfa3b"}, + {file = "coverage-7.6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46c3d091059ad0b9c59d1034de74a7f36dcfa7f6d3bde782c49deb42438f2450"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4d5fae0a22dc86259dee66f2cc6c1d3e490c4a1214d7daa2a93d07491c5c04b6"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:07ed352205574aad067482e53dd606926afebcb5590653121063fbf4e2175166"}, + {file = "coverage-7.6.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:49c76cdfa13015c4560702574bad67f0e15ca5a2872c6a125f6327ead2b731dd"}, + {file = "coverage-7.6.0-cp39-cp39-win32.whl", hash = "sha256:482855914928c8175735a2a59c8dc5806cf7d8f032e4820d52e845d1f731dca2"}, + {file = "coverage-7.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:543ef9179bc55edfd895154a51792b01c017c87af0ebaae092720152e19e42ca"}, + {file = "coverage-7.6.0-pp38.pp39.pp310-none-any.whl", hash = "sha256:6fe885135c8a479d3e37a7aae61cbd3a0fb2deccb4dda3c25f92a49189f766d6"}, + {file = "coverage-7.6.0.tar.gz", hash = "sha256:289cc803fa1dc901f84701ac10c9ee873619320f2f9aff38794db4a4a0268d51"}, +] + +[package.extras] +toml = ["tomli"] + [[package]] name = "cryptography" version = "43.0.0" @@ -1101,6 +1165,24 @@ pluggy = ">=1.5,<2" [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-cov" +version = "5.0.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857"}, + {file = "pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652"}, +] + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -1683,4 +1765,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "b8d0e12d79b11854e9c99055a27f85f2b4832da5b9f7b6328f676f9534b26a35" +content-hash = "7cef09b910d0ec33f37765b06c5c68176db3bceae381f979f6043295a64bbe0e" diff --git a/backend-app/pyproject.toml b/backend-app/pyproject.toml index 9975b3cb..82711070 100644 --- a/backend-app/pyproject.toml +++ b/backend-app/pyproject.toml @@ -20,6 +20,8 @@ psycopg2-binary = "^2.9.9" [tool.poetry.group.dev.dependencies] pytest = "^8.3.2" black = "^24.4.2" +coverage = "^7.6.0" +pytest-cov = "^5.0.0" [build-system] requires = ["poetry-core"] From 2a2a3719f8b6c2d9a82141f61145f9526a14f4cb Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:04:24 +0200 Subject: [PATCH 2/7] Fix working-directory --- .github/workflows/python_app.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python_app.yml b/.github/workflows/python_app.yml index 7e3e25e1..08b0eb7b 100644 --- a/.github/workflows/python_app.yml +++ b/.github/workflows/python_app.yml @@ -12,7 +12,9 @@ permissions: jobs: build: runs-on: ubuntu-latest - working-directory: backend-app + defaults: + run: + working-directory: backend-app env: FASTAPI_SECRET_KEY: ${{secrets.FASTAPI_SECRET_KEY}} FASTAPI_HASH_ALGORITHM: ${{secrets.FASTAPI_HASH_ALGORITHM}} From 43c43fe7fc8f22b731e2f160843ec881d24f84c8 Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:06:26 +0200 Subject: [PATCH 3/7] Add flake8 to poetry --- backend-app/poetry.lock | 51 +++++++++++++++++++++++++++++++++++++- backend-app/pyproject.toml | 1 + 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/backend-app/poetry.lock b/backend-app/poetry.lock index 2678eb4b..d5b73fab 100644 --- a/backend-app/poetry.lock +++ b/backend-app/poetry.lock @@ -383,6 +383,22 @@ typer = ">=0.12.3" [package.extras] standard = ["fastapi", "uvicorn[standard] (>=0.15.0)"] +[[package]] +name = "flake8" +version = "7.1.0" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.1.0-py2.py3-none-any.whl", hash = "sha256:2e416edcc62471a64cea09353f4e7bdba32aeb079b6e360554c659a122b1bc6a"}, + {file = "flake8-7.1.0.tar.gz", hash = "sha256:48a07b626b55236e0fb4784ee69a465fbf59d79eec1f5b4785c3d3bc57d17aa5"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" + [[package]] name = "greenlet" version = "3.0.3" @@ -690,6 +706,17 @@ files = [ {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, ] +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -997,6 +1024,17 @@ files = [ {file = "pyasn1-0.6.0.tar.gz", hash = "sha256:3a35ab2c4b5ef98e17dfdec8ab074046fbda76e281c5a706ccd82328cfc8f64c"}, ] +[[package]] +name = "pycodestyle" +version = "2.12.0" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.12.0-py2.py3-none-any.whl", hash = "sha256:949a39f6b86c3e1515ba1787c2022131d165a8ad271b11370a8819aa070269e4"}, + {file = "pycodestyle-2.12.0.tar.gz", hash = "sha256:442f950141b4f43df752dd303511ffded3a04c2b6fb7f65980574f0c31e6e79c"}, +] + [[package]] name = "pycparser" version = "2.22" @@ -1131,6 +1169,17 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + [[package]] name = "pygments" version = "2.18.0" @@ -1765,4 +1814,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "7cef09b910d0ec33f37765b06c5c68176db3bceae381f979f6043295a64bbe0e" +content-hash = "6a0a91f11ae2622c1771c6075c97704717d06ec58fce46a92854f7fa00533c5a" diff --git a/backend-app/pyproject.toml b/backend-app/pyproject.toml index 82711070..0fc2aa8f 100644 --- a/backend-app/pyproject.toml +++ b/backend-app/pyproject.toml @@ -22,6 +22,7 @@ pytest = "^8.3.2" black = "^24.4.2" coverage = "^7.6.0" pytest-cov = "^5.0.0" +flake8 = "^7.1.0" [build-system] requires = ["poetry-core"] From eeaadcd521f0398cbe1f559a06eb31eb83e0247c Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:14:16 +0200 Subject: [PATCH 4/7] Fix formatting, and black --- .github/workflows/python_app.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python_app.yml b/.github/workflows/python_app.yml index 08b0eb7b..7656ccb5 100644 --- a/.github/workflows/python_app.yml +++ b/.github/workflows/python_app.yml @@ -32,9 +32,8 @@ jobs: run: | python -m pip install --upgrade pip pip install poetry==1.8.3 - poetry install --no-cache - if [ -f pyproject.toml]; then poetry install - elif [-f requirements.txt ]; then pip install -r requirements.txt; + if [ -f pyproject.toml ]; then poetry install + elif [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | @@ -44,13 +43,13 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Black check run: | - black --check app/ - enforce: - always: + black --check app/ + enforce: + always: - name: Test with pytest run: | # Test backend - coverage run --source=app -m pytest tests - coverage report -m + coverage run --source=app -m pytest tests + coverage report -m From d858a6a39bdb903dc4c7f06ac9830300ad5e775f Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:17:14 +0200 Subject: [PATCH 5/7] Use poetry run ... --- .github/workflows/python_app.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python_app.yml b/.github/workflows/python_app.yml index 7656ccb5..4de24e94 100644 --- a/.github/workflows/python_app.yml +++ b/.github/workflows/python_app.yml @@ -37,19 +37,17 @@ jobs: 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 + poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Black check run: | - black --check app/ + poetry run black --check app/ enforce: always: - name: Test with pytest run: | # Test backend - coverage run --source=app -m pytest tests - coverage report -m + poetry run coverage run --source=app -m pytest tests + poetry run coverage report -m From 5d7bdd1721770ac1e084e3569c221bebcff67be9 Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:18:39 +0200 Subject: [PATCH 6/7] Remove enforce from black --- .github/workflows/python_app.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/python_app.yml b/.github/workflows/python_app.yml index 4de24e94..70b96d51 100644 --- a/.github/workflows/python_app.yml +++ b/.github/workflows/python_app.yml @@ -42,8 +42,6 @@ jobs: - name: Black check run: | poetry run black --check app/ - enforce: - always: - name: Test with pytest run: | # Test backend From 50fa21fdeb34e3ebb5a1e5fe35f113c349aec3b9 Mon Sep 17 00:00:00 2001 From: Rudolf Braun <48672663+BraunRudolf@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:27:02 +0200 Subject: [PATCH 7/7] Rename github action --- .github/workflows/{python_app.yml => fastapi_app.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{python_app.yml => fastapi_app.yml} (100%) diff --git a/.github/workflows/python_app.yml b/.github/workflows/fastapi_app.yml similarity index 100% rename from .github/workflows/python_app.yml rename to .github/workflows/fastapi_app.yml