From a75d9e9eedd81fa0cbfa9bf05bff44adcb6ced7b Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 11 Jan 2024 16:06:27 -0800 Subject: [PATCH 1/7] Adding an initial workflow file --- .github/workflows/python-package.yml | 40 ++++++++++++++++++++++++++++ README.md | 8 ++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/python-package.yml create mode 100644 README.md diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 00000000..95ea830b --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +name: geosPythonPackages CI +on: pull_request + +# Cancels in-progress workflows for a PR when updated +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + package-name: ["geos_ats_package" "geosx_mesh_doctor" "geosx_mesh_tools_package" "geosx_xml_tools_package" "hdf5_wrapper_package" "pygeosx_tools_package" "timehistory_package"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install package + working-directory: ./${{ package-name }} + run: | + python -m pip install --upgrade pip + python -m pip install pytest yapf toml + cd + python -m pip install . + - name: Lint with yapf + working-directory: ./${{ package-name }} + run: | + yapf -r --diff . + # - name: Test with pytest + # working-directory: ./${{ package-name }} + # run: | + # pytest diff --git a/README.md b/README.md new file mode 100644 index 00000000..db80def7 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ + +Welcome to the GEOS Python Package Repository! +----------------------------------------------- + +This repository contains a set of python packages that are used alongside [GEOS](https://github.com/GEOS-DEV/GEOS). +They can be installed automatically by running "make geosx_python_tools" in the GEOS build directory, or can be installed manually with pip. +See the [documentation](https://geosx-geosx.readthedocs-hosted.com/projects/geosx-geospythonpackages/en/latest/) for additional details about the packages and how to use them. + From 4158922303eb7bfd4cfc1ca22fcca02823bfc769 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 11 Jan 2024 16:40:59 -0800 Subject: [PATCH 2/7] Fixing workflow matrix --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 95ea830b..a16df729 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11"] - package-name: ["geos_ats_package" "geosx_mesh_doctor" "geosx_mesh_tools_package" "geosx_xml_tools_package" "hdf5_wrapper_package" "pygeosx_tools_package" "timehistory_package"] + package-name: ["geos_ats_package", "geosx_mesh_doctor", "geosx_mesh_tools_package", "geosx_xml_tools_package", "hdf5_wrapper_package", "pygeosx_tools_package", "timehistory_package"] steps: - uses: actions/checkout@v3 From e73eaab47edcb410d58e95a2b30e60e63a275c4b Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 11 Jan 2024 16:43:16 -0800 Subject: [PATCH 3/7] Fixing workflow variables --- .github/workflows/python-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a16df729..ea9f5ba2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -24,17 +24,17 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install package - working-directory: ./${{ package-name }} + working-directory: ./${{ matrix.package-name }} run: | python -m pip install --upgrade pip python -m pip install pytest yapf toml cd python -m pip install . - name: Lint with yapf - working-directory: ./${{ package-name }} + working-directory: ./${{ matrix.package-name }} run: | yapf -r --diff . # - name: Test with pytest - # working-directory: ./${{ package-name }} + # working-directory: ./${{ matrix.package-name }} # run: | # pytest From 53a1bcdecebbff95be883dfad65cce5d53d8c7dc Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 11 Jan 2024 16:46:30 -0800 Subject: [PATCH 4/7] Removing extra cd command in workflows --- .github/workflows/python-package.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ea9f5ba2..b380b890 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -28,7 +28,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest yapf toml - cd python -m pip install . - name: Lint with yapf working-directory: ./${{ matrix.package-name }} From c6888c5d1063a869c6e73afaee44942d84c35d59 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 11 Jan 2024 16:59:09 -0800 Subject: [PATCH 5/7] Setting up mpi4py in the CI, fixing timehistory config --- .github/workflows/python-package.yml | 11 ++++++----- timehistory_package/setup.cfg | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b380b890..66e86fbb 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -10,7 +10,7 @@ concurrency: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -19,6 +19,7 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: mpi4py/setup-mpi@v1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: @@ -29,10 +30,10 @@ jobs: python -m pip install --upgrade pip python -m pip install pytest yapf toml python -m pip install . - - name: Lint with yapf - working-directory: ./${{ matrix.package-name }} - run: | - yapf -r --diff . + # - name: Lint with yapf + # working-directory: ./${{ matrix.package-name }} + # run: | + # yapf -r --diff . # - name: Test with pytest # working-directory: ./${{ matrix.package-name }} # run: | diff --git a/timehistory_package/setup.cfg b/timehistory_package/setup.cfg index e6e34647..04967be0 100644 --- a/timehistory_package/setup.cfg +++ b/timehistory_package/setup.cfg @@ -8,7 +8,7 @@ license = LGPL-2.1 [options] packages = - plot_time_history + timehistory install_requires = matplotlib hdf5_wrapper From d9ae5ba826d37e001cb91c466cf9ae1e4715aa99 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 11 Jan 2024 17:02:12 -0800 Subject: [PATCH 6/7] Modifying the timehistory prerequisites list --- timehistory_package/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timehistory_package/setup.cfg b/timehistory_package/setup.cfg index 04967be0..8201bb1b 100644 --- a/timehistory_package/setup.cfg +++ b/timehistory_package/setup.cfg @@ -11,6 +11,6 @@ packages = timehistory install_requires = matplotlib - hdf5_wrapper + h5py numpy python_requires = >=3.6 From 2c9da4bfa5857856c8ee1d1da01861b11c566e87 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Thu, 18 Jan 2024 09:37:38 -0800 Subject: [PATCH 7/7] Adding python 3.8 to CI test matrix --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 66e86fbb..132f41dc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] package-name: ["geos_ats_package", "geosx_mesh_doctor", "geosx_mesh_tools_package", "geosx_xml_tools_package", "hdf5_wrapper_package", "pygeosx_tools_package", "timehistory_package"] steps: