Skip to content

Commit c6c3a64

Browse files
committed
GHA: Install with pip
1 parent 486d6a8 commit c6c3a64

File tree

4 files changed

+85
-60
lines changed

4 files changed

+85
-60
lines changed

.github/workflows/main.yml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,59 @@
11
name: github-CI
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
411

512
jobs:
6-
build:
7-
13+
test:
814
runs-on: ${{ matrix.os }}
915
strategy:
1016
fail-fast: false
1117
matrix:
12-
os: [ubuntu-latest, macos-latest]
13-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
14-
name: Python ${{ matrix.python-version }} example (${{ matrix.os }})
15-
16-
defaults:
17-
run:
18-
shell: bash -el {0}
18+
os:
19+
- ubuntu-latest
20+
- macos-latest
21+
mpi:
22+
- mpich
23+
- openmpi
24+
python-version:
25+
- "3.7"
26+
- "3.8"
27+
- "3.9"
28+
- "3.10"
29+
- "3.11"
30+
- "3.12-dev"
1931

2032
steps:
2133

2234
- uses: actions/checkout@v3
2335

24-
- uses: conda-incubator/setup-miniconda@v2
36+
- uses: actions/setup-python@v4
2537
with:
26-
miniforge-variant: Mambaforge
27-
miniforge-version: latest
28-
channel-priority: strict
2938
python-version: ${{ matrix.python-version }}
30-
conda-build-version: '*'
3139

32-
- run: conda install -n root numpy fftw
33-
- run: conda build --python ${{ matrix.python-version }} ./conf
34-
- run: conda install --use-local mpi4py_fft_test
40+
- run: |
41+
# Install fftw
42+
case $(uname) in
43+
Linux)
44+
sudo apt update && sudo apt install -y -q fftw-dev
45+
;;
46+
Darwin)
47+
brew install fftw
48+
;;
49+
esac
50+
51+
- run: python -m pip install -U pip build
52+
53+
- run: python -m build
54+
55+
- uses: mpi4py/setup-mpi@v1
56+
with:
57+
mpi: ${{ matrix.mpi }}
58+
59+
- run: pip install -vvv dist/mpi4py_fft-*.whl

azure-pipelines.yml

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
jobs:
2-
- job: macOS
3-
displayName: macos-latest
4-
pool:
5-
vmImage: 'macos-latest'
6-
strategy:
7-
matrix:
8-
Python37:
9-
python.version: '3.7'
10-
Python38:
11-
python.version: '3.8'
12-
Python39:
13-
python.version: '3.9'
14-
Python310:
15-
python.version: '3.10'
16-
17-
steps:
18-
- bash: echo "##vso[task.prependpath]$CONDA/bin"
19-
displayName: Add conda to PATH
20-
21-
- bash: sudo chown -R $USER $CONDA
22-
displayName: Take ownership of conda installation
23-
24-
- bash: |
25-
conda config --add channels conda-forge
26-
conda config --set always_yes yes
27-
conda install -n root conda-build numpy fftw
28-
displayName: Set up Anaconda
29-
30-
- bash: |
31-
conda build --python $PYTHON_VERSION ./conf
32-
displayName: Build and test
2+
# - job: macOS
3+
# displayName: macos-latest
4+
# pool:
5+
# vmImage: 'macos-latest'
6+
# strategy:
7+
# matrix:
8+
# Python37:
9+
# python.version: '3.7'
10+
# Python38:
11+
# python.version: '3.8'
12+
# Python39:
13+
# python.version: '3.9'
14+
# Python310:
15+
# python.version: '3.10'
16+
#
17+
# steps:
18+
# - bash: echo "##vso[task.prependpath]$CONDA/bin"
19+
# displayName: Add conda to PATH
20+
#
21+
# - bash: sudo chown -R $USER $CONDA
22+
# displayName: Take ownership of conda installation
23+
#
24+
# - bash: |
25+
# conda config --add channels conda-forge
26+
# conda config --set always_yes yes
27+
# conda install -n root conda-build numpy fftw
28+
# displayName: Set up Anaconda
29+
#
30+
# - bash: |
31+
# conda build --python $PYTHON_VERSION ./conf
32+
# displayName: Build and test
3333

3434
- job: Ubuntu
3535
displayName: Ubuntu
@@ -45,6 +45,8 @@ jobs:
4545
python.version: '3.9'
4646
Python310:
4747
python.version: '3.10'
48+
Python311:
49+
python.version: '3.11'
4850

4951
steps:
5052
- bash: echo "##vso[task.prependpath]$CONDA/bin"
@@ -53,13 +55,16 @@ jobs:
5355
- bash: |
5456
conda config --add channels conda-forge
5557
conda config --set always_yes yes
56-
conda install -n root conda-build numpy fftw
58+
conda install -n root mpi4py mpich numpy fftw
5759
displayName: Set up Anaconda
5860
5961
- bash: |
60-
conda build --no-test --python $PYTHON_VERSION ./conf
61-
conda create --name mpi4py_fft_env mpi4py_fft_test coverage scipy pyfftw=0.12 python=$PYTHON_VERSION --use-local
62+
conda create --name mpi4py_fft_env \
63+
python=$PYTHON_VERSION \
64+
numpy fftw mpi4py mpich \
65+
pyfftw=0.12 scipy coverage
6266
source activate mpi4py_fft_env
67+
pip install -vvv --no-deps .
6368
pip install codecov
6469
cd tests && ./runtests.sh
6570
displayName: Build and test

tests/test_mpifft.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def test_mpifft():
152152
fft.backward.input_array.shape)
153153
assert (fft.backward.output_pencil.subshape ==
154154
fft.backward.output_array.shape)
155-
assert np.alltrue(np.array(fft.global_shape(True)) == np.array(fft.forward.output_pencil.shape))
156-
assert np.alltrue(np.array(fft.global_shape(False)) == np.array(fft.forward.input_pencil.shape))
155+
assert np.all(np.array(fft.global_shape(True)) == np.array(fft.forward.output_pencil.shape))
156+
assert np.all(np.array(fft.global_shape(False)) == np.array(fft.forward.input_pencil.shape))
157157
ax = -1 if axes is None else axes[-1] if isinstance(axes[-1], int) else axes[-1][-1]
158158
assert fft.forward.input_pencil.substart[ax] == 0
159159
assert fft.backward.output_pencil.substart[ax] == 0

tests/test_speed.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
from time import time
22
import numpy as np
3+
import pyfftw
34
import scipy.fftpack as sp
45
from mpi4py_fft import fftw
56
import pickle
67

7-
try:
8-
import pyfftw
9-
except ImportError:
10-
print('pyFFTW not available')
11-
raise SystemExit(0)
12-
138
try:
149
#fftw.import_wisdom('wisdom.dat')
1510
pyfftw.import_wisdom(pickle.load(open('pyfftw.wisdom', 'rb')))

0 commit comments

Comments
 (0)