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

Upgrade ruff in pre commit to 0.9.1 #9712

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

larsevj
Copy link
Contributor

@larsevj larsevj commented Jan 13, 2025

Mainly formatting changes, there is also the change to PluginMetadate into a dataclass based on the following rule https://docs.astral.sh/ruff/rules/class-as-data-structure/, but could also ignore this rule if we want to.

  • PR title captures the intent of the changes, and is fitting for release notes.
  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.
  • Make sure unit tests pass locally after every commit (git rebase -i main --exec 'pytest tests/ert/unit_tests -n logical -m "not integration_test"')

When applicable

  • When there are user facing changes: Updated documentation
  • New behavior or changes to existing untested code: Ensured that unit tests are added (See Ground Rules).
  • Large PR: Prepare changes in small commits for more convenient review
  • Bug fix: Add regression test for the bug
  • Bug fix: Create Backport PR to latest release

@larsevj larsevj force-pushed the upgrade_ruff_in_pre_commit_to_9 branch from 4a8fc94 to 65f34db Compare January 13, 2025 08:33
@larsevj larsevj added the release-notes:skip If there should be no mention of this in release notes label Jan 13, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.72%. Comparing base (ea36931) to head (21cc24a).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...rc/_ert/forward_model_runner/forward_model_step.py 0.00% 2 Missing ⚠️
src/ert/gui/suggestor/_suggestor_message.py 0.00% 1 Missing ⚠️
src/ert/gui/tools/workflows/run_workflow_widget.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9712      +/-   ##
==========================================
- Coverage   91.76%   91.72%   -0.05%     
==========================================
  Files         426      426              
  Lines       26542    26549       +7     
==========================================
- Hits        24356    24351       -5     
- Misses       2186     2198      +12     
Flag Coverage Δ
cli-tests 39.78% <31.25%> (+0.01%) ⬆️
everest-models-test 34.14% <33.33%> (+0.01%) ⬆️
gui-tests 74.33% <50.00%> (-0.03%) ⬇️
integration-test 37.97% <33.33%> (+0.01%) ⬆️
performance-tests 51.57% <31.25%> (-0.01%) ⬇️
test 39.49% <38.88%> (+<0.01%) ⬆️
unit-tests 74.19% <66.66%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link

codspeed-hq bot commented Jan 13, 2025

CodSpeed Performance Report

Merging #9712 will not alter performance

Comparing larsevj:upgrade_ruff_in_pre_commit_to_9 (21cc24a) with main (051fa31)

Summary

✅ 24 untouched benchmarks

@berland
Copy link
Contributor

berland commented Jan 13, 2025

Looks good, but could you reverse the commit order to make every commit passing tests?

@larsevj
Copy link
Contributor Author

larsevj commented Jan 13, 2025

Looks good, but could you reverse the commit order to make every commit passing tests?

I planned on squashing them, was just unsure if it was best to use NamedTuple or dataclass for the PluginMetadata class.

@@ -4,7 +4,7 @@
JOB_FAILURE = "Failed"


DEFAULT_DATA_SUMMARY_KEYS = ("YEAR", "YEARSTCPU", "TCPUDAY", "MONTH", "DAY")
DEFAULT_DATA_SUMMARY_KEYS = ("YEAR", "YEARS", "TCPU", "TCPUDAY", "MONTH", "DAY")
Copy link
Contributor

Choose a reason for hiding this comment

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

wow!

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth another issue to track down why this was not caught in tests earlier?

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 will create another issue and fix it in a seperate pr aswell.

@berland
Copy link
Contributor

berland commented Jan 13, 2025

Looks good, but could you reverse the commit order to make every commit passing tests?

I planned on squashing them, was just unsure if it was best to use NamedTuple or dataclass for the PluginMetadata class.

NamedTupe is fine

@larsevj larsevj force-pushed the upgrade_ruff_in_pre_commit_to_9 branch from 53e9374 to 21cc24a Compare January 13, 2025 11:31
@larsevj larsevj merged commit bd9cb3a into equinor:main Jan 13, 2025
43 checks passed
@larsevj larsevj deleted the upgrade_ruff_in_pre_commit_to_9 branch January 13, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:skip If there should be no mention of this in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants