Skip to content

Comments

(outdated) Convert setup.py to pyproject.toml#1663

Closed
sufikaur wants to merge 35 commits intoIDAES:mainfrom
sufikaur:issue-1655
Closed

(outdated) Convert setup.py to pyproject.toml#1663
sufikaur wants to merge 35 commits intoIDAES:mainfrom
sufikaur:issue-1655

Conversation

@sufikaur
Copy link
Contributor

@sufikaur sufikaur commented Sep 16, 2025

Fixes

Issue 1655

Summary/Motivation:

  1. Since setup is a less modern approach it could be causing warnings/ issues like described in in issue 1476
  2. To maintain consistency with other idaesplus repos.

Changes proposed in this PR:

  • Delete setup.py
  • Transfer content described in setup.py to pyproject.toml
  • use importlib for conf.py

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.

@sufikaur sufikaur requested a review from ksbeattie as a code owner September 16, 2025 20:51
@sufikaur sufikaur marked this pull request as draft September 16, 2025 21:34
@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.06%. Comparing base (ce7f3bd) to head (6961ffa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1663      +/-   ##
==========================================
- Coverage   77.08%   77.06%   -0.02%     
==========================================
  Files         395      395              
  Lines       62759    62759              
  Branches    10234    10234              
==========================================
- Hits        48377    48366      -11     
- Misses      11974    11982       +8     
- Partials     2408     2411       +3     

☔ 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.

@blnicho blnicho requested a review from mrmundt September 17, 2025 22:24
@blnicho
Copy link
Member

blnicho commented Sep 17, 2025

Tagging @mrmundt to take a look at this since she recently did the same conversion for Pyomo

Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

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

Some initial thoughts here:

  1. I would recommend doing something similar to what we have in Pyomo. We made different categories for different types of dependencies, and you all could do the same with the dev dependencies. That way you don't need to have requirements-dev.txt anymore. (It looks like you started doing this with the optional-dependencies category, so go all the way!!)
  2. If you do that ^^, then the docs will need to be updated: https://github.com/IDAES/idaes-pse/blob/main/docs/tutorials/advanced_install/index.rst
  3. This is not your doing, but where is the Python version actually defined besides in the classifiers? Are they actually just polite suggestions?

pyproject.toml Outdated
"pyomo >= 6.9.3",
"pint >= 0.24.1", # required to use Pyomo units. Pint 0.24.1 needed for Python 3.9 support
"networkx", # required to use Pyomo network
"numpy>=1,<3", # pandas constraint added on 2023-08-30 b/c bug in v2.1 # see IDAES/idaes-pse#1253
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment I suspect is on the wrong line

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 took this directly from the setup.py file. I think it may be okay?

A1/A2: As per the last dev call, I'll split this into two/ keep it in mind to discuss further.

A3. I don't know if it is defined anywhere! @lbianchi-lbl

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment I suspect is on the wrong line

@mrmundt do you mean the comment on L43, i.e. where the numpy dependency is defined? If so, I think you might be right, as the comment refers to pandas. So that comment should be moved to the line where the pandas dependency is defined.

As for the Python version, AFAIK the classifiers are not enforced. From a cursory search (https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#python-requires), requires-python seems to be the way to define this in pyproject.toml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Ludovico.
Is there a reason it was not enforced? Happy to add a line being stricter about enforcing python versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the comment line

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Sep 18, 2025
@sufikaur sufikaur requested review from bpaul4, dangunter, ksbeattie, lbianchi-lbl and mrmundt and removed request for bpaul4, dangunter, ksbeattie and mrmundt October 30, 2025 18:44
# https://setuptools-scm.readthedocs.io/en/v8.1.0/extending/
local_scheme = "node-and-date"
version_scheme = "only-version"

Copy link
Contributor Author

@sufikaur sufikaur Nov 12, 2025

Choose a reason for hiding this comment

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

ideas/ver.py is still being used because it is being tested.
As part of this PR, that file should be removed and remove the test associated with it.
Must ensure, that in the top level __init__.py make sure that the attribute version is set correctly using importlib.metadata.version("idaes-pse").

@ksbeattie ksbeattie added Priority:High High Priority Issue or PR and removed Priority:Normal Normal Priority Issue or PR labels Nov 13, 2025
@sufikaur sufikaur added the CI:run-integration triggers_workflow: Integration label Nov 13, 2025
@idaes-build idaes-build removed the CI:run-integration triggers_workflow: Integration label Nov 13, 2025
blnicho and others added 3 commits November 17, 2025 14:44
* Bumping the Pyomo tag to check for issues

* Bump required versions of pylint, astroid, and black

* Reverting update of black version

* Changing pylint and astroid versions again

* Update expected pylint and astroid versions

* Fixing pylint warnings

* Revert change to required Pyomo version in setup.py

* Tell black to report the changes it wants

* Run black
* rescue files from branch

* clean up code

* cross flow heat exchanger tests and formatting

* Add tests for solid oxide cell and TPB

* solve test with heat loss terms

* run Black

* pylint

* fix model check and add additonal tests

* get rid of warning when using LL collocation

* Jinliang's changes

* pylint
@sufikaur sufikaur changed the title Convert setup.py to pyproject.toml (outdated) Convert setup.py to pyproject.toml Nov 21, 2025
@sufikaur sufikaur closed this Dec 4, 2025
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.

7 participants