Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the longest time, building this project from source required cloning from git, pulling the submodule, and running the setup.py script.
Currently, if a user tries to pip install swmm-toolkit, and a wheel for their given version of python or system is not available on PyPI, pip tries to build from the source dist uploaded to PyPI and fails because the build tools are not installed. This PR attempts to resolve that problem by adding a pyproject.toml file that specifies the build backend and build tools.
In addition to the pyproject.toml, I had to add a small hack to the setup.py script to trick setuptools. I had to add this because scikit-build and setuptools don't play nice with
pip install .
orpython -m build
. When running code that generates the sdist or dist_info data, setuptools checks that packages are available. Since our package is only built when running cmake (from a different dir too), those package directories or not found because cmake is not run for sdist or dist_info, and the validation fails. Changing the setuptools package_dir parameter depending on if cmake is running gets around the issue, and I was able to runpip install .
andpython -m build .
successfully in blank virtual envs.Eventually it'd be nice to transition our build backend to scikit-build-core, but I have not found a good way to make it work yet for multi-platform builds.