From ff634f26680e4dab6b64e20fd34193442ab495a5 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 09:28:16 +0200 Subject: [PATCH 01/10] run CI on the three os --- .github/workflows/build-and-test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1aa16d61..df79076d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -13,11 +13,15 @@ on: - cron: "0 0 * * *" jobs: - build-linux: - runs-on: ubuntu-latest + build-and-test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-13", "windows-latest"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v2 From 011e38ff21067806ef57d2bc9bf64218eb72968f Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 10:40:19 +0200 Subject: [PATCH 02/10] scikit-umfpack not available on conda-forge on Windows --- environment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index e52a34fe..1874a774 100644 --- a/environment.yml +++ b/environment.yml @@ -9,11 +9,11 @@ dependencies: - numpy>=1.22.4 - scipy - pypardiso # [x86 or x86_64] - - scikit-umfpack # [(not x86) and (not x86_64)] + - scikit-umfpack # [(not win) and (not x86) and (not x86_64)] - vtk>=9.2 - pyvista>=0.39 - simcoon - pytest - pytest-xdist - sphinx_rtd_theme - - sphinx-gallery \ No newline at end of file + - sphinx-gallery From 4e88fcc3ea6300ee4a159b05aa914eaf4c19d663 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 10:50:30 +0200 Subject: [PATCH 03/10] not using environment for windows environment --- .github/workflows/build-and-test.yml | 10 +++++++--- environment.yml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index df79076d..0df9562f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniforge-variant: Mambaforge miniforge-version: latest @@ -46,9 +46,13 @@ jobs: CACHE_NUMBER: 0 id: cache - - name: Update environment + - name: Update environment Unix run: mamba env update -n fedoo -f environment.yml - if: steps.cache.outputs.cache-hit != 'true' + if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'windows-latest' + + - name: Update environment Windows + run: mamba install -n fedoo python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 simcoon pytest pytest-xdist + if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'windows-latest' - name: Install shell: bash -l {0} diff --git a/environment.yml b/environment.yml index 1874a774..b3bd7c36 100644 --- a/environment.yml +++ b/environment.yml @@ -9,7 +9,7 @@ dependencies: - numpy>=1.22.4 - scipy - pypardiso # [x86 or x86_64] - - scikit-umfpack # [(not win) and (not x86) and (not x86_64)] + - scikit-umfpack # [(not x86) and (not x86_64)] - vtk>=9.2 - pyvista>=0.39 - simcoon From 77fe50fdbd3cf6b7015503e12b94267cdb88bc3d Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 11:00:20 +0200 Subject: [PATCH 04/10] not using environment for windows environment --- .github/workflows/build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0df9562f..9e349484 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -48,11 +48,11 @@ jobs: - name: Update environment Unix run: mamba env update -n fedoo -f environment.yml - if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'windows-latest' + if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows' - name: Update environment Windows run: mamba install -n fedoo python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 simcoon pytest pytest-xdist - if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'windows-latest' + if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' - name: Install shell: bash -l {0} From 34d91f23bb018807ac3dbef5a08cb56b0b7f50f2 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 11:04:12 +0200 Subject: [PATCH 05/10] not using environment for windows environment --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9e349484..f9daf35a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -51,7 +51,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows' - name: Update environment Windows - run: mamba install -n fedoo python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 simcoon pytest pytest-xdist + run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 simcoon pytest pytest-xdist if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' - name: Install From 26b0085a63c41dbd7f0cba655db161f5c3b4c56e Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 11:06:16 +0200 Subject: [PATCH 06/10] not using environment for windows environment --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f9daf35a..83b3b4bb 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -51,7 +51,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows' - name: Update environment Windows - run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 simcoon pytest pytest-xdist + run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 set3mah::simcoon pytest pytest-xdist if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' - name: Install From a0e3bccf59b14a5a3251ac83f4df48f965b4ee4a Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 11:15:25 +0200 Subject: [PATCH 07/10] try to debug tests --- .github/workflows/build-and-test.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 83b3b4bb..8e2afe68 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -46,13 +46,16 @@ jobs: CACHE_NUMBER: 0 id: cache - - name: Update environment Unix - run: mamba env update -n fedoo -f environment.yml - if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows' + # - name: Update environment Unix + # run: mamba env update -n fedoo -f environment.yml + # if: steps.cache.outputs.cache-hit != 'true' && runner.os != 'Windows' - - name: Update environment Windows + # - name: Update environment Windows + # run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 set3mah::simcoon pytest pytest-xdist + # if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' + + - name: Debug tests (without scikit-umfpack) run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 set3mah::simcoon pytest pytest-xdist - if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' - name: Install shell: bash -l {0} From 79bf47662ab96249747c0c30035ab8bbdc658701 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 11:36:47 +0200 Subject: [PATCH 08/10] try to debug tests --- .github/workflows/build-and-test.yml | 31 +++++++++------------------- fedoo/homogen/__init__.py | 1 - 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8e2afe68..0dbfdbc4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -19,32 +19,21 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-13", "windows-latest"] + python-version: ["3.8", "3.12"] steps: - uses: actions/checkout@v4 - - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v3 + - uses: mamba-org/setup-micromamba@v1 with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: fedoo - use-mamba: true - - - name: Get Date - id: get-date - run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" - shell: bash - - - name: Cache Conda env - uses: actions/cache@v2 - with: - path: ${{ env.CONDA }}/envs - key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }} - env: - # Increase this value to reset cache if environment.yml has not changed - CACHE_NUMBER: 0 - id: cache + generate-run-shell: true + micromamba-version: "1.5.8-0" # any version from https://github.com/mamba-org/micromamba-releases + # environment-file: environment.yml + create-args: python=${{ matrix.python-version }} + init-shell: powershell bash + download-micromamba: true + cache-environment: false + post-cleanup: "all" # - name: Update environment Unix # run: mamba env update -n fedoo -f environment.yml diff --git a/fedoo/homogen/__init__.py b/fedoo/homogen/__init__.py index 4633007f..9359d909 100644 --- a/fedoo/homogen/__init__.py +++ b/fedoo/homogen/__init__.py @@ -1,6 +1,5 @@ """Homogen module for homogenization of composite materials.""" -from .Homog_path import Read_outputfile, SolverUnitCell, get_resultsUnitCell from .tangent_stiffness import ( get_homogenized_stiffness, get_homogenized_stiffness_2, From ece6b9b12c3825903c2d76114e11f883a39080b5 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 11:41:29 +0200 Subject: [PATCH 09/10] try to debug tests --- .github/workflows/build-and-test.yml | 38 ++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0dbfdbc4..733f1edf 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -29,7 +29,16 @@ jobs: generate-run-shell: true micromamba-version: "1.5.8-0" # any version from https://github.com/mamba-org/micromamba-releases # environment-file: environment.yml - create-args: python=${{ matrix.python-version }} + environment-name: fedoo + create-args: >- + python=${{ matrix.python-version }} + numpy + scipy + pypardiso + pyvista + set3mah::simcoon + pytest + pytest-xdist init-shell: powershell bash download-micromamba: true cache-environment: false @@ -43,13 +52,32 @@ jobs: # run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 set3mah::simcoon pytest pytest-xdist # if: steps.cache.outputs.cache-hit != 'true' && runner.os == 'Windows' - - name: Debug tests (without scikit-umfpack) - run: conda install -y python>=3.8 numpy>=1.22.4 scipy pypardiso pyvista>=0.39 set3mah::simcoon pytest pytest-xdist + # - name: Debug tests (without scikit-umfpack) + # if: runner.os != 'Windows' + # run: conda install -y + # shell: micromamba-shell {0} + + # - name: Debug tests (without scikit-umfpack) + # if: runner.os == 'Windows' + # run: conda install -y + # shell: pwsh + + - name: Install + if: runner.os != 'Windows' + shell: micromamba-shell {0} + run: pip install . + + - name: Test + if: runner.os != 'Windows' + shell: micromamba-shell {0} + run: pytest tests -n auto - name: Install - shell: bash -l {0} + if: runner.os == 'Windows' + shell: pwsh run: pip install . - name: Test - shell: bash -l {0} + if: runner.os == 'Windows' + shell: pwsh run: pytest tests -n auto From a56ebe1f3fff39dacffae7db9c56ef111c108ef8 Mon Sep 17 00:00:00 2001 From: Kevin Marchais Date: Tue, 18 Jun 2024 12:03:07 +0200 Subject: [PATCH 10/10] try to debug tests --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 733f1edf..aed13db3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-13", "windows-latest"] - python-version: ["3.8", "3.12"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v4