Skip to content

Commit c2cb012

Browse files
Fix for conda package build on macOS (#60)
* Addresses issue of .egg file in conda package not being properly installed on macOS. * Adding macos into automated build and testing workflow, as previous change did not break linux workflow. * Add version for numpy in setup.py. * Fixes for warnings about 'literals' in tests. * Increment version to denote fixes and availability on macOS.
1 parent d8de67d commit c2cb012

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.github/workflows/ismrmrd_python_conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build-conda-packages:
1111
strategy:
1212
matrix:
13-
os: [ubuntu-latest]
13+
os: [ubuntu-latest, macos-latest]
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

conda/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
set -euo pipefail
44

5-
python setup.py install
5+
pip install .

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def to_uri(filename):
5858

5959
setup(
6060
name='ismrmrd',
61-
version='1.12.3',
61+
version='1.12.4',
6262
author='ISMRMRD Developers',
6363
description='Python implementation of the ISMRMRD',
6464
license='Public Domain',
@@ -74,7 +74,7 @@ def to_uri(filename):
7474
'Operating System :: OS Independent',
7575
'Topic :: Scientific/Engineering :: Medical Science Apps.'
7676
],
77-
install_requires=['xsdata>=22.2', 'numpy', 'h5py>=2.3'],
77+
install_requires=['xsdata>=22.2', 'numpy>=1.22.0', 'h5py>=2.3'],
7878
setup_requires=['nose>=1.0', 'xsdata[cli]>=22.2', 'jinja2 >= 2.11'],
7979
test_suite='nose.collector',
8080
cmdclass={'build_py':my_build_py}

tests/test_acquisition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_initialization_sets_nonzero_version():
169169

170170
acquisition = ismrmrd.Acquisition.from_array(common.create_random_data())
171171

172-
assert acquisition.version is not 0, \
172+
assert acquisition.version != 0, \
173173
"Default acquisition version should not be zero."
174174

175175

tests/test_image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def test_initialization_sets_nonzero_version():
6767

6868
image = ismrmrd.Image.from_array(common.create_random_array((128, 128), dtype=np.float32))
6969

70-
assert image.version is not 0, \
70+
assert image.version != 0, \
7171
"Default image version should not be zero."
7272

7373

@@ -134,7 +134,7 @@ def test_initialization_with_2d_image():
134134
assert np.array_equal(image_data.transpose(), image.data.squeeze()), \
135135
"Image data does not match data used to initialize image."
136136

137-
assert image.channels is 1, \
137+
assert image.channels == 1, \
138138
"Unexpected number of channels: {}".format(image.channels)
139139

140140
assert image.matrix_size == (1, 64, 128), \
@@ -150,7 +150,7 @@ def test_initialization_with_3d_image():
150150
assert np.array_equal(image_data.transpose(), image.data.squeeze()), \
151151
"Image data does not match data used to initialize image."
152152

153-
assert image.channels is 1, \
153+
assert image.channels == 1, \
154154
"Unexpected number of channels: {}".format(image.channels)
155155

156156
assert image.matrix_size == (32, 64, 128), \
@@ -166,7 +166,7 @@ def test_initialization_with_3d_image_and_channels():
166166
assert np.array_equal(image_data.transpose(), image.data.squeeze()), \
167167
"Image data does not match data used to initialize image."
168168

169-
assert image.channels is 16, \
169+
assert image.channels == 16, \
170170
"Unexpected number of channels: {}".format(image.channels)
171171

172172
assert image.matrix_size == (32, 64, 128), \

tests/test_waveform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_initialization_sets_nonzero_version():
3131

3232
waveform = common.create_random_waveform()
3333

34-
assert waveform.version is not 0, \
34+
assert waveform.version != 0, \
3535
"Default acquisition version should not be zero."
3636

3737

0 commit comments

Comments
 (0)