Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for executable script is missing #9

Closed
guettli opened this issue Mar 17, 2014 · 2 comments
Closed

Example for executable script is missing #9

guettli opened this issue Mar 17, 2014 · 2 comments

Comments

@guettli
Copy link

guettli commented Mar 17, 2014

Hi, I am missing an example how to package an executable script.

Imagine you have mygrep.py the world best grep replacement.

How to structure the files and directories?

AFAIK the script (here mygrep.py) is almost empty. It just imports from the library and calls its main() method.

A simple example inside this sampleproject would be nice.

@pfmoore
Copy link
Member

pfmoore commented Mar 17, 2014

The recommendation is that you shouldn't use executable scripts, you should use entry points - which are covered. So the omission is deliberate.

@guettli
Copy link
Author

guettli commented Mar 21, 2014

I am sorry. I was blind. There is an example for 'console_scripts':

# setup.py

    # To provide executable scripts, use entry points in preference to the
    # "scripts" keyword. Entry points provide cross-platform support and allow
    # pip to create the appropriate form of executable for the target platform.
    entry_points={
        'console_scripts': [
            'sample=sample:main',
        ],
    },

@guettli guettli closed this as completed Mar 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants