Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PEP 723 support for SuiteSparse and SUNDIALS installation script #3716

Merged
merged 3 commits into from
Jan 12, 2024
Merged

Add PEP 723 support for SuiteSparse and SUNDIALS installation script #3716

merged 3 commits into from
Jan 12, 2024

Conversation

AlessioBugetti
Copy link
Contributor

Description

Introduce a TOML-style comment block at the top of the install_KLU_Sundials.py script. This block contains essential metadata, including the required Python version and a list of dependencies. This addition aligns the script with the PEP 723 guidelines, enhancing readability and portability for script runners and developers.

The metadata includes:

  • The Python version requirement (<=3.9)
  • Dependencies required for the script (wget, cmake)
  • Additional information like the repository and documentation links

This enhancement facilitates easier script sharing and collaboration, providing a standardized way to specify and access script dependencies and supported Python versions. It also lays the groundwork for potential future tooling that could automate environment setup and dependency installation.

Refer to PEP 723 for more details on this format.

Fixes #3647

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Introduce a TOML-style comment block at the top of the `install_KLU_Sundials.py` script. This block contains essential metadata, including the required Python version and a list of dependencies. This addition aligns the script with the PEP 723 guidelines, enhancing readability and portability for script runners and developers.

The metadata includes:
- The Python version requirement (<=3.9)
- Dependencies required for the script (wget, cmake)
- Additional information like the repository and documentation links

This enhancement facilitates easier script sharing and collaboration, providing a standardized way to specify and access script dependencies and supported Python versions. It also lays the groundwork for potential future tooling that could automate environment setup and dependency installation.

Refer to PEP 723 for more details on this format.

Resolves: #3647
Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Hi @AlessioBugetti, thanks for adding the configuration as requested in the issue. The only reason I'm holding off on merging this is highlighted by its priority – there's this discussion that the PEP is being updated through and I am not following up enough on where it is heading, which just means that we'll need to make further changes as and when this gets finalised and Python tooling adapts accordingly.

My suggestion is that we should wait until Q2 2024 and see what the scenario is, because currently without a mechanism for an isolated, automated installation of the dependencies table – the PEP doesn't handle much of the use case I am referring to (there have been script runners that work with curl -L <URL> | python3 before such as those for installing PDM and Poetry, but IIRC both of those options have been deprecated and removed from the codebases of both of those projects).

We can either keep this PR as a draft for now, re-create this PR at a different time, or merge it and make changes later at a different time. I don't have an opinion on any of the three scenarios.

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (64681dd) 99.59% compared to head (79f9316) 99.59%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3716   +/-   ##
========================================
  Coverage    99.59%   99.59%           
========================================
  Files          258      258           
  Lines        20796    20796           
========================================
  Hits         20711    20711           
  Misses          85       85           

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

@AlessioBugetti
Copy link
Contributor Author

Hi @AlessioBugetti, thanks for adding the configuration as requested in the issue. The only reason I'm holding off on merging this is highlighted by its priority – there's this discussion that the PEP is being updated through and I am not following up enough on where it is heading, which just means that we'll need to make further changes as and when this gets finalised and Python tooling adapts accordingly.

My suggestion is that we should wait until Q2 2024 and see what the scenario is, because currently without a mechanism for an isolated, automated installation of the dependencies table – the PEP doesn't handle much of the use case I am referring to (there have been script runners that work with curl -L <URL> | python3 before such as those for installing PDM and Poetry, but IIRC both of those options have been deprecated and removed from the codebases of both of those projects).

We can either keep this PR as a draft for now, re-create this PR at a different time, or merge it and make changes later at a different time. I don't have an opinion on any of the three scenarios.

Hi @agriyakhetarpal ,

Thank you for your feedback and for considering the changes I've proposed. I understand the concerns regarding the evolving nature of PEP 723.

Given the situation, I'm open to any of the suggested approaches regarding the PR. If keeping the PR as a draft is the preferred method for now, I'm happy to monitor the progress and update it as needed when Q2 2024 approaches. Alternatively, if you think it's better to merge now and revise later, or to close and re-open the PR at a later date, I'm flexible and willing to assist in whichever way is most beneficial for the project.

From my viewpoint, I believe that merging the PR now would be beneficial. The addition of metadata to install_KLU_Sundials.py simplifies its comprehension and usage. Proceeding with the merge at this point could provide immediate benefits to current users and developers, even as we continue to monitor and adapt to the future developments in PEP 723 and related tooling.

@agriyakhetarpal
Copy link
Member

Agreed, I am happy to merge even with the limited functionality that the dependencies table currently provides. Although I will keep the corresponding issue open so that we can get back to it later – I shall tag you there sometime, feel free to work on it further if you will still be available.

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks, @AlessioBugetti! @all-contributors please add @AlessioBugetti for infra

@arjxn-py arjxn-py self-requested a review January 12, 2024 12:58
Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

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

Thanks @AlessioBugetti, looks good.
I'm in favour of merging this PR as is and further continue with the changes later in Q2 2024.
Edit: commenting again to add you for infra 🙂

@arjxn-py
Copy link
Member

@all-contributors please add @AlessioBugetti for infra

Copy link
Contributor

@arjxn-py

I've put up a pull request to add @AlessioBugetti! 🎉

@agriyakhetarpal
Copy link
Member

TIL that the all-contributors requires a separate comment for this functionality, thanks @arjxn-py.

@agriyakhetarpal agriyakhetarpal merged commit 2a46b7a into pybamm-team:develop Jan 12, 2024
40 of 41 checks passed
@agriyakhetarpal
Copy link
Member

Hi, @AlessioBugetti – I have posted about potential revisions to PEP 723 in #3647 (comment). If you're interested, feel free to take that up!

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.

PEP 723 support for SuiteSparse and SUNDIALS installation script
3 participants