Skip to content

Add license_is_valid for knitroampl - #4059

Merged
mrmundt merged 2 commits into
Pyomo:mainfrom
jsiirola:knitroampl-license-check
Oct 26, 2026
Merged

mrmundt merged 2 commits into
Pyomo:mainfrom
jsiirola:knitroampl-license-check

Conversation

@jsiirola

Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

The current implementation of the knitroampl solver interface does not provide an implementation of license_is_valid(). This was causing test failures on systems where knitroampl was present, but not licensed. Adding license_is_valid allows up to update the ligic behind knitro_available to include both present and licensed.

Changes proposed in this PR:

  • Define license_is_valid() for the (legacy) knitroampl interface
  • Guard knitroampl tests so they are skipped when Knitro is not licensed.

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained AI-generated content and verified it before committing. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

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.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.13%. Comparing base (fac7716) to head (562a290).

Files with missing lines Patch % Lines
pyomo/solvers/plugins/solvers/KNITROAMPL.py 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4059      +/-   ##
==========================================
- Coverage   90.14%   90.13%   -0.01%     
==========================================
  Files         917      917              
  Lines      109294   109303       +9     
==========================================
+ Hits        98522    98525       +3     
- Misses      10772    10778       +6     
Flag Coverage Δ
builders 29.11% <66.66%> (+<0.01%) ⬆️
default 86.32% <66.66%> (?)
expensive 35.12% <66.66%> (?)
linux 87.49% <22.22%> (-2.16%) ⬇️
linux_other 87.49% <22.22%> (-0.19%) ⬇️
oldsolvers 28.02% <22.22%> (+<0.01%) ⬆️
osx 83.11% <22.22%> (-0.01%) ⬇️
win 85.43% <22.22%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrmundt
mrmundt merged commit 8f32f80 into Pyomo:main Oct 26, 2026
33 of 34 checks passed
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