Skip to content

Update requirements previously pinned for 3.9 support#1737

Merged
sufikaur merged 7 commits intoIDAES:mainfrom
sufikaur:issue-1727-2
Mar 4, 2026
Merged

Update requirements previously pinned for 3.9 support#1737
sufikaur merged 7 commits intoIDAES:mainfrom
sufikaur:issue-1727-2

Conversation

@sufikaur
Copy link
Contributor

@sufikaur sufikaur commented Feb 27, 2026

Fixes

Suggested in #1727

Summary/Motivation:

Some requirements were pinned due to this project's support of python 3.9. Now that is no longer the case, we should review dependencies that were pinned to support it.

Changes proposed in this PR:

Important notes

  • version of pint is kept pinned due to this issue Update Pyomo requirement to 6.8.0 release #1465
  • a fix for a floating pint would be to add a minimum version of python required in the pyproject.toml. This was not done since (1) while not advised, legacy projects could require old versions of python, and (2) the error message when one installs idaes-pse in an existing environment with version of python not allowed by requires-python has an unreadable error message which doesn't point to the core problem that their version of python is out of date.

Code formatting and consistency

  • Added trailing commas to dictionary and function argument lists in internal methods for improved style consistency (e.g., _pyomo_cons, _make_pyomo_model). [1] [2]

Configuration and dependency management

  • Ran even prettier toml on pyproject.toml for better readability
  • Updated requirements-dev.txt to use a newer version of sphinx-argparse (0.5.2), removing the constraint for Python 3.9 and aligning with current documentation needs.

Legal Acknowledgement

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

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  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.

Copilot AI review requested due to automatic review settings February 27, 2026 00:22
@sufikaur sufikaur requested a review from ksbeattie as a code owner February 27, 2026 00:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project’s runtime dependency specification in pyproject.toml, apparently aiming to remove a Pint requirement that was previously justified by Python 3.9 support.

Changes:

  • Removes the minimum version constraint from the pint dependency (now unconstrained).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 40 to 43
dependencies = [
"pyomo >= 6.10.0",
"pint >= 0.24.1", # required to use Pyomo units. Pint 0.24.1 needed for Python 3.9 support
"pint",
"networkx", # required to use Pyomo network
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Dropping the pint >= 0.24.1 floor means any Pint version now satisfies the dependency, so installers may keep an already-installed older Pint that could be incompatible with Pyomo units usage. If the intent is only to stop carrying a Python 3.9-related constraint, consider (a) keeping a minimum Pint version that the project is tested against (even if you remove any 3.9-specific upper bound), and (b) declaring supported Python explicitly via requires-python (e.g., >=3.10) in [project] so packaging metadata matches the stated support policy.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

Option (b) here seems like a good idea...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We would prefer if pyomo could have an extra dependency like unit = pint >=.

At the moment we are not aware of any incompatibilities that affect idaes due to pint.
If we leave it floating, we rely on out CI to find incompatibilities. Hypothetically, if someone had an incompatible version already installed in a local environment, we would recommend them to update or recreate their environment as part of the troubleshooting process.

Conclusion is to leave it floating.

Copy link
Member

Choose a reason for hiding this comment

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

The lower bound on the pint version is not coming from Pyomo. We include pint in our list of optional dependencies for Pyomo and leave it unpinned.

Copy link
Member

Choose a reason for hiding this comment

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

This PR describes the issues we were seeing on the IDAES side that led to the pint version pin: #1465

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. In that case I will keep the original pin. Thank you @blnicho

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.84%. Comparing base (3b76abc) to head (409093f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1737      +/-   ##
==========================================
- Coverage   73.85%   73.84%   -0.02%     
==========================================
  Files         406      406              
  Lines       66081    66081              
  Branches    11110    11110              
==========================================
- Hits        48803    48795       -8     
- Misses      14741    14745       +4     
- Partials     2537     2541       +4     

☔ View full report in Codecov by Sentry.
📢 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.

@ksbeattie ksbeattie added Priority:Normal Normal Priority Issue or PR Priority:High High Priority Issue or PR and removed Priority:Normal Normal Priority Issue or PR labels Feb 27, 2026

This comment was marked as resolved.

self.flowsheet().time,
doc="Material properties of mixed (inlet) stream",
**tmp_dict
**tmp_dict,
Copy link
Contributor Author

@sufikaur sufikaur Feb 27, 2026

Choose a reason for hiding this comment

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

I have no idea why black is acting up with the magic trailing comma issue! Still looking for root of the issue.

New test PR for black issue

Copy link
Contributor Author

@sufikaur sufikaur Mar 4, 2026

Choose a reason for hiding this comment

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

Imitated when a minimum python version of 3.10 was set (intermediate step)
Black fixed trailing commas for projects that are >=3.6.

@sufikaur sufikaur changed the title undo requirements pinned due to 3.9 support Update requirements previously pinned for 3.9 support Feb 27, 2026
pyproject.toml Outdated
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords=["IDAES", "idaes-pse", "energy systems", "chemical engineering", "process modeling"]
requires-python = ">=3.10"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't do this because error message is complicated and unhelpful if someone installs this in an existing env older than 3.10

@sufikaur sufikaur requested a review from blnicho March 4, 2026 23:43
@sufikaur sufikaur merged commit 5c4bf0d into IDAES:main Mar 4, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority:High High Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants