Skip to content

Commit

Permalink
Add typings
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanforbes committed Dec 4, 2019
1 parent 904fed0 commit b31cce7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.egg-info/
__pycache__/
dist/
.mypy_cache/
16 changes: 16 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[mypy]
incremental = True
warn_unused_configs = True
disallow_any_generics = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_untyped_decorators = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_return_any = True
no_implicit_reexport = True
disallow_any_unimported = True
15 changes: 15 additions & 0 deletions pysblgnt/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import Any, Iterator
from typing_extensions import TypedDict

_BaseRow = TypedDict('_BaseRow', { "ccat-pos": str, "ccat-parse": str })

class _MorphRow(_BaseRow):
bcv: str
robinson: str
text: str
word: str
norm: str
lemma: str

def morphgnt_filename(book_num: int) -> str: ...
def morphgnt_rows(book_num: int) -> Iterator[_MorphRow]: ...
Empty file added pysblgnt/py.typed
Empty file.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
url="https://github.com/morphgnt/py-sblgnt",
author="James Tauber",
author_email="[email protected]",
extras_require={"typings": ["typing_extensions>=3.7.4"]},
packages=["pysblgnt"],
package_data={"": ["sblgnt/*.txt"]},
package_data={"": ["sblgnt/*.txt", "py.typed", "*.pyi"]},
)

0 comments on commit b31cce7

Please sign in to comment.