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

Include an entrypoint for compatibility with pipx #125

Open
simonw opened this issue Oct 23, 2023 · 2 comments
Open

Include an entrypoint for compatibility with pipx #125

simonw opened this issue Oct 23, 2023 · 2 comments
Labels
feature request Feature Request or Proposal question Further information is requested

Comments

@simonw
Copy link

simonw commented Oct 23, 2023

I'd like to be able to do this:

pipx install chdb
chdb "SELECT 1,'abc'" Pretty

As an alternative to this:

pip install chdb
python3 -m chdb "SELECT 1,'abc'" Pretty

The reason I want this is that pipx automates the process of creating a separate virtual environment for each tool, so it lets me try out tools like chdb without manually creating a virtual environment for it.

This currently doesn't work, because the chdb package does not declare a CLI tool entrypoint. I get this error:

pipx install chdb
No apps associated with package chdb or its dependencies. If you are
attempting to install a library, pipx should not be used. Consider using pip
or a similar tool instead.

I think one way to implement this would be to add this to setup.py:

    entry_points="""
        [console_scripts]
        chdb=chdb.__main__:main
    """,
@lmangani
Copy link
Contributor

lmangani commented Oct 23, 2023

Hey @simonw thanks for the suggestion! If the method you mentioned works, feel free to raise a PR and we'll try it out!

I'm not an expert but my understanding (confirmed by the output example) was pipx should not be used for libraries such as chdb. Could chdb-cli perhaps be a better target for this request?

@lmangani lmangani added question Further information is requested feature request Feature Request or Proposal labels Oct 23, 2023
@simonw
Copy link
Author

simonw commented Oct 23, 2023

I didn't know about chdb-cli! Does that offer the same functionality as python -m chdb or is it meant to solve a different purpose?

Personally I really like the pattern of Python libraries which offer a CLI tool as part of the same package - my https://sqlite-utils.datasette.io and https://llm.datasette.io packages both do this - but I understand that tastes on this may differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature Request or Proposal question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants