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

[docs] do not suggest install with pip install jpterm #81

Open
baggiponte opened this issue Mar 7, 2024 · 6 comments
Open

[docs] do not suggest install with pip install jpterm #81

baggiponte opened this issue Mar 7, 2024 · 6 comments

Comments

@baggiponte
Copy link

Thanks for making jpterm!

I would like to suggest to avoid suggesting to install stuff with pip install. For CLI-based tools, pythonistas should use pipx. Unfortunately, pip install and even pip install --user can mess with your system python.

I could open a PR highlighting the best practices and suggest a recommended workflow, and/or suggest other tools that enable "global installs" like pixi (AFAIK only rye right now).

@davidbrochart
Copy link
Owner

I'm not familiar with pipx, but I've seen e.g. toolong suggests to use it.
The way jpterm is currently released is by exactly pinning dependencies, so I don't know if pipx will bring something better?
Happy to be proved wrong, if you want to open a PR 😄

@baggiponte
Copy link
Author

I'm not familiar with pipx, but I've seen e.g. toolong suggests to use it.

Basically, it wraps pip + virtualenv to install tools in a virtual env so that the system and user env is not "polluted" with other dependencies.

The way jpterm is currently released is by exactly pinning dependencies, so I don't know if pipx will bring something better?

Short answer: I don't know. Long answer: since it's a CLI with exact requirements, installing in a venv is another safety guarantee to prevent a foot gun. But the dependencies that you use are so niche that it might not happen (e.g. you are not pinning numpy).

I'll open it later this week! :)

@baggiponte
Copy link
Author

Hey there, I was working on a PR and I realised one thing. If jpterm works like jupyter, you might want to have it installed in a venv or use ipykernel, am I right?

I set out to test that and I noticed the CTRL + E shortcut does not run any cell. I am on the latest macOS and I tried both with alacritty and macOS Terminal app.

@davidbrochart
Copy link
Owner

Yes, ipykernel should be installed. Maybe Ctrl-E is caught by your shell, doesn Ctrl-R work?

@baggiponte
Copy link
Author

Yes, ipykernel should be installed. Maybe Ctrl-E is caught by your shell, doesn Ctrl-R work?

Oh definitely, you are right. They are both caught by the shell (ctrl-e is inverse history search; ctrl-e is "edit current command in $EDITOR". Can I change them?

@davidbrochart
Copy link
Owner

On my terminal Ctrl-E goes at the end of the line, and Ctrl-R is reverse-i-search, but it works in Textual anyway. I'm wondering why Textual doesn't overwrite these key bindings for you, maybe worth opening an issue in Textual? It's not currently possible to change key bindings in jpterm.

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