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

Make proper executable with entry_point #2

Open
bollwyvl opened this issue Apr 1, 2021 · 6 comments
Open

Make proper executable with entry_point #2

bollwyvl opened this issue Apr 1, 2021 · 6 comments

Comments

@bollwyvl
Copy link

bollwyvl commented Apr 1, 2021

I'd recommend the entry_point approach, as it is generally preferable to using python -m if possible, as -m can have... unwanted side-effects. Further, a conda downstream will do a good job of making it robust on different platforms.

@martinRenou
Copy link
Member

I did use the entry_point approach: https://github.com/martinRenou/json-lsp/blob/master/setup.py#L20-L24

Should I do it in another way?

@bollwyvl
Copy link
Author

bollwyvl commented Apr 1, 2021

sorry, yes, the lsp entry_point is 👍

I mean for the thing-what-runs, e.g. https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html

setup(
    ...
    entry_points = {
        'console_scripts': ['json-lsp-or-whatever=json_lsp.main:main'],
    }
    ...
)

@martinRenou
Copy link
Member

I see. So I would need two entry points, one for the console script (that actually runs the json-lsp binary) and one for lsp (that provides the spec)?

@bollwyvl
Copy link
Author

bollwyvl commented Apr 1, 2021

Or go to flit
https://flit.readthedocs.io/en/latest/pyproject_toml.html#scripts-section

...and get reproducible wheels, too 🎡

@bollwyvl
Copy link
Author

bollwyvl commented Apr 1, 2021

right. then you can either use the shell helper instead of the python one... or just return the dictionary, and not have a dependency on on jupyter_lsp at all... that was for us to reduce boilerplate. we did the thing for pyls for... reasons. probably windows. don't remember now.

@martinRenou
Copy link
Member

I didn't know about flit! Thanks for the pointer

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