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

nixpkgs python repl isn't very terminal-friendly #17607

Closed
copumpkin opened this issue Aug 9, 2016 · 8 comments
Closed

nixpkgs python repl isn't very terminal-friendly #17607

copumpkin opened this issue Aug 9, 2016 · 8 comments

Comments

@copumpkin
Copy link
Member

Issue description

I can't use standard terminal keys in the python from nixpkgs.

Steps to reproduce

  1. nix-shell -p python
  2. python
  3. Enter 5 + 5
  4. Press the up arrow.
  5. Weep when you see ^[[A
  6. Press the left arrow
  7. Weep when you see ^[[D
  8. Press ctrl-A
  9. Weep when you see ^A

Technical details

I tried it on darwin nixpkgs and on NixOS:

  • NixOS version: 16.03pre73316.93d8671 (Emu)
  • Darwin Nixpkgs version: 16.09pre87549.8a1e7cd
@rvl
Copy link
Contributor

rvl commented Aug 9, 2016

Readline is available if you use nix-shell -p pythonFull.

Do you mean that the default python attribute should be changed, and/or documentation added?

@copumpkin
Copy link
Member Author

Yeah, perhaps my issue is just using the default python. Note that this also affects transitive dependencies, so if I do nix-shell -p pythonPackages.boto3 the python I get in there will also be unfriendly.

It's also kind of awkward to have the distinction, because if I do nix-shell -p pythonPackages.boto3 pythonFull I end up with no readline, but nix-shell -p pythonFull pythonPackages.boto3 gives me a version with readline.

I don't know why the default attribute is the weaker version, and I don't necessarily want to replace it by pythonFull, but I do want the overall default experience to be good for people coming from other systems. As it stands, it seems like making readline optional adds some confusion.

@FRidh
Copy link
Member

FRidh commented Aug 9, 2016

By default python is a stripped version. All packages that use buildPythonPackage also depend on this version.

It's also kind of awkward to have the distinction, because if I do nix-shell -p pythonPackages.boto3 pythonFull I end up with no readline, but nix-shell -p pythonFull pythonPackages.boto3 gives me a version with readline.

I guess the setupHook together with PYTHONPATH being evaluated from left to right is responsible for that.

I do want the overall default experience to be good for people coming from other systems

Do we want python to refer to a full version of Python by default, or do we want to point it to something that is sufficient for most users and especially sufficient for most other packages that depend on Python, and taking into account the closure size?

@domenkozar
Copy link
Member

We should include readline by default. I've been long wanting to do that, but never had the time.

@copumpkin
Copy link
Member Author

@domenkozar what's the downside? All python packages gain a slightly smaller runtime closure?

@domenkozar
Copy link
Member

I think we'll survive:

$ du -sh $(nix-build -A readline.all)
752K    /nix/store/q97il2whcmnmcyvr62n252f1ay5i4irq-readline-6.3p08
168K    /nix/store/mbsx71lzniqhhv4fi7al50aavqmqq4a9-readline-6.3p08-dev
888K    /nix/store/2aj8lx78bfnmhmbjvh34f0amqnfibbaq-readline-6.3p08-doc

@copumpkin
Copy link
Member Author

😱

@FRidh
Copy link
Member

FRidh commented Oct 14, 2016

Fixes with #19309.

@FRidh FRidh closed this as completed Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants