Skip to content

Commit 0e94efe

Browse files
committed
PB-911 Add stubs for environ and gunicorn
1 parent 6e2dfa2 commit 0e94efe

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

app/stubs/environ/__init__.pyi

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# basic implementation of the types of django-environ
2+
# since this package is neither critical nor widely used and rather of simple
3+
# nature, API wise, it intentionally contains the minimum needed to satisfy
4+
# the type checker
5+
import builtins
6+
from typing import Dict, List
7+
from _typeshed import Incomplete # pylint: disable=import-error
8+
9+
10+
class Env:
11+
12+
def __init__(self) -> None:
13+
...
14+
15+
def __call__(
16+
self, var: builtins.str, cast=..., default=..., parse_default: builtins.bool = False
17+
):
18+
...
19+
20+
def str(self, var: builtins.str, default=..., multiline: builtins.bool = ...) -> builtins.str:
21+
...
22+
23+
def bool(self, var: builtins.str, default=...) -> builtins.bool:
24+
...
25+
26+
def int(self, var: builtins.str, default=...) -> builtins.str:
27+
...
28+
29+
def list(self,
30+
var,
31+
cast: Incomplete | None = None,
32+
default=...) -> List[builtins.str | builtins.int]:
33+
...
34+
35+
def dict(self, var, cast=..., default=...) -> Dict[builtins.str, builtins.str | builtins.int]:
36+
...

app/stubs/gunicorn/app/base.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Basic implementation of the type for gunicorn used in wsgi.py
2+
# Since this is the only place used and very likely not subject to change,
3+
# this stubbing is intentionally very minimal to just satisfy the type checking
4+
class BaseApplication:
5+
6+
def run(self):
7+
...

0 commit comments

Comments
 (0)