theochem / iodata

Python library for reading, writing, and converting computational chemistry file formats and generating input files.
https://iodata.readthedocs.io/
GNU Lesser General Public License v3.0
133 stars 46 forks source link

Stricter testing #331

Closed tovrstra closed 5 months ago

tovrstra commented 5 months ago

This is part of the changes listed in #313. The first bullet was brought up in #325.

I will YOLO-merge this on Friday, June 14 unless reviewed earlier.

Summary by Sourcery

This pull request enhances the CI workflow by ensuring that the oldest supported versions of dependencies are installed when testing with Python 3.9. Additionally, it configures pytest to treat warnings as errors, improving the strictness of the tests.

sourcery-ai[bot] commented 5 months ago

Reviewer's Guide by Sourcery

This pull request introduces stricter testing measures by ensuring that the oldest supported versions of dependencies are installed when testing with Python 3.9. Additionally, it adds the -W error option to pytest to treat warnings as errors, ensuring that no warnings are ignored during testing.

File-Level Changes

Files Changes
.github/workflows/pytest.yaml Enhanced the CI workflow to install the oldest supported versions of dependencies for Python 3.9 and added stricter warning handling in pytest.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://sourcery.ai/dashboard): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
deepsource-io[bot] commented 5 months ago

Here's the code health analysis summary for commits c7a7469..3c2f49f. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.
matt-chan commented 5 months ago

I think it wouldn't be that hard to bump 2.x compatibility past 3.9. The main blocker is getting the newer versions of the dependencies.

On Mon, 10 Jun 2024 at 10:48, Paul W. Ayers @.***> wrote:

@.**** commented on this pull request.

Is there any way to support earlier versions of Python?

We have a major annoyance right now because HORTON 2.3 supports only up to Python 3.9 https://github.com/theochem/horton/blob/764dd2fa958aee0dcee30b19ed0520d65d83b45a/conda/conda_build_config.yaml#L3. This makes it impossible to use "new HORTON" features in the same environment as HORTON 2.x, and there is stil a lot of old workflows that use facets of HORTON 2.x that haven't been migrated yet.

So I guess the two questions are, and I guess @tovrstra https://github.com/tovrstra and @matt-chan https://github.com/matt-chan are the people to answer them:

  1. Is it better to keep HORTON 3.x things compatible down to Python 3.9
  2. Is it better to upgrade HORTON 2.x to support Python past 3.9

One of these two things needs to be done, IMHO.

— Reply to this email directly, view it on GitHub https://github.com/theochem/iodata/pull/331#pullrequestreview-2108422470, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH74NLACIQQZ3PKMLLSWKTZGXRGVAVCNFSM6AAAAABI7Z32EKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMBYGQZDENBXGA . You are receiving this because you were mentioned.Message ID: @.***>

-- Matt

PaulWAyers commented 5 months ago

mp 2.x compatibility past 3.9. The main blocker is getting the newer versions of the dependencies.

Can you take the lead on making this update to HORTON 2.3 then (preferably sooner rather than later)? I'll then approve this as the point will be moot by the time it's relevant.

tovrstra commented 5 months ago

Sounds good. Thanks for reviewing and checking all this.

IOData works for Python 3.9 now and we can easily keep it that way while it is officially supported, i.e. until October 2025. (See https://devguide.python.org/versions/)

The reason I did not consider supporting 3.8 is that it goes end of life soon, i.e. October 2024.

Note that Python 3.9 is also the oldest version that supports type hinting with built-in types (PEP 585) without __future__ imports, which is nice to have. It makes the source code easier to write and read.