Python wheel building improvements #10466
Draft
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.
Pull request overview
@Myoldmopar
Changes in this PR include:
setup.py
withpyproject.toml
for zero-config (almost) wheel building. Under the hood,scikit-build-core
is used as the build system for interacting with CMake. Also it's much faster since it tells CMake to use Ninja by default.energyplus
toenergyplus.core
. This convertsenergyplus
to a namespace package, which allows sub-packages released under EnergyPlus's "umbrella" to be included in the namespace. Currentlyenergyplus.core
(the Python binding) is the only sub-package available (in this repo); In the future, there should be aenergyplus.datasets
for auxiliary example IDFs and EPWs. Once we have that clean separation of functionality each package can be installed separately so I imagine the installation would be much more lightweight compared to using installers.scripts/dev/versioning.py
for PEP 440. Sincescikit-build-core
is configured to usesetuptools_scm
for versioning, which in turn uses Git tags, tags are required to follow PEP 440. This should be relatively easy if the project had used a consistent, common versioning scheme. EnergyPlus is obviously not the case (mostly due to unconventional suffixes like "FollowupBuild" and "IOFreeze"). So I included a scriptversioning.py
inscripts/dev/
to (hopefully) make future version tagging easier to get right, i.e. PEP 440 compliant. (Slidenote: CMake should be configured to pull versions from Git as well. Having two separate version-keeping systems is error-prone.)Reviewer
This will not be exhaustively relevant to every PR.