Skip to content

Commit

Permalink
Add stubs for RethinkDB
Browse files Browse the repository at this point in the history
  • Loading branch information
McSinyx committed Dec 5, 2020
1 parent 3df2e9a commit b32b09d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .builds/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: debian/stable
image: debian/buster
packages:
- tox
sources:
Expand Down
3 changes: 2 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[mypy]
files = src/*.pyi
files = stubs/**.pyi
warn_unused_configs = true
warn_unreachable = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions stubs/rethinkdb/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Optional, Type

from .trio_net.net_trio import TrioConnectionPool

class RethinkDB:
ConnectionPool: Type[TrioConnectionPool]
def __init__(self) -> None: ...
def set_loop_type(self, library: Optional[str]) -> None: ...

r: RethinkDB
Empty file.
5 changes: 5 additions & 0 deletions stubs/rethinkdb/trio_net/net_trio.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Any

class TrioConnectionPool:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
async def close(self) -> None: ...
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deps =
mypy >= 0.790
pytest-trio
trio-typing
commands = mypy src/acanban tests
commands = mypy src stubs tests

[testenv:style]
skip_install = true
Expand Down

0 comments on commit b32b09d

Please sign in to comment.