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

[pre-commit.ci] pre-commit autoupdate #6033

Closed
wants to merge 2 commits into from

Conversation

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 87c2c4a to 03282a5 Compare July 8, 2024 17:48
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.81%. Comparing base (2609afb) to head (f83b9d5).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6033   +/-   ##
=======================================
  Coverage   89.81%   89.81%           
=======================================
  Files          88       88           
  Lines       23174    23174           
  Branches     5045     5045           
=======================================
  Hits        20814    20814           
  Misses       1623     1623           
  Partials      737      737           

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

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 075b5b2 to 06741b7 Compare July 15, 2024 18:00
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from e302879 to 853d43a Compare July 22, 2024 18:02
@pp-mo
Copy link
Member

pp-mo commented Jul 23, 2024

This is a bit weird.

(1) The ruff errors are clear enough : it now doesn't like file.readlines(), so can be removed.
see : a7db47f

but
(2) MyPy is complaining about Missing positional argument "self" in call to "__call__" of "_Wrapped", applying in various places where iris-something.name() is called.

This seems like a bug in MyPy, either that or "wraps" is not doing its job properly ?
I think it may be python/mypy#17166
A prototype fix : bd142d3

@pp-mo
Copy link
Member

pp-mo commented Jul 23, 2024

@bjlittle can you re-review this + let me know what you think ?

Hint : you might think the MyPy workaround is a bit nasty.
But right now I'm not really sure what would be better (!)

@bjlittle bjlittle force-pushed the pre-commit-ci-update-config branch from bd142d3 to 31573c1 Compare July 27, 2024 11:38
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 31573c1 to bba2f0a Compare July 29, 2024 18:04
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from ad0c79c to 4723118 Compare August 12, 2024 17:57
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 881b018 to 24a507d Compare September 16, 2024 18:00
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.6.8](astral-sh/ruff-pre-commit@v0.4.10...v0.6.8)
- [github.com/PyCQA/flake8: 7.1.0 → 7.1.1](PyCQA/flake8@7.1.0...7.1.1)
- [github.com/asottile/blacken-docs: 1.16.0 → 1.18.0](adamchainz/blacken-docs@1.16.0...1.18.0)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.11.2](pre-commit/mirrors-mypy@v1.9.0...v1.11.2)
- [github.com/numpy/numpydoc: v1.7.0 → v1.8.0](numpy/numpydoc@v1.7.0...v1.8.0)
@pp-mo
Copy link
Member

pp-mo commented Oct 2, 2024

We are being bitten here by a MyPy problem which seems generic + unresolved

When I run the MyPy checks locally on all files, there are quite a few occurrences :

$ pre-commit run mypy -a 
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

lib/iris/fileformats/netcdf/saver.py:957: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/fileformats/netcdf/saver.py:958: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/fileformats/netcdf/saver.py:960: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/analysis/__init__.py:2463: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/analysis/__init__.py:2533: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/analysis/__init__.py:2557: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/analysis/__init__.py:2558: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1430: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1540: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1554: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1561: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1643: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1787: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1969: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:1995: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2027: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2075: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2095: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2377: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2384: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2569: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2612: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2619: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2673: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2716: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2724: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2894: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2907: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:2918: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:3746: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4316: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4320: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4537: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4544: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4845: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4872: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/cube.py:4880: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/mesh/utils.py:99: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/mesh/utils.py:150: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/mesh/utils.py:154: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/tests/integration/test_netcdf__loadsaveattrs.py:417: error: Missing positional argument "self" in call to "__call__" of "_Wrapped"  [call-arg]
lib/iris/tests/stock/__init__.py:778: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/tests/stock/__init__.py:779: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/tests/test_coding_standards.py:88: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/tests/test_coding_standards.py:157: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
lib/iris/tests/test_coding_standards.py:163: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Found 38 errors in 4 files (checked 663 source files)

So, I think the only reason we haven't seen a long list of errors here is that the check is only run on modified files.

The specific problems here all seem to relate to the definition of 'name()' for a CFVariableMixin - derived Iris object (i.e. an object with CF-type standard_name/long_name/attributes etc)
That is declared here

@trexfeathers
Copy link
Contributor

It's very kind of you to look into this @pp-mo but feel free to leave it with me if you have other priorities (we assigned it to me last week)

@pp-mo
Copy link
Member

pp-mo commented Oct 2, 2024

It's very kind of you to look into this @pp-mo but feel free to leave it with me if you have other priorities (we assigned it to me last week)

OK that makes sense -- I had forgotten.
I'll leave it to you, as it seems to involve strategic choices !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants