pip install python-interfaces
from interface import interface
class Iterable:
def be_iterable(self):
pass
@interface(Iterable)
class Foo:
def __init__(self):
pass
# raises InterfaceException
git clone https://github.com/tyleragreen/python-interfaces.git && cd python-interfaces
virtualenv ~/.env/interface
source ~/.env/interface/bin/activate
pip install -r requirements.txt
# Since the tests live outside the package, we install the package in editable mode
pip install -e .
# Format
black .
# Lint
ruff .
# Check static types
pyright
# Test
pytest