Skip to content

Commit

Permalink
Fix for conda package build on macOS (#60)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
roopchansinghv authored Aug 16, 2022
1 parent d8de67d commit c2cb012
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ismrmrd_python_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build-conda-packages:
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
Expand Down
2 changes: 1 addition & 1 deletion conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -euo pipefail

python setup.py install
pip install .
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def to_uri(filename):

setup(
name='ismrmrd',
version='1.12.3',
version='1.12.4',
author='ISMRMRD Developers',
description='Python implementation of the ISMRMRD',
license='Public Domain',
Expand All @@ -74,7 +74,7 @@ def to_uri(filename):
'Operating System :: OS Independent',
'Topic :: Scientific/Engineering :: Medical Science Apps.'
],
install_requires=['xsdata>=22.2', 'numpy', 'h5py>=2.3'],
install_requires=['xsdata>=22.2', 'numpy>=1.22.0', 'h5py>=2.3'],
setup_requires=['nose>=1.0', 'xsdata[cli]>=22.2', 'jinja2 >= 2.11'],
test_suite='nose.collector',
cmdclass={'build_py':my_build_py}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def test_initialization_sets_nonzero_version():

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

assert acquisition.version is not 0, \
assert acquisition.version != 0, \
"Default acquisition version should not be zero."


Expand Down
8 changes: 4 additions & 4 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_initialization_sets_nonzero_version():

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

assert image.version is not 0, \
assert image.version != 0, \
"Default image version should not be zero."


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

assert image.channels is 1, \
assert image.channels == 1, \
"Unexpected number of channels: {}".format(image.channels)

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

assert image.channels is 1, \
assert image.channels == 1, \
"Unexpected number of channels: {}".format(image.channels)

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

assert image.channels is 16, \
assert image.channels == 16, \
"Unexpected number of channels: {}".format(image.channels)

assert image.matrix_size == (32, 64, 128), \
Expand Down
2 changes: 1 addition & 1 deletion tests/test_waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_initialization_sets_nonzero_version():

waveform = common.create_random_waveform()

assert waveform.version is not 0, \
assert waveform.version != 0, \
"Default acquisition version should not be zero."


Expand Down

0 comments on commit c2cb012

Please sign in to comment.