From 121c2a6fc796ffdc6573bbc5ad9a7c8b6cd0169e Mon Sep 17 00:00:00 2001 From: David Ham Date: Wed, 21 Apr 2021 13:45:58 +0100 Subject: [PATCH 1/3] catch up with numpy type changes --- test/unit/test_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/test_api.py b/test/unit/test_api.py index 33309f9c7b..5c3f85aa1c 100644 --- a/test/unit/test_api.py +++ b/test/unit/test_api.py @@ -785,11 +785,11 @@ def test_dat_on_set_builds_dim_one_dataset(self, set): assert d.dataset.cdim == 1 def test_dat_dtype_type(self, dset): - "The type of a Dat's dtype property should by numpy.dtype." + "The type of a Dat's dtype property should be a numpy.dtype." d = op2.Dat(dset) - assert type(d.dtype) == np.dtype + assert isinstance(d.dtype, np.dtype) d = op2.Dat(dset, [1.0] * dset.size * dset.cdim) - assert type(d.dtype) == np.dtype + assert isinstance(d.dtype, np.dtype) def test_dat_split(self, dat): "Splitting a Dat should yield a tuple with self" From 948cb7dbb3f93b76f27d6aa2fd6694a973773ba2 Mon Sep 17 00:00:00 2001 From: David Ham Date: Wed, 21 Apr 2021 13:30:50 +0100 Subject: [PATCH 2/3] Pin decorator Decorator version 5 changes the API in ways that break the argument type checking in PyOP2. We're therefore pinning on the version that works. --- requirements-ext.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-ext.txt b/requirements-ext.txt index 758ccd9633..7c08299609 100644 --- a/requirements-ext.txt +++ b/requirements-ext.txt @@ -4,4 +4,4 @@ pytest>=2.3 flake8>=2.1.0 pycparser>=2.10 mpi4py>=1.3.1 -decorator +decorator<=4.4.2 From 5a89bfc9b60221b97f624397ddb07e92c2da9d2e Mon Sep 17 00:00:00 2001 From: Connor Ward Date: Mon, 10 May 2021 10:44:33 +0100 Subject: [PATCH 3/3] Use Firedrake PETSc and petsc4py --- .github/workflows/ci.yml | 61 +++++++++++++++++++++++++++++----------- requirements-git.txt | 2 -- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10b927bcb2..ffd53b3c26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest env: CC: mpicc - PETSC_CONFIGURE_OPTIONS: --with-debugging=1 - steps: - - name: Checkout repository - uses: actions/checkout@v2 + PETSC_DIR: ${{ github.workspace }}/petsc + PETSC_ARCH: default + PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 + steps: - name: Install system dependencies shell: bash run: | @@ -32,23 +32,50 @@ jobs: with: python-version: '3.6' - # xargs is used to force installation of requirements in the order we specified. - # pip 20.2 needed for loopy install to work. - - name: Install Python dependencies + - name: Clone PETSc + uses: actions/checkout@v2 + with: + repository: firedrakeproject/petsc + path: ${{ env.PETSC_DIR }} + + - name: Build and install PETSc shell: bash + working-directory: ${{ env.PETSC_DIR }} run: | - pip install pip==20.2 - xargs -l1 pip install < requirements-ext.txt - xargs -l1 pip install < requirements-git.txt - pip install pulp - pip install -U flake8 + ./configure ${PETSC_CONFIGURE_OPTIONS} + make - - name: Install PyOP2 + - name: Build and install petsc4py shell: bash - run: pip install -e . + working-directory: ${{ env.PETSC_DIR }}/src/binding/petsc4py + run: | + python -m pip install --upgrade cython numpy + python -m pip install --no-deps . - - name: Do tests + - name: Checkout PyOP2 + uses: actions/checkout@v2 + with: + path: PyOP2 + + - name: Install PyOP2 shell: bash + working-directory: PyOP2 run: | - make lint - py.test test -v --tb=native + python -m pip install pip==20.2 # pip 20.2 needed for loopy install to work. + + # xargs is used to force installation of requirements in the order we specified. + xargs -l1 python -m pip install < requirements-ext.txt + xargs -l1 python -m pip install < requirements-git.txt + python -m pip install pulp + python -m pip install -U flake8 + python -m pip install . + + - name: Run linting + shell: bash + working-directory: PyOP2 + run: make lint + + - name: Run tests + shell: bash + working-directory: PyOP2 + run: pytest test -v --tb=native diff --git a/requirements-git.txt b/requirements-git.txt index 718e273305..26bdc5abcf 100644 --- a/requirements-git.txt +++ b/requirements-git.txt @@ -1,4 +1,2 @@ -git+https://github.com/firedrakeproject/petsc.git@firedrake#egg=petsc ---no-deps git+https://github.com/firedrakeproject/petsc4py.git@firedrake#egg=petsc4py git+https://github.com/coneoproject/COFFEE.git#egg=coffee git+https://github.com/firedrakeproject/loopy.git@firedrake#egg=loopy