Skip to content

Commit abbe407

Browse files
authored
Merge pull request #117 from pyswmm/dev_pyproject.toml
2 parents 1baff8b + 7be4f04 commit abbe407

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

swmm-toolkit/pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[build-system]
2+
requires = [
3+
"wheel>=0.38.1",
4+
"setuptools>=42",
5+
"scikit-build>=0.13",
6+
"cmake>=3.21",
7+
"swig==4.0.2",
8+
]
9+
build-backend = "setuptools.build_meta"

swmm-toolkit/setup.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import os
2020
from skbuild import setup
2121
from setuptools import Command
22-
22+
import sys
2323

2424
# Determine platform
2525
platform_system = platform.system()
@@ -56,11 +56,28 @@ def run(self):
5656
p.wait()
5757

5858

59-
# Set up location of wheel libraries depending on build platform
60-
if platform_system == "Windows":
61-
package_dir = {"swmm_toolkit":"bin", "swmm.toolkit": "src/swmm/toolkit"}
59+
# Set up location of wheel libraries depending on build platform and command
60+
# commands that trigger cmake from skbuild.setuptools_wrap._should_run_cmake
61+
commands_that_trigger_cmake = {
62+
"build",
63+
"build_ext",
64+
"develop",
65+
"install",
66+
"install_lib",
67+
"bdist",
68+
"bdist_dumb",
69+
"bdist_egg",
70+
"bdist_rpm",
71+
"bdist_wininst",
72+
"bdist_wheel",
73+
"test",
74+
}
75+
command = sys.argv[1] if len(sys.argv) > 1 else None
76+
if command in commands_that_trigger_cmake:
77+
swmm_toolkit_dir= "bin" if platform_system == "Windows" else "lib"
6278
else:
63-
package_dir = {"swmm_toolkit":"lib", "swmm.toolkit": "src/swmm/toolkit"}
79+
swmm_toolkit_dir= "swmm-solver"
80+
package_dir = {"swmm_toolkit" : swmm_toolkit_dir, "swmm.toolkit": "src/swmm/toolkit"}
6481

6582

6683
if os.environ.get('SWMM_CMAKE_ARGS') is not None:
@@ -88,7 +105,6 @@ def exclude_files(cmake_manifest):
88105
here = pathlib.Path(__file__).parent.resolve()
89106
long_description = (here / 'README.md').read_text(encoding='utf-8')
90107

91-
92108
setup(
93109
name = "swmm-toolkit",
94110
version = "0.14.2",
@@ -127,4 +143,4 @@ def exclude_files(cmake_manifest):
127143
"Programming Language :: C",
128144
"Development Status :: 5 - Production/Stable",
129145
]
130-
)
146+
)

swmm-toolkit/test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
pytest == 7.1.1
55
numpy == 1.21.6; python_version == "3.7"
6-
numpy == 1.22.0; python_version >= "3.8"
6+
numpy == 1.24.4; python_version >= "3.8"
77
aenum == 3.1.11

0 commit comments

Comments
 (0)