How to add console_script/entry point to setup.py that call a class function python

Viewed 1524

I want to add an entry point to setup.py that calls a static method of a class. Is that possible, and if so how? I've tried, and looked up documentation, but can not figure out how to do it.

Example: Package format:

mypackage/
   setup.py
   mypackage/
      test.py

test.py contains:

class TestClass:
   @staticmethod
   test_func():
      print("test print statement")

setup.py contains console scripts that look like:

entry_points={
        'console_scripts': [
            'run_console_script = mypackage.test:TestClass.test_func'
         ]}

But when I run the above code, it doesn't error, and yet nothing is printed.

1 Answers
Related