linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / virtualenv / default.nix
blobec22660830bda983a9db240f41286b0dd111c597
1 { buildPythonPackage
2 , appdirs
3 , contextlib2
4 , cython
5 , distlib
6 , fetchPypi
7 , filelock
8 , flaky
9 , importlib-metadata
10 , importlib-resources
11 , isPy27
12 , lib
13 , pathlib2
14 , pytest-freezegun
15 , pytest-mock
16 , pytest-timeout
17 , pytestCheckHook
18 , pythonOlder
19 , setuptools_scm
20 , six
21 , stdenv
24 buildPythonPackage rec {
25   pname = "virtualenv";
26   version = "20.2.2";
28   src = fetchPypi {
29     inherit pname version;
30     sha256 = "b7a8ec323ee02fb2312f098b6b4c9de99559b462775bc8fe3627a73706603c1b";
31   };
33   nativeBuildInputs = [
34     setuptools_scm
35   ];
37   propagatedBuildInputs = [
38     appdirs
39     distlib
40     filelock
41     six
42   ] ++ lib.optionals isPy27 [
43     contextlib2
44   ] ++ lib.optionals (isPy27 && !stdenv.hostPlatform.isWindows) [
45     pathlib2
46   ] ++ lib.optionals (pythonOlder "3.7") [
47     importlib-resources
48   ] ++ lib.optionals (pythonOlder "3.8") [
49     importlib-metadata
50   ];
52   patches = lib.optionals (isPy27) [
53     ./0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
54   ];
56   checkInputs = [
57     cython
58     flaky
59     pytest-freezegun
60     pytest-mock
61     pytest-timeout
62     pytestCheckHook
63   ];
65   preCheck = ''
66     export HOME=$(mktemp -d)
67   '';
69   # Ignore tests which require network access
70   disabledTestPaths = [
71     "tests/unit/create/test_creator.py"
72     "tests/unit/seed/embed/test_bootstrap_link_via_app_data.py"
73   ];
75   disabledTests = [
76     "test_can_build_c_extensions"
77     "test_xonsh" # imports xonsh, which is not in pythonPackages
78     # tests search `python3`, fail on python2, pypy
79     "test_python_via_env_var"
80     "test_python_multi_value_prefer_newline_via_env_var"
81   ];
83   pythonImportsCheck = [ "virtualenv" ];
85   meta = with lib; {
86     description = "A tool to create isolated Python environments";
87     homepage = "http://www.virtualenv.org";
88     license = licenses.mit;
89     maintainers = with maintainers; [ goibhniu ];
90   };