Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 support #1406

Merged
merged 8 commits into from
Nov 21, 2022
Merged

Python 3.11 support #1406

merged 8 commits into from
Nov 21, 2022

Conversation

speth
Copy link
Member

@speth speth commented Nov 16, 2022

Changes proposed in this pull request

  • Fix use of code that was deprecated or made internal in Python 3.11, in the implementation of extensible reaction rates
  • Drop support for Python 3.7
  • Change CI tests from Python 3.7, 3.9, and 3.10 to 3.8, 3.10, and 3.11
  • Fix deprecation warnings from Sundials 6.0 and newer
  • Fix CI so it uses the correct Python versions on macOS -- previously, all builds/tests were using the latest Homebrew Python (3.10) that is installed as python3, instead of the other specific Python versions which are only installed as python3.9 etc.
  • For Python 3.11 on macOS, use the Python provided by GitHub, since it's not available yet via Homebrew. We can't use this for older Pythons due to a missing library dependency (libintl) for linking to libpython3.x.

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

Closes #1349

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

This function was removed from Python.h in Python 3.11. See
python/cpython#28970
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #1406 (4577ecf) into main (577455c) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1406      +/-   ##
==========================================
- Coverage   71.16%   71.15%   -0.02%     
==========================================
  Files         373      373              
  Lines       52281    52276       -5     
  Branches    17374    17374              
==========================================
- Hits        37206    37196      -10     
- Misses      12721    12725       +4     
- Partials     2354     2355       +1     
Impacted Files Coverage Δ
src/numerics/BandMatrix.cpp 59.44% <ø> (ø)
interfaces/cython/cantera/ctml2yaml.py 84.50% <100.00%> (+0.06%) ⬆️
interfaces/cython/cantera/yaml2ck.py 72.14% <100.00%> (+0.31%) ⬆️
...terfaces/dotnet/Cantera/src/Interop/InteropUtil.cs 60.75% <0.00%> (-8.87%) ⬇️
src/base/stringUtils.cpp 80.00% <0.00%> (-0.91%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@speth speth force-pushed the python-3.11-support branch 11 times, most recently from c7b45e0 to 80a6d9c Compare November 18, 2022 15:37
@speth speth marked this pull request as draft November 18, 2022 15:45
@speth speth force-pushed the python-3.11-support branch 4 times, most recently from 4124624 to 6b56019 Compare November 18, 2022 19:47
The functions 'bandGBTRF' and 'bandGBTRS' were renamed in Sundials 6.0,
with the old names deprecated and slated for removal in Sundials 7.0. The
new names are 'SUNDlsMat_bandGBTRF' and 'SUNDlsMat_bandGBTRS'.
Linking to libpython with GitHub's Python 3.8 and 3.10 requires linking
to libintl, but no compatible version of this library is present in
the GitHub actions images (the Homebrew one has the wrong "macOS deployment
target"). This problem is fixed in GitHub's build of Python 3.11.

Scons 4.4.0 (and maybe other versions) can't be pip installed for the
Homebrew Python, since it tries to write man pages into an incorrect,
read-only directory.

The Homebrew-installed Python was never actually being used. All macOS
builds are done using Python cached in the GitHub actions image.
@speth speth force-pushed the python-3.11-support branch 2 times, most recently from c11aaba to 264a148 Compare November 20, 2022 16:11
PyPI packages are not always available for the most recent Python version
on all platforms.
@speth speth marked this pull request as ready for review November 20, 2022 17:28
@speth
Copy link
Member Author

speth commented Nov 20, 2022

After a mere 26 CI runs, this is finally working and ready for review.

@speth speth requested a review from a team November 20, 2022 17:29
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

Thanks! @speth - this looks good to me!

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.

Deprecation warning with Sundials version 6.0.0
3 participants