Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine Lambert
swh-core
Commits
68d27741
Commit
68d27741
authored
2 years ago
by
Antoine Lambert
Browse files
Options
Downloads
Patches
Plain Diff
mypy: Bump to 1.0 and fix new typing errors
Related to
swh/meta#4960
parent
4f3d8c12
No related branches found
No related tags found
No related merge requests found
Pipeline
#858
failed
2 years ago
Stage: external
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
swh/core/collections.py
+1
-1
1 addition, 1 deletion
swh/core/collections.py
swh/core/db/tests/test_db.py
+2
-7
2 additions, 7 deletions
swh/core/db/tests/test_db.py
tox.ini
+1
-1
1 addition, 1 deletion
tox.ini
with
4 additions
and
9 deletions
swh/core/collections.py
+
1
−
1
View file @
68d27741
...
...
@@ -19,7 +19,7 @@ class SortedList(Generic[SortedListKey, SortedListItem]):
def
__init__
(
self
,
data
:
List
[
SortedListItem
]
=
None
,
data
:
List
[
SortedListItem
]
=
[]
,
key
:
Optional
[
Callable
[[
SortedListItem
],
SortedListKey
]]
=
None
,
):
if
key
is
None
:
...
...
This diff is collapsed.
Click to expand it.
swh/core/db/tests/test_db.py
+
2
−
7
View file @
68d27741
...
...
@@ -8,7 +8,7 @@ import datetime
from
enum
import
IntEnum
import
inspect
from
string
import
printable
from
typing
import
Any
from
typing
import
Any
,
Callable
from
unittest.mock
import
MagicMock
,
Mock
import
uuid
...
...
@@ -17,17 +17,12 @@ from hypothesis.extra.pytz import timezones
import
psycopg2
import
pytest
from
pytest_postgresql
import
factories
from
typing_extensions
import
Protocol
from
swh.core.db
import
BaseDb
from
swh.core.db.common
import
db_transaction
,
db_transaction_generator
from
swh.core.db.tests.conftest
import
function_scoped_fixture_check
# workaround mypy bug https://github.com/python/mypy/issues/5485
class
Converter
(
Protocol
):
def
__call__
(
self
,
x
:
Any
)
->
Any
:
...
Converter
=
Callable
[[
Any
],
Any
]
@dataclass
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
1
−
1
View file @
68d27741
...
...
@@ -50,7 +50,7 @@ extras =
http
github
deps
=
mypy
=
=
0.942
mypy
=
=
1.0
commands
=
mypy
swh
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment