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

Stricter testing #331

Merged
merged 5 commits into from
Jun 11, 2024
Merged

Stricter testing #331

merged 5 commits into from
Jun 11, 2024

Conversation

tovrstra
Copy link
Member

@tovrstra tovrstra commented Jun 8, 2024

  • When testing with the old Python version (3.9 at the moment), the oldest supported versions of the dependencies are installed.
  • The oldest supported SciPy is increased from 1.8.0 to 1.11.0, due to required array support in factorial2.
  • The option -W error is added to pytest, so that it fails in case of a warning.

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.

  • CI:
    • Added a step to install the oldest supported versions of dependencies when testing with Python 3.9.
    • Included the -W error option in pytest to treat warnings as errors.

- When testing with the old Python version (3.9 at the moment),
  the oldest supported versions of the dependencies are installed.
- The option `-W error` is added to pytest, so that it fails in case of a warning.
Copy link
Contributor

sourcery-ai bot commented Jun 8, 2024

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:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

deepsource-io bot commented Jun 8, 2024

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.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @tovrstra - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

.github/workflows/pytest.yaml Outdated Show resolved Hide resolved
tovrstra and others added 4 commits June 8, 2024 10:37
Copy link
Member

@PaulWAyers PaulWAyers left a comment

Choose a reason for hiding this comment

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

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. 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 and @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.

@matt-chan
Copy link
Member

matt-chan commented Jun 10, 2024 via email

@PaulWAyers
Copy link
Member

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.

Copy link
Member

@PaulWAyers PaulWAyers left a comment

Choose a reason for hiding this comment

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

@matt-chan reassured me that we can bump HORTON 2.3 to Python 3.11 or later in short order, so it should be fine.

@tovrstra
Copy link
Member Author

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.

@tovrstra tovrstra merged commit df4c5ab into theochem:main Jun 11, 2024
10 checks passed
@tovrstra tovrstra deleted the stricter-testing branch June 11, 2024 10:01
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.

3 participants