Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typings #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]},
)