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
python doc: update virtualenv section #55265
Conversation
- make it easy to switch python 2/3 - add glibcLocales dep (not sure it is still required after NixOS#54485 but manual is also used by users of Nixpkgs versions <19.03) - use `mkShell` - use `libffi`, as it is required for Python3 `cryptography` (in my setup it worked with Python2 without this dep) - set PYTHONPATH. Either this or `source venv/bin/activate` was missing. Closes NixOS#46909
Considering this example is not a supported workflow it should never have been part of the manual. |
@FRidh mmm, what are the problems here? I do advocate exactly this (wiki section https://nixos.wiki/wiki/Python#Emulating_virtualenv_with_nix-shell), and do use exactly this at company (I'm forced to, because I use NixOS). But in case this isn't supported by you, then it's fine. I'll merge it before branchoff if there are no other objections. |
@FRidh I've found your concerns at #21837 (review) Now I understand that even if this example can work for some (me included), it is not easy to make it work in general case. |
It wouldn't be necessary after #54485 however for nixpkgs itself we also need support on macOS, which is also possible to add, but I currently have not the OS to implement it and test it. If you are only up to support linux, then you can already use it. |
I think it is OK to have it in the manual, if we mention the limitations of it, I even think we still need this option because using nixpkgs python package sets limits one to the versions given by nixpkgs. These are likely to be not compatible with whatever a different project is working on. Also we https://github.com/garbas/pypi2nix it forces one to create your own list of overrides for every package |
Closing this, as |
@danbst , Sorry to resurrect an old PR, but I love this! Thank you. |
Another sorry for resurrecting this PR, but the example giving in the wiki is (maybe?) wrong? Shouldn't |
yes. The wiki allows logins via github, if you want to fix it. |
but manual is also used by users of Nixpkgs versions <19.03)
mkShell
libffi
, as it is required for Python3cryptography
(in my setup it worked with Python2 without this dep)source venv/bin/activate
was missing.Closes #46909
cc @FRidh @MelleB