Add slotscheck#1233
Conversation
| # correctly with Python 3.10. That lib is a dependency of `nitpick`! | ||
| nitpick = { version = "^0.29", python = "<3.10" } | ||
| codespell = "^2.1" | ||
| slotscheck = "^0.5.1" |
There was a problem hiding this comment.
| slotscheck = "^0.5.1" | |
| slotscheck = "^0.5" |
| require-subclass = true | ||
| require-superclass = true | ||
| exclude-modules = 'returns\.contrib\.mypy' | ||
| exclude-classes = 'returns\.primitives\.exceptions:UnwrapFailedError' |
There was a problem hiding this comment.
Why do we exclude it? 🤔
I think it has __slots__: https://github.com/dry-python/returns/blob/master/returns/primitives/exceptions.py#L12
There was a problem hiding this comment.
BaseException (Python stdlib) doesn't have slots (see questions in 'open questions' in top comment)
Let's go with
I think having a |
|
Codecov Report
@@ Coverage Diff @@
## master #1233 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 79 79
Lines 2434 2434
Branches 211 211
=========================================
Hits 2434 2434 Continue to review full report at Codecov.
|
|
@ariebovenberg it is unrelated, I broke it recently somehow (sphinx 😒 ). Fix in a separate PR is highly appreciated. |
An issue is a start: #1234 |
I have made things!
@sobolevn kindly invited me to add slotscheck to the CI.
Checklist
I have created at least one test case for the changes I have maden/aCHANGELOG.mdRelated issues
related: #1147, #1144
Open questions
test_slots.py. This meansreturns.contrib.mypyis not checked. We can either:a) add slots to
mypyplugin classesb) keep the current ignore
c) run
slotscheckon this part of the code with more relaxed settings (there is an issue open multi-setting support if you have an opinion)UnwrapFailedErrorclass reports an error. This is becauseBaseExceptionactually has a__dict__. We can either:a) remove slots from
UnwrapFailedErrorb) keep the current ignore