I am using the python Fire
module with an abstract parent class and a child class. Not all functions are abstract, some functions do not need to be replicated for each child:
parent class
from abc import ABC, abstractmethod
class Foo(ABC):
@abstractmethod
def __init__(self, val=None):
# some initialisations
@abstractmethod
def fun1(self, file=None):
# Some calls
def fun2(self):
# Non abastract func... Some calls
child class (test.py)
import fire
from foo import Foo
class Child(Foo)
def __init__(self, val=None):
super().__init__(val)
# some initialisations
def fun1(file='path/to/file')
# do some stuff
if __name__ == '__main__':
fire.Fire(Child)
when I run python CLI with python -m test --help
I do not get any COMMANDS
i.e. Fire is not recognising any functions to run. However it is recognising the parent global variables and init
flags to set so why is this happening?