diff --git a/swmm-toolkit/pyproject.toml b/swmm-toolkit/pyproject.toml new file mode 100644 index 00000000..bf989284 --- /dev/null +++ b/swmm-toolkit/pyproject.toml @@ -0,0 +1,9 @@ +[build-system] +requires = [ + "wheel>=0.38.1", + "setuptools>=42", + "scikit-build>=0.13", + "cmake>=3.21", + "swig==4.0.2", +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/swmm-toolkit/setup.py b/swmm-toolkit/setup.py index a4107512..93670c96 100644 --- a/swmm-toolkit/setup.py +++ b/swmm-toolkit/setup.py @@ -19,7 +19,7 @@ import os from skbuild import setup from setuptools import Command - +import sys # Determine platform platform_system = platform.system() @@ -56,11 +56,28 @@ def run(self): p.wait() -# Set up location of wheel libraries depending on build platform -if platform_system == "Windows": - package_dir = {"swmm_toolkit":"bin", "swmm.toolkit": "src/swmm/toolkit"} +# Set up location of wheel libraries depending on build platform and command +# commands that trigger cmake from skbuild.setuptools_wrap._should_run_cmake +commands_that_trigger_cmake = { + "build", + "build_ext", + "develop", + "install", + "install_lib", + "bdist", + "bdist_dumb", + "bdist_egg", + "bdist_rpm", + "bdist_wininst", + "bdist_wheel", + "test", + } +command = sys.argv[1] if len(sys.argv) > 1 else None +if command in commands_that_trigger_cmake: + swmm_toolkit_dir= "bin" if platform_system == "Windows" else "lib" else: - package_dir = {"swmm_toolkit":"lib", "swmm.toolkit": "src/swmm/toolkit"} + swmm_toolkit_dir= "swmm-solver" +package_dir = {"swmm_toolkit" : swmm_toolkit_dir, "swmm.toolkit": "src/swmm/toolkit"} if os.environ.get('SWMM_CMAKE_ARGS') is not None: @@ -88,7 +105,6 @@ def exclude_files(cmake_manifest): here = pathlib.Path(__file__).parent.resolve() long_description = (here / 'README.md').read_text(encoding='utf-8') - setup( name = "swmm-toolkit", version = "0.14.2", @@ -127,4 +143,4 @@ def exclude_files(cmake_manifest): "Programming Language :: C", "Development Status :: 5 - Production/Stable", ] -) +) \ No newline at end of file diff --git a/swmm-toolkit/test-requirements.txt b/swmm-toolkit/test-requirements.txt index 1d649ff1..cbb4f032 100644 --- a/swmm-toolkit/test-requirements.txt +++ b/swmm-toolkit/test-requirements.txt @@ -3,5 +3,5 @@ pytest == 7.1.1 numpy == 1.21.6; python_version == "3.7" -numpy == 1.22.0; python_version >= "3.8" +numpy == 1.24.4; python_version >= "3.8" aenum == 3.1.11