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

Rebuild of QA chain using ruff #220

Merged
merged 9 commits into from
Jun 6, 2024
Merged

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Apr 22, 2024

Description

This PR switches the QA chain away from flake8, black, isort and pyupgrade to ruff: it is significantly faster and looks to be more robust and less version sensitive. This is needed to close #226 - we should be able to support Python 3.12 seamlessly with the new QA chain.

Although pytest-ruff exists, I have also removed QA plugins from the pytest configuration, so pytest-mypy and pytest-flake8 are now retired and not replaced. The rationale for this is that they significantly slow down testing - which is about making sure the code works - and the QA steps are already enforced via pre-commit on local machines and the GA workflows.

Fixes #219

Type of change

  • 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

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

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

@davidorme davidorme linked an issue Apr 22, 2024 that may be closed by this pull request
@davidorme davidorme marked this pull request as ready for review June 6, 2024 07:26
Copy link
Collaborator

@AmyOctoCat AmyOctoCat left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -267,7 +267,8 @@ def __init__(
"co2",
"patm",
"vpd",
] + optimal_chi_class.requires
*optimal_chi_class.requires,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like a strange change. Is it separate to the edits to support ruff?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah - it's this rule: https://docs.astral.sh/ruff/rules/collection-literal-concatenation/

I believe them, but it puzzled me too!

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, its not super obvious is it!

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.24%. Comparing base (62d7a74) to head (dd60fc2).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #220      +/-   ##
===========================================
+ Coverage    95.12%   95.24%   +0.11%     
===========================================
  Files           30       28       -2     
  Lines         1724     1703      -21     
===========================================
- Hits          1640     1622      -18     
+ Misses          84       81       -3     

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

@davidorme davidorme merged commit d4b04e9 into develop Jun 6, 2024
9 checks passed
@davidorme davidorme deleted the 219-explore-use-of-ruff branch June 6, 2024 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Adding compatibility for Python 3.12 Explore use of ruff
5 participants