Skip to content

Commit 37f8c5f

Browse files
exploring typing
1 parent 57e10b6 commit 37f8c5f

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ target/
6969
# IPython Notebook
7070
.ipynb_checkpoints
7171

72+
# Mypy
73+
.mypy_cache/
74+
7275
# pyenv
7376
.python-version
7477

@@ -83,7 +86,7 @@ celerybeat-schedule
8386
venv/
8487
ENV/
8588

86-
#PyCharm project folder
89+
# PyCharm project folder
8790
.idea/
8891

8992
# Spyder project settings

mypy.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mypy]
2+
ignore_missing_imports = True

pythonanywhere/api.pyi

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from typing import Dict, List, Any, Type
2+
3+
from requests import Response
4+
5+
PYTHON_VERSIONS = Dict[str, str]
6+
7+
class AuthenticationError(Exception): ...
8+
class NoTokenError(Exception): ...
9+
10+
def get_api_endpoint() -> str: ...
11+
def call_api(url: str, method: str, **kwargs) -> Response: ...
12+
13+
class Webapp:
14+
def __init__(self, domain: str) -> None:
15+
self.domain = Type[str]
16+
...
17+
18+
def __eq__(self, other: Webapp) -> bool: ...
19+
def sanity_checks(self, nuke: bool) -> None: ...
20+
def create(self, python_version: str, virtualenv_path: str, project_path: str, nuke: bool) -> None: ...
21+
def add_default_static_files_mappings(self, project_path: str) -> None: ...
22+
def reload(self) -> None: ...
23+
def set_ssl(self, certificate: str, private_key: str) -> None: ...
24+
def get_ssl_info(self) -> Dict[str, Any]: ...
25+
def delete_log(self, log_type: str, index: int = 0) -> None: ...
26+
def get_log_info(self) -> Dict[str, List[int]]: ...

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ psutil==5.4.0
99
py==1.7.0
1010
pytest==3.2.3
1111
pytest-cov==2.6.0
12+
pytest-mypy
1213
python-dateutil==2.7.5
1314
requests==2.22.0
1415
responses==0.8.1

0 commit comments

Comments
 (0)