Update requirements previously pinned for 3.9 support#1737
Update requirements previously pinned for 3.9 support#1737sufikaur merged 7 commits intoIDAES:mainfrom
Conversation
There was a problem hiding this comment.
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
pintdependency (now unconstrained).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Option (b) here seems like a good idea...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
This PR describes the issues we were seeing on the IDAES side that led to the pint version pin: #1465
There was a problem hiding this comment.
I see. In that case I will keep the original pin. Thank you @blnicho
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
| self.flowsheet().time, | ||
| doc="Material properties of mixed (inlet) stream", | ||
| **tmp_dict | ||
| **tmp_dict, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Imitated when a minimum python version of 3.10 was set (intermediate step)
Black fixed trailing commas for projects that are >=3.6.
pyproject.toml
Outdated
| "Topic :: Software Development :: Libraries :: Python Modules", | ||
| ] | ||
| keywords=["IDAES", "idaes-pse", "energy systems", "chemical engineering", "process modeling"] | ||
| requires-python = ">=3.10" |
There was a problem hiding this comment.
don't do this because error message is complicated and unhelpful if someone installs this in an existing env older than 3.10
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
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 byrequires-pythonhas 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
_pyomo_cons,_make_pyomo_model). [1] [2]Configuration and dependency management
pyproject.tomlfor better readabilityrequirements-dev.txtto use a newer version ofsphinx-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: