В папке my_package:
Код: Выделить всё
# example.py
def foo(number: int, text: str) -> None:
print(number)
print(text)
В корневой папке файл setup.py:
Код: Выделить всё
from setuptools import setup
setup(
name='ExamplePackage',
version='0.1.0',
author='An Awesome Coder',
author_email='aac@example.com',
packages=['my_package'],
description='An awesome package that does something',
)
Код: Выделить всё
from my_package.example import foo
# No mypy errors at all!
x = foo()
def internal_foo(number: int, text: str) -> None:
print(number)
print(text)
# Missing positional arguments "number", "text" in call to "internal_foo" [call-arg]
# "internal_foo" does not return a value [func-returns-value]
y = internal_foo()
Код: Выделить всё
[mypy]
ignore_missing_imports = True
show_error_codes = True
strict = True
check_untyped_defs = True
raise_exceptions = True
Любая помощь будет очень признательна
Подробнее здесь: https://stackoverflow.com/questions/741 ... m-an-exter