Repository: pyswmm/swmm-python (language: python)

Issue:
Hotfix interim
Changes: 
This PR makes changes to fix several problems with the current wheel build and actions workflows:
 - Linux wheels were being broken when audited and made manylinux compliant
 - Version of libomp being packaged in the MacOS wheel was not binary compatible with Python
 - Path issues were causing missing libraries at runtime
 - Package name "swmm-toolkit" is not PEP 8, PEP 423 compliant
 - Pin dependency aenum==2.2.6 as workaround for regression in aenum v3.0 

Justification:
Several problems with the swmm-toolkit v0.8.1 wheels have been identified. These fixes have already been approved and merged into the develop branch. They are being recast as a hotfix PR to facilitate release of an updated v0.8.2 wheel.  


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index aea4d1e5..ec351a89 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -10,7 +10,7 @@ jobs:
   build_linux_wheels:
     name: Build wheels on linux
     runs-on: ubuntu-18.04
-    
+
     steps:
       - name: Checkout repo
         uses: actions/checkout@v2
@@ -25,10 +25,11 @@ jobs:
 
       - name: Script
         run: ./dockcross swmm-toolkit/tools/build-wheels.sh
-      
-      - uses: actions/upload-artifact@v2
+
+      - name: Upload artifacts
+        uses: actions/upload-artifact@v2
         with:
-          path: ./dist/swmm_toolkit-*-manylinux2014_x86_64.whl
+          path: ./dist/*.manylinux2014_x86_64.whl
 
 
 
@@ -36,8 +37,9 @@ jobs:
     name: Build wheels on ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
     defaults:
-      run:  
+      run:
         working-directory: ./swmm-toolkit
+
     strategy:
       fail-fast: false
       matrix:
@@ -47,11 +49,11 @@ jobs:
           - os: windows-2016
             sys_pkgs: choco install swig
             activate: ./build-env/Scripts/activate
-            
+
           - os: macos-10.15
-            sys_pkgs: brew install swig
+            sys_pkgs: brew install swig ninja
             activate: source ./build-env/bin/activate
-                
+
     steps:
       - name: Checkout repo
         uses: actions/checkout@v2
@@ -73,7 +75,7 @@ jobs:
           python -m pip install -r build-requirements.txt
           python setup.py bdist_wheel
           deactivate
-          
+
       - name: Test wheel
         run: |
           pip install -r test-requirements.txt
diff --git a/swmm-toolkit/CMakeLists.txt b/swmm-toolkit/CMakeLists.txt
index 72f5bfa3..73b9b359 100644
--- a/swmm-toolkit/CMakeLists.txt
+++ b/swmm-toolkit/CMakeLists.txt
@@ -2,9 +2,9 @@
 # CMakeLists.txt - CMake configuration file for swmm-toolkit python package
 #
 # Created:   Feb 6, 2020
-# Modified   Jan 12, 2021
+# Modified   Jun 7, 2021
 #
-#  Author:     See AUTHORS
+#  Author:   See AUTHORS
 #
 
 ################################################################################
@@ -15,7 +15,7 @@ cmake_minimum_required (VERSION 3.17)
 
 project(swmm-toolkit
     VERSION
-        0.8.1
+        0.8.2
 )
 
 
@@ -48,9 +48,7 @@ else()
 endif()
 
 
-# This gets passed down the project tree to trigger rpath configuration
-option(BUILD_WHEEL "Configure for python wheel build" ON)
-
+# Add project subdirectories
 add_subdirectory(swmm-solver)
 
 add_subdirectory(src/swmm/toolkit)
diff --git a/swmm-toolkit/build-requirements.txt b/swmm-toolkit/build-requirements.txt
index 8149a1aa..9f33934a 100644
--- a/swmm-toolkit/build-requirements.txt
+++ b/swmm-toolkit/build-requirements.txt
@@ -1,8 +1,7 @@
 
 
 
-setuptools
-wheel
-scikit-build
-cmake
-ninja
+setuptools==41.4.0
+wheel==0.33.6
+scikit-build==0.11.1
+cmake==3.18.4
diff --git a/swmm-toolkit/extern/openmp.cmake b/swmm-toolkit/extern/openmp.cmake
index 38b1f962..dbe2a09d 100644
--- a/swmm-toolkit/extern/openmp.cmake
+++ b/swmm-toolkit/extern/openmp.cmake
@@ -2,12 +2,14 @@
 # CMakeLists.txt - CMake configuration file for OpenMP Library on Darwin
 #
 # Created: Mar 17, 2021
-# Updated:
+# Updated: May 19, 2021
 #
 # Author: Michael E. Tryby
 #         US EPA ORD/CESER
 #
 # Note:
+#  Need to build libomp for binary compatibility with Python.
+#
 #  OpenMP library build fails for Xcode generator. Use Ninja or Unix Makefiles
 #  instead.
 #
diff --git a/swmm-toolkit/setup.py b/swmm-toolkit/setup.py
index c0d39dcf..2f1aff57 100644
--- a/swmm-toolkit/setup.py
+++ b/swmm-toolkit/setup.py
@@ -2,7 +2,7 @@
 # setup.py - Setup script for swmm-toolkit python package
 #
 # Created:    Jul 2, 2018
-# Updated:    May 7, 2020
+# Updated:    Jun 7, 2021
 #
 #  Author:    See AUTHORS
 #
@@ -87,14 +87,14 @@ def exclude_files(cmake_manifest):
 
 
 setup(
-    name = "swmm_toolkit",
-    version = "0.8.1",
+    name = "swmm-toolkit",
+    version = "0.8.2",
 
     packages = ["swmm_toolkit", "swmm.toolkit"],
     package_dir = package_dir,
 
     zip_safe = False,
-    install_requires = ["aenum==3.0.0"],
+    install_requires = ["aenum==2.2.6"],
 
     cmdclass = {"clean": CleanCommand},
     cmake_args = cmake_args,
diff --git a/swmm-toolkit/src/swmm/toolkit/CMakeLists.txt b/swmm-toolkit/src/swmm/toolkit/CMakeLists.txt
index b9760cd6..dc4a57f7 100644
--- a/swmm-toolkit/src/swmm/toolkit/CMakeLists.txt
+++ b/swmm-toolkit/src/swmm/toolkit/CMakeLists.txt
@@ -2,7 +2,7 @@
 # CMakeLists.txt - CMake configuration file for swmm.toolkit python package
 #
 # Created:   Feb 6, 2020
-# Updated:   Dec 29, 2020
+# Updated:   May 19, 2021
 #
 #  Author:   See AUTHORS
 #
@@ -31,8 +31,8 @@ else()
 endif()
 
 # Set up rpath on MacOS and Linux
-set(PACKAGE_RPATH 
-    "${LIB_ROOT}/../../swmm_toolkit/;${LIB_ROOT}/../../swmm_toolkit.libs/"
+set(PACKAGE_RPATH
+    "${LIB_ROOT}/../../swmm_toolkit/"
 )
 
 
diff --git a/swmm-toolkit/src/swmm/toolkit/__init__.py b/swmm-toolkit/src/swmm/toolkit/__init__.py
index 90ae9dd5..19312b52 100644
--- a/swmm-toolkit/src/swmm/toolkit/__init__.py
+++ b/swmm-toolkit/src/swmm/toolkit/__init__.py
@@ -4,7 +4,7 @@
 #  __init__.py - SWMM toolkit package
 #
 #  Created:    Aug 9, 2018
-#  Updated:    Dec 22, 2020
+#  Updated:    May 19, 2021
 #
 #  Author:     See AUTHORS
 #
@@ -19,8 +19,8 @@
 __credits__ = "Colleen Barr, Sam Hatchett"
 __license__ = "CC0 1.0 Universal"
 
-__version__ = "0.8.1"
-__date__ = "December 22, 2020"
+__version__ = "0.8.2"
+__date__ = "June 7, 2021"
 
 __maintainer__ = "Michael Tryby"
 __email__ = "tryby.michael@epa.gov"
diff --git a/swmm-toolkit/tools/build-wheels.sh b/swmm-toolkit/tools/build-wheels.sh
index aa05a3ea..6f15b66c 100755
--- a/swmm-toolkit/tools/build-wheels.sh
+++ b/swmm-toolkit/tools/build-wheels.sh
@@ -1,9 +1,10 @@
 #!/bin/bash
 
 #
-#  build-wheels.sh - in a manyLinux docker image using dock10cross
+#  build-wheels.sh - in a manyLinux docker image using dockcross
 #
 #  Date created: Feb 2, 2021
+#  Date modified: Jun 7, 2021
 #
 #  Author:       See AUTHORS
 #
@@ -20,23 +21,21 @@ mkdir -p ./dist
 cd swmm-toolkit
 
 # Build wheels
-for PYBIN in /opt/python/*/bin; do
-    if [ ${PYBIN} != "/opt/python/cp35-cp35m/bin" ]; then
-        # Setup python virtual environment for build
-        ${PYBIN}/python -m venv --clear ./build-env
-        source ./build-env/bin/activate
-
-        # Install build requirements
-        python -m pip install -r build-requirements.txt
-
-        # Build wheel
-        python setup.py bdist_wheel
-        mv ./dist/*.whl ../dist/
-
-        # cleanup
-        python setup.py clean
-        deactivate
-    fi
+for PYBIN in /opt/python/cp{36,37,38,39}*/bin; do
+    # Setup python virtual environment for build
+    ${PYBIN}/python -m venv --clear ./build-env
+    source ./build-env/bin/activate
+
+    # Install build requirements
+    python -m pip install -r build-requirements.txt
+
+    # Build wheel
+    python setup.py bdist_wheel
+    mv ./dist/*.whl ../dist/
+
+    # cleanup
+    python setup.py clean
+    deactivate
 done
 
 # Cleanup
@@ -47,25 +46,23 @@ rm -rf ./build-env
 cd ..
 
 # Bundle external shared libraries into the wheels
-for whl in ./dist/*-linux_x86_64.whl; do
-    auditwheel repair $whl -w ./dist
+for WHL in ./dist/*-linux_x86_64.whl; do
+    auditwheel repair -L '' -w ./dist $WHL
 done
 
 
 # Install packages and test
-for PYBIN in /opt/python/*/bin; do
-    if [ ${PYBIN} != "/opt/python/cp35-cp35m/bin" ]; then
-        # Setup python virtual environment for test
-        ${PYBIN}/python -m venv --clear ./test-env
-        source ./test-env/bin/activate
+for PYBIN in /opt/python/cp{36,37,38,39}*/bin; do
+    # Setup python virtual environment for test
+    ${PYBIN}/python -m venv --clear ./test-env
+    source ./test-env/bin/activate
 
-        python -m pip install -r swmm-toolkit/test-requirements.txt
+    python -m pip install -r swmm-toolkit/test-requirements.txt
 
-        python -m pip install --verbose --no-index --find-links=./dist swmm_toolkit
-        pytest
+    python -m pip install --verbose --no-index --find-links=./dist swmm_toolkit
+    pytest
 
-        deactivate
-    fi
+    deactivate
 done
 
 # Cleanup


Test patch:
diff --git a/swmm-toolkit/test-requirements.txt b/swmm-toolkit/test-requirements.txt
index f6cc17c4..37c7dd05 100644
--- a/swmm-toolkit/test-requirements.txt
+++ b/swmm-toolkit/test-requirements.txt
@@ -1,6 +1,6 @@
 
 
 
-pytest 
-numpy 
-aenum==3.0.0
+pytest==6.1.1
+numpy==1.17.2
+aenum==2.2.6