Skip to content

Add support for HDF5 to sdist/wheels#1727

Merged
speth merged 19 commits intoCantera:mainfrom
bryanwweber:bryan-support-hdf5-in-wheels
Jul 29, 2024
Merged

Add support for HDF5 to sdist/wheels#1727
speth merged 19 commits intoCantera:mainfrom
bryanwweber:bryan-support-hdf5-in-wheels

Conversation

@bryanwweber
Copy link
Copy Markdown
Member

@bryanwweber bryanwweber commented Jun 27, 2024

Changes proposed in this pull request

  • Build Python sdist and wheel using scikit-build-core
    • scikit-build-core will find system libraries in appropriate places because it uses CMake for configuration
  • Enable building with HDF5 support
  • Enable building the PythonExtensionManager (I think this is new?)

🚧 TODO: 🚧

  • Refactor SCons* so that system_packages are enabled (right now they're forced to be disabled, but we don't need our private copies anymore)
  • Refactor SCons* so that scons sdist doesn't run unnecessary system checks
  • Include files from Eigen and built libraries from SUNDIALS are installed to the wheel, that shouldn't be happening
  • We don't need to package pyx files in the wheel, or cythonized cpp files in the sdist any more. Check that this is correct
  • Figure out license packaging requirements (I don't think we need to package anything except the Cantera license for the sdist, but the wheel may require dependency licenses)
  • Get it working with the sdist/wheel builder workflow repo
  • Decide if we need to install cmake and/or ninja with the build.system-requires table (see CMake and Ninja are not installed by scikit-build-core scikit-build/scikit-build-core#806). We do not need to do this because I was wrong about when cmake is installed.
  • Resolve this performance warning:
      CMake Warning at C:/Users/runneradmin/AppData/Local/Temp/tmp61vecodi/build/_deps/sundials-src/cmake/SundialsBuildOptionsPre.cmake:85 (message):
      SUNDIALS is being built with extensive error checks, performance may be
      affected.
    

If applicable, fill in the issue number this pull request is fixing

Closes Cantera/enhancements#205

If applicable, provide an example illustrating new features this pull request is introducing

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.04%. Comparing base (9210b08) to head (8386395).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1727   +/-   ##
=======================================
  Coverage   73.03%   73.04%           
=======================================
  Files         381      381           
  Lines       54132    54164   +32     
  Branches     9233     9240    +7     
=======================================
+ Hits        39534    39562   +28     
+ Misses      11635    11633    -2     
- Partials     2963     2969    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bryanwweber bryanwweber force-pushed the bryan-support-hdf5-in-wheels branch 2 times, most recently from 1e58f55 to d639f01 Compare July 14, 2024 12:04
@bryanwweber bryanwweber force-pushed the bryan-support-hdf5-in-wheels branch 4 times, most recently from d2995bf to 4272203 Compare July 21, 2024 23:41
@bryanwweber bryanwweber marked this pull request as ready for review July 22, 2024 00:45
Copy link
Copy Markdown
Member

@speth speth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @bryanwweber. Overall, this looks good to me. I had just a few minor suggestions.

@bryanwweber bryanwweber changed the title Add support for HDF to sdist/wheels Add support for HDF5 to sdist/wheels Jul 23, 2024
@bryanwweber bryanwweber force-pushed the bryan-support-hdf5-in-wheels branch from b6537b9 to 881fa80 Compare July 23, 2024 20:10
Add external dependencies to be downloaded at build time.

Add a note about cython_cmake extension
This allows us to avoid running a whole bunch of unnecessary
configuration checks that are required when compiling code but not when
we're just copying files into a folder structure to build the sdist.

Refactor the builder script

Move building into sconstruct, use some functions, include the license file.

Remove unused code

Clean up excludes from the wheel

Fix Python 3.8 typing problem
Update Boost paths

Config updates

cibuildwheel config changes

Modify env vars for boost

Bump manylinux images and use ours with Boost in them

Add HDF5 library env var

Try to set up for arm builds hack

Update DYLD fallback path for wheel repair

Use DYLD_FALLBACK_LIBRARY_PATH from the environment

This avoids needing to know about special variables

Move the container engine config back to pyproject.toml

Set Windows test command

Add Windows wheel repair command
We don't need it and this will save some config time
This aligns with the configuration in config.h
Prior to this change, build would attempt to build the sdist even if the file copies were incomplete.
Since we aren't configuring the SUNDIALS version at wheel-build time, we can directly substitute to create config.h in the include directory.
@bryanwweber bryanwweber force-pushed the bryan-support-hdf5-in-wheels branch from 881fa80 to 239149d Compare July 28, 2024 12:54
@bryanwweber bryanwweber force-pushed the bryan-support-hdf5-in-wheels branch from 239149d to e48c4fc Compare July 29, 2024 01:49
@bryanwweber
Copy link
Copy Markdown
Member Author

@speth I think I addressed everything here 😄

Copy link
Copy Markdown
Member

@speth speth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @bryanwweber. Just a couple of minor comments. Otherwise I think this is good to go.

@bryanwweber bryanwweber force-pushed the bryan-support-hdf5-in-wheels branch from 91448e7 to 8386395 Compare July 29, 2024 14:57
@bryanwweber
Copy link
Copy Markdown
Member Author

Thanks @speth! Good suggestions 😄

@speth speth merged commit a1ee588 into Cantera:main Jul 29, 2024
@bryanwweber bryanwweber deleted the bryan-support-hdf5-in-wheels branch August 2, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port setuptools Python build to meson or scikit-build - sdist/wheel only!

2 participants