From 3de371a477614d1fa30ab93e8876aafa0c723d73 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:42:32 +0200 Subject: [PATCH 1/8] ci: perform minimal requirements tests --- .github/workflows/ci_cd.yml | 47 ++++++++++++++++++++++++++++++++++++- pyproject.toml | 9 ++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6c032bd19e..443215b438 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -437,9 +437,54 @@ jobs: docker rm ${{ env.GEO_CONT_NAME }} fi + testing-min-reqs: + name: Testing with minimum requirements + needs: [smoke-tests] + runs-on: ubuntu-latest + steps: + - name: Login in Github Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pull and launch geometry service + run: | + docker pull ${{ env.ANSRV_GEO_IMAGE }}:linux-latest + docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.docker-image }} + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python ${{ env.MAIN_PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - name: Install minimum requirements + run: | + python -m pip install --upgrade pip + pip install -e .[tests-minimal] + pip install pytest + + - name: Run pytest + run: | + pytest -v + + - name: Stop the Geometry service + if: always() + run: | + then + docker stop ${{ env.GEO_CONT_NAME }} + docker logs ${{ env.GEO_CONT_NAME }} + docker rm ${{ env.GEO_CONT_NAME }} + fi + + package: name: Package library - needs: [testing-windows, testing-linux, docs] + needs: [testing-windows, testing-linux, testing-min-reqs, docs] runs-on: ubuntu-latest steps: - name: Build library source and wheel artifacts diff --git a/pyproject.toml b/pyproject.toml index b79b8de1c9..3fb160cce8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,10 +35,11 @@ dependencies = [ "Pint>=0.18,<1", "protobuf>=3.20.2,<5", "pyvista>=0.37.0,<1", + "requests>=2,<3", "scipy>=1.7.3,<2", + "semver>=3,<4", "six>=1.16.0,<2", "vtk>=9,<10", - "semver>=3,<4", ] [project.optional-dependencies] @@ -70,6 +71,12 @@ tests = [ "six==1.16.0", "vtk==9.3.0", ] +tests-minimal = [ + "pytest==8.1.1", + "pytest-cov==5.0.0", + "pytest-pyvista==0.1.9", + "pytest-xvfb==3.0.0", +] doc = [ "ansys-sphinx-theme[autoapi]==0.15.2", "beartype==0.18.2", From 69ef620dc20216838a91fb327e8a7bdadbe65087 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:44:39 +0000 Subject: [PATCH 2/8] chore: auto fixes from pre-commit hooks --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 443215b438..ddc2dbcca7 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -461,13 +461,13 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - + - name: Install minimum requirements run: | python -m pip install --upgrade pip pip install -e .[tests-minimal] pip install pytest - + - name: Run pytest run: | pytest -v From 2e60216c33b44516e5ae416f01663c2f014e08b8 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot Date: Mon, 22 Apr 2024 10:46:10 +0000 Subject: [PATCH 3/8] Adding changelog entry: 1153.changed.md --- doc/changelog.d/1153.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/1153.changed.md diff --git a/doc/changelog.d/1153.changed.md b/doc/changelog.d/1153.changed.md new file mode 100644 index 0000000000..1a21fbd17e --- /dev/null +++ b/doc/changelog.d/1153.changed.md @@ -0,0 +1 @@ +ci: perform minimal requirements tests \ No newline at end of file From ccb170c3867a685599a4b39729546dde1f9f5896 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:53:58 +0200 Subject: [PATCH 4/8] fix: usage of docker image --- .github/workflows/ci_cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index ddc2dbcca7..2299d9d6b4 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -441,6 +441,8 @@ jobs: name: Testing with minimum requirements needs: [smoke-tests] runs-on: ubuntu-latest + env: + ANSRV_GEO_IMAGE_MINREQS: 'ghcr.io/ansys/geometry:linux-latest' steps: - name: Login in Github Container registry uses: docker/login-action@v3 @@ -451,8 +453,8 @@ jobs: - name: Pull and launch geometry service run: | - docker pull ${{ env.ANSRV_GEO_IMAGE }}:linux-latest - docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.docker-image }} + docker pull ${{ env.ANSRV_GEO_IMAGE_MINREQS }} + docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_MINREQS }} - name: Checkout repository uses: actions/checkout@v4 From 7fce75b63c1ff7e866dd7ac6d74a0b5f11499c6d Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:00:51 +0200 Subject: [PATCH 5/8] fix: potential test issues --- .github/workflows/ci_cd.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 2299d9d6b4..fa64a5dbc6 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -467,7 +467,7 @@ jobs: - name: Install minimum requirements run: | python -m pip install --upgrade pip - pip install -e .[tests-minimal] + pip install -e .[all,tests-minimal] pip install pytest - name: Run pytest diff --git a/pyproject.toml b/pyproject.toml index 3fb160cce8..949b55cf41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ dependencies = [ all = [ "ansys-platform-instancemanagement>=1.0.3,<2", "docker>=6.0.1,<8", - "pyvista[jupyter]>=0.38.1,<0.42", + "pyvista[jupyter]>=0.38.1,<1", ] tests = [ "ansys-platform-instancemanagement==1.1.2", From 867d29c8d144491268a09543a77be16f763208c6 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:09:59 +0200 Subject: [PATCH 6/8] feat: testing min reqs for all Python versions --- .github/workflows/ci_cd.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index fa64a5dbc6..26ef09a439 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -443,6 +443,10 @@ jobs: runs-on: ubuntu-latest env: ANSRV_GEO_IMAGE_MINREQS: 'ghcr.io/ansys/geometry:linux-latest' + strategy: + fail-fast: false + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - name: Login in Github Container registry uses: docker/login-action@v3 @@ -459,10 +463,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Python ${{ env.MAIN_PYTHON_VERSION }} + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} + python-version: ${{ matrix.python-version }} - name: Install minimum requirements run: | From dde03ce9fe0d3e0ee21b931f3737f16dfaf17608 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:10:12 +0200 Subject: [PATCH 7/8] fix: typo when removing if conditional --- .github/workflows/ci_cd.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 26ef09a439..b89c9e43a4 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -481,11 +481,9 @@ jobs: - name: Stop the Geometry service if: always() run: | - then - docker stop ${{ env.GEO_CONT_NAME }} - docker logs ${{ env.GEO_CONT_NAME }} - docker rm ${{ env.GEO_CONT_NAME }} - fi + docker stop ${{ env.GEO_CONT_NAME }} + docker logs ${{ env.GEO_CONT_NAME }} + docker rm ${{ env.GEO_CONT_NAME }} package: From c9eba9ea54c9e5b2b8b569619e6dbeafe87fac7f Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:10:22 +0200 Subject: [PATCH 8/8] fix: spacing --- .github/workflows/ci_cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b89c9e43a4..7547548a39 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -485,7 +485,6 @@ jobs: docker logs ${{ env.GEO_CONT_NAME }} docker rm ${{ env.GEO_CONT_NAME }} - package: name: Package library needs: [testing-windows, testing-linux, testing-min-reqs, docs]