Skip to content

[Python] Updates for NumPy 2.0 support in the sdist builder#1713

Merged
speth merged 12 commits intomainfrom
bryan-updates-for-numpy-2
Jun 23, 2024
Merged

[Python] Updates for NumPy 2.0 support in the sdist builder#1713
speth merged 12 commits intomainfrom
bryan-updates-for-numpy-2

Conversation

@bryanwweber
Copy link
Copy Markdown
Member

@bryanwweber bryanwweber commented Jun 18, 2024

  • Fix a few compiler warnings from Eigen in the Cython interface
  • Change how the sdist build environment is created
  • Install example data in the sdist
    This can be configured by the top-level example_data option
  • Simplify extension setup to resolve duplicate cythonizing
    When building the sdist via scons, the cython step was running twice because of the conditional. In addition, we were getting a warning about building the extension from multiple source files. These changes resolve both problems by cythonizing once if the files aren't present and only including the C++ sources in the extension.
  • Fix build-system dependencies for NumPy 2.0 support
    NumPy 2.0 does not support Python 3.8, so we need to special case that version. Also special case for Pint, which doesn't support NumPy 2.0 on Python 3.9.

@bryanwweber bryanwweber force-pushed the bryan-updates-for-numpy-2 branch from 0b97cde to 5f293f9 Compare June 18, 2024 19:07
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.84%. Comparing base (02b2bff) to head (dc4d0c0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1713   +/-   ##
=======================================
  Coverage   72.84%   72.84%           
=======================================
  Files         379      379           
  Lines       53824    53824           
  Branches     9182     9182           
=======================================
  Hits        39208    39208           
  Misses      11642    11642           
  Partials     2974     2974           

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

@bryanwweber bryanwweber self-assigned this Jun 19, 2024
@bryanwweber bryanwweber linked an issue Jun 19, 2024 that may be closed by this pull request
@bryanwweber
Copy link
Copy Markdown
Member Author

Related to #1675

@bryanwweber bryanwweber force-pushed the bryan-updates-for-numpy-2 branch 2 times, most recently from faf2540 to 12b2529 Compare June 19, 2024 14:47
@corykinney
Copy link
Copy Markdown
Contributor

I saw #1675 was closed 🎉

@bryanwweber Is the plan to do some sort of 3.0.0post1 once this work is complete so that a fresh pip install will work again (maybe with Python 3.12 support 😄)?

@bryanwweber
Copy link
Copy Markdown
Member Author

I saw #1675 was closed 🎉

@bryanwweber Is the plan to do some sort of 3.0.0post1 once this work is complete so that a fresh pip install will work again (maybe with Python 3.12 support 😄)?

I'll probably re-open #1675 until the Conda packages are fixed as well. Then I'll see about backporting 😄 I would like to backport, and see if we can preemptively support Python 3.13 as well

@bryanwweber bryanwweber marked this pull request as ready for review June 20, 2024 19:12
@bryanwweber bryanwweber force-pushed the bryan-updates-for-numpy-2 branch 3 times, most recently from 019e0d4 to 36c7ff3 Compare June 21, 2024 18:15
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, all these changes look good to me. Just one request regarding the documentation.

Comment on lines -59 to -62
- name: Trigger Conda builds
run: >
gh workflow run -R cantera/conda-recipes
main.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is the change dropping the builds for the cantera conda channel, correct? I think this would be the right time to update the installation instructions (doc/sphinx/install/conda.md) to reflect conda-forge being the sole source of conda packages.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They aren't uploaded from this job, but yes this is the one that builds when pushes happen on main. I'll update the docs! 🎉

@bryanwweber bryanwweber force-pushed the bryan-updates-for-numpy-2 branch from b52902d to 8488b30 Compare June 22, 2024 21:18
@bryanwweber bryanwweber requested a review from speth June 22, 2024 23:16
This can be configured by the top-level example_data option
When building the sdist via scons, the cython step was running twice because of the conditional. In addition, we were getting a warning about building the extension from multiple source files. These changes resolve both problems by cythonizing once if the files aren't present and only including the C++ sources in the extension.
NumPy 2.0 does not support Python 3.8, so we need to special case that version.
…th Pint

Update dependencies for Cython/Sdist packages
We're deprecating these builds for the 3.1 release because we don't have a Matlab package in this release.
This will work for Anaconda or miniforge.
@bryanwweber bryanwweber force-pushed the bryan-updates-for-numpy-2 branch from 8488b30 to 8908f4e Compare June 23, 2024 12:53
Co-authored-by: Ray Speth <[email protected]>
@speth speth merged commit b36d156 into main Jun 23, 2024
@speth speth deleted the bryan-updates-for-numpy-2 branch July 23, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants