python-shell.nix 393 B

12345678910111213141516171819202122232425
  1. {pyVersion, pyPkgs ? [], pkgs ? import <nixpkgs> {}}:
  2. # E.g. --arg pyVersion \"python36\" --arg pyPkgs '[ "requests" "tox" ]'
  3. with pkgs;
  4. (
  5. let
  6. py = builtins.getAttr pyVersion pkgs;
  7. in
  8. py.withPackages (ps: with ps; [
  9. setuptools
  10. pip
  11. wheel
  12. flake8
  13. pycodestyle
  14. coverage
  15. virtualenv
  16. virtualenvwrapper
  17. ] ++ map (x :builtins.getAttr x ps) pyPkgs)
  18. ).env