Element-34/py.saunter

Installation into virtualenv doesn't install the saunter executable

billzingler opened this issue · 1 comments

When I install into a virtualenv using Pip 8.1.2, I get the error:

Invalid script entry point: <ExportEntry saunter = saunter.main:None []> for req: saunter - A callable suffix is required. Cf https://packaging.python.org/en/latest/distributing.html#console-scripts for more information.

I don't encounter this when installing into the OS Python.

Bump. I'm getting the same thing using pyenv. After doing a bit of research it seems you aren't supposed to provide a script as an entry point:

The console_scripts Entry Point
The second approach is called an ‘entry point’. Setuptools allows modules to register entrypoints which other packages can hook into to provide certain functionality. It also provides a few itself, including the console_scripts entry point.

This allows Python functions (not scripts!) to be directly registered as command-line accessible tools.

See: http://python-packaging.readthedocs.io/en/latest/command-line-scripts.html

If I am understanding this, you need wrap all your code inside saunter/main.py in a 'main' function and then change your entry point from:

entry_points={
        "console_scripts": [
            "saunter = saunter.main",
        ],
    }

to:

entry_points={
        "console_scripts": [
            "saunter = saunter.main:main",
        ],
    }