Skip to content

Commit

Permalink
MAINT: Update (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Nov 16, 2023
1 parent c9ac04b commit d97aa5d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 12 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,14 @@ jobs:
- name: macOS - hdf5, libmatio, libomp and (optionally) OpenBLAS via brew
if: startswith(steps.env-vars.outputs.os,'macos')
run: |
echo "Installing dependencies with brew"
brew update > /dev/null
if [[ "${{steps.env-vars.outputs.blas}}" == "OpenBLAS" ]]; then
BREW_EXTRA=openblas
fi
brew install hdf5 libmatio libomp swig $BREW_EXTRA
echo "Installing dependencies with brew"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install hdf5 libmatio libomp swig $BREW_EXTRA
echo "brew install complete"
if [[ "${{steps.env-vars.outputs.blas}}" == "OpenBLAS" ]]; then
BLAS_DIR=/usr/local/opt/openblas
OPENBLAS_INCLUDE=$BLAS_DIR/include
Expand Down Expand Up @@ -488,6 +491,8 @@ jobs:
fi
echo "PYTHONPATH=$PYTHONPATH"
python -c "import openmeeg._openmeeg_wrapper as _omc; print(_omc.sqr(4)); assert _omc.sqr(4) == 16"
echo "pip show openmeeg:"
pip show openmeeg
fi
- name: Create, delocate, check, install, and test wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
vcpkg
build/vcpkg_installed
key: ${{ github.job }}-${{ hashFiles('**/vcpkg.json') }}-${{ matrix.os }}-${{ matrix.archs_macos }}-0
- uses: pypa/cibuildwheel@v2.12.3
- uses: pypa/cibuildwheel@v2.16.2
with:
package-dir: ./wrapping/python
output-dir: wheelhouse
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cibuildwheel_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
vcpkg
build/vcpkg_installed
key: ${{ github.job }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}-${{ matrix.os }}-${{ matrix.archs_macos }}-0
- uses: pypa/cibuildwheel@v2.8.0
- uses: pypa/cibuildwheel@v2.8.0 # 2.16.2 has a bug with "ELF load command address/offset not properly aligned"
with:
package-dir: ./wrapping/python
output-dir: installers
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.14)
project (OpenMEEG VERSION 2.5.9999 LANGUAGES C CXX)
project (OpenMEEG VERSION 2.5.7 LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17) # use c++17

Expand Down
24 changes: 20 additions & 4 deletions wrapping/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,44 @@ string(REGEX REPLACE "\n$" "" PYTHON_SITE_ARCH "${PYTHON_SITE_ARCH}")
message(STATUS "Python installation directory ${PYTHON_SITE_ARCH}")

# Copy our .py files over, dealing with Windows wildcard issues
set(PYTHON_OPENMEEG_SOURCE_DIR "${CMAKE_SOURCE_DIR}/wrapping/python/openmeeg")
message(STATUS "Python: Copying ${PYTHON_OPENMEEG_SOURCE_DIR} to ${CMAKE_CURRENT_BINARY_DIR}/openmeeg")
add_custom_command(
TARGET ${SWIG_TARGET_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/wrapping/python/openmeeg ${CMAKE_CURRENT_BINARY_DIR}/openmeeg
COMMENT "Python: Copying ${CMAKE_SOURCE_DIR}/wrapping/python/openmeeg to ${CMAKE_CURRENT_BINARY_DIR}/openmeeg"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PYTHON_OPENMEEG_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/openmeeg
VERBATIM
)
message(STATUS "Python: Copying MANIFEST.in, setup.py, setup.cfg, pyproject.toml, and README.rst to ${CMAKE_CURRENT_BINARY_DIR}/")
add_custom_command(
TARGET ${SWIG_TARGET_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/wrapping/python/MANIFEST.in
${CMAKE_SOURCE_DIR}/wrapping/python/setup.py
${CMAKE_SOURCE_DIR}/wrapping/python/setup.cfg
${CMAKE_SOURCE_DIR}/wrapping/python/pyproject.toml
${CMAKE_SOURCE_DIR}/wrapping/python/README.rst
${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Python: Copying MANIFEST.in, setup.py, and README.rst to ${CMAKE_CURRENT_BINARY_DIR}"
VERBATIM
)
file(STRINGS "${PYTHON_OPENMEEG_SOURCE_DIR}/_version.py" PYTHON_OPENMEEG_VERSION)
message(STATUS "Python: Extracted from openmeeg/_version.py: ${PYTHON_OPENMEEG_VERSION}")
string(REGEX REPLACE "^__version__ = \"([0-9deva-f.]+)\"$" "\\1" PYTHON_OPENMEEG_VERSION "${PYTHON_OPENMEEG_VERSION}")
message(STATUS "Python: Generating ${CMAKE_CURRENT_BINARY_DIR}/openmeeg-${PYTHON_OPENMEEG_VERSION}.dist_info")
add_custom_command(
TARGET ${SWIG_TARGET_NAME} PRE_BUILD
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${Python3_EXECUTABLE} setup.py dist_info
VERBATIM
)
message(STATUS "Python: Expecting to install ${OpenMEEG_BINARY_DIR}/wrapping/python/openmeeg-${PYTHON_OPENMEEG_VERSION}.dist-info")

# Installation just copies the directory
install(DIRECTORY ${OpenMEEG_BINARY_DIR}/wrapping/python/openmeeg
DESTINATION ${PYTHON_SITE_ARCH}
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

install(DIRECTORY ${OpenMEEG_BINARY_DIR}/wrapping/python/openmeeg-${PYTHON_OPENMEEG_VERSION}.dist-info
DESTINATION ${PYTHON_SITE_ARCH}
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
if (APPLE)
set_target_properties(${SWIG_TARGET_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif()
Expand Down
2 changes: 1 addition & 1 deletion wrapping/python/openmeeg/_make_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def make_geometry(meshes, interfaces, domains):
f"Domain {dname} contains and unknown interface {iname}."
)
oriented_meshes = interfaces[iname]
if type(oriented_meshes) != list or len(oriented_meshes) == 0:
if not isinstance(oriented_meshes, list) or len(oriented_meshes) == 0:
raise Exception(
f"Interface definition {iname} first argument should be a "
"non-empty list of (mesh,orientation)"
Expand Down
2 changes: 1 addition & 1 deletion wrapping/python/openmeeg/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.6.0.dev2"
__version__ = "2.5.7"
4 changes: 2 additions & 2 deletions wrapping/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Minimum requirements for the build system to execute.
# TODO: We should look at SciPy and set mins for these like they do
requires = [
"setuptools==59.2.0",
"wheel==0.37.0",
"setuptools>=68.0.0",
"wheel>=0.37.0",
"oldest-supported-numpy; platform_python_implementation!='PyPy'",
"numpy==1.23.0; platform_python_implementation=='PyPy'",
]
Expand Down

0 comments on commit d97aa5d

Please sign in to comment.