Element-34 / py.saunter

sample framework for using selenium with python and page objects
Apache License 2.0
94 stars 35 forks source link

Installation into virtualenv doesn't install the saunter executable #53

Open billzingler opened 8 years ago

billzingler commented 8 years ago

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.

mbroadhead commented 7 years ago

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",
        ],
    }