Skip to content

Resolve Python 3.14 compatibility issues#3643

Merged
blnicho merged 6 commits intoPyomo:mainfrom
jsiirola:python314-fixes
Jun 24, 2025
Merged

Resolve Python 3.14 compatibility issues#3643
blnicho merged 6 commits intoPyomo:mainfrom
jsiirola:python314-fixes

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

This resolves two issues with Python 3.14 (and late Python 3.13) releases

  1. Python has changed the behavior of logger.isEnabledFor() so that it always returns False when a log record is in flight. This breaks some of our pyomo.common.log tests (related to how the legacy formatter switches verbosity). This PR removes dependence on isEnabledFor when processing log records
  2. Starting in Python 3.12, the tarfile module will issue a deprecation warning when a filter is not provided to extractall. This PR adds filter (for Python>=3.12, where the argument is allowed). The filter needs to not be the same as the default starting in Python 3.14, because the default will trigger undesired exceptions.

Changes proposed in this PR:

  • Rework how the Pyomo log formatter detects if debug logging is enabled
  • Provide a filter to tarfile.extractall (for python>=3.12)
  • Release GHA Python 3.13 version pin

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@jsiirola jsiirola requested a review from blnicho June 23, 2025 23:48
@blnicho blnicho merged commit 3a8339d into Pyomo:main Jun 24, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in August 2025 Release Jun 24, 2025
@jsiirola jsiirola deleted the python314-fixes branch August 1, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants