From f64864c173b25559c5e39e58b3415223e2c553e8 Mon Sep 17 00:00:00 2001 From: taniya-das Date: Wed, 12 Jul 2023 18:51:24 +0200 Subject: [PATCH 1/5] Revert "PR comments resolved" This reverts commit 09af05b7a8d4aa89e1a662a1549fe4afd0f86267. --- .github/workflows/pytest-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest-tests.yml b/.github/workflows/pytest-tests.yml index e178aed2..8ee73036 100644 --- a/.github/workflows/pytest-tests.yml +++ b/.github/workflows/pytest-tests.yml @@ -29,10 +29,11 @@ jobs: run: | python3.11 -m venv venv source venv/bin/activate - + echo "VIRTUAL ENV:" $VIRTUAL_ENV - name: Install dependencies run: | source venv/bin/activate + python -m pip install . python -m pip install ".[dev]" pre-commit install From 77595c161d79ae7f7c2f90a04387e40576a5490a Mon Sep 17 00:00:00 2001 From: taniya-das Date: Wed, 12 Jul 2023 18:52:32 +0200 Subject: [PATCH 2/5] Revert "tyo correction" This reverts commit 1cb1b19ecc3a1e4bc662e3b9d33149f055b9d3ae. --- .github/workflows/docker-image.yml | 43 ------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index c9ecd232..00000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Built docker image and run tests - -# This workflow is only triggered when something is pushed on develop branch. -# This workflow will built docker image and run tests inside the container. -# This workflow ensures that the after every change in "develop", the code is not breaking. -# This workflow is not executed for every PR because it seems unnecessary: we're already testing -# the PRs using a python virtual env instead of the docker. -# Also performing dockerized tests for every PR seems to be overkill." - -on: - push: - paths: - - '.github/workflows/docker-image.yml' - - 'pyproject.toml' - - 'Dockerfile' - branches: - - "develop" - - # allows to manually start a workflow run from the GitHub UI or using the GitHub API. - workflow_dispatch: - -jobs: - built: - runs-on: ubuntu-latest - permissions: - packages: write - - steps: - - uses: actions/checkout@v2 - - name: Build the docker image - run: docker build --tag ai4eu_server_demo:latest -f Dockerfile . - - - name: Run docker container and pytest tests - run: | - docker run -e KEYCLOAK_CLIENT_SECRET="mocked_secret" --entrypoint "" ai4eu_server_demo sh -c "pip install \".[dev]\" && pytest tests -s" - - - - - - - - From dd38ea029cf84cc23b8b964eb43fe164407c0830 Mon Sep 17 00:00:00 2001 From: taniya-das Date: Thu, 13 Jul 2023 16:29:16 +0200 Subject: [PATCH 3/5] Added pkg-config in Dockerfile, and updated dependency in pyproject.toml --- Dockerfile | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39564831..a2319bf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.11-slim-bullseye # default-mysql-client is not necessary, but can be useful when debugging connection issues. -RUN apt-get update && apt-get -y install python3-dev default-libmysqlclient-dev build-essential default-mysql-client +RUN apt-get update && apt-get -y install python3-dev default-libmysqlclient-dev build-essential default-mysql-client pkg-config WORKDIR /app diff --git a/pyproject.toml b/pyproject.toml index 331f94cd..493c5c3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,8 @@ dependencies = [ "httpx==0.24.1", "sickle==0.7.0", "xmltodict==0.13.0", - "python-multipart==0.0.6" + "python-multipart==0.0.6", + "mysql-connector-python==8.0.33", ] readme = "README.md" From b5c186f925386e28d094a07aa5c4006beea1351f Mon Sep 17 00:00:00 2001 From: taniya-das Date: Thu, 13 Jul 2023 16:37:09 +0200 Subject: [PATCH 4/5] revert any change to pytest workflow --- .github/workflows/pytest-tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pytest-tests.yml b/.github/workflows/pytest-tests.yml index 8ee73036..dc86ce7e 100644 --- a/.github/workflows/pytest-tests.yml +++ b/.github/workflows/pytest-tests.yml @@ -29,11 +29,10 @@ jobs: run: | python3.11 -m venv venv source venv/bin/activate - echo "VIRTUAL ENV:" $VIRTUAL_ENV + - name: Install dependencies run: | source venv/bin/activate - python -m pip install . python -m pip install ".[dev]" pre-commit install @@ -44,5 +43,4 @@ jobs: - name: Test with pytest run: | - source venv/bin/activate - pytest ./src/tests/ + source venv/bin/activate \ No newline at end of file From 80be1c36fa4b0b5877766794cac59cc09d023d88 Mon Sep 17 00:00:00 2001 From: taniya-das Date: Thu, 13 Jul 2023 16:38:47 +0200 Subject: [PATCH 5/5] revert any change to pytest workflow --- .github/workflows/pytest-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest-tests.yml b/.github/workflows/pytest-tests.yml index dc86ce7e..616e91f3 100644 --- a/.github/workflows/pytest-tests.yml +++ b/.github/workflows/pytest-tests.yml @@ -43,4 +43,5 @@ jobs: - name: Test with pytest run: | - source venv/bin/activate \ No newline at end of file + source venv/bin/activate + pytest ./src/tests/ \ No newline at end of file