nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv
2, lib
3, buildPythonPackage
4, pythonOlder
5, isPy27
6, backports-entry-points-selectable
7, cython
8, distlib
9, fetchPypi
10, filelock
11, flaky
12, importlib-metadata
13, importlib-resources
14, pathlib2
15, platformdirs
16, pytest-freezegun
17, pytest-mock
18, pytest-timeout
19, pytestCheckHook
20, setuptools-scm
21, six
22}:
23
24buildPythonPackage rec {
25 pname = "virtualenv";
26 version = "20.14.0";
27
28 src = fetchPypi {
29 inherit pname version;
30 sha256 = "sha256-jltAIDcocSboHM3pQyuVqL5bGdNlhPZJVwYKNIjBHKg=";
31 };
32
33 nativeBuildInputs = [
34 setuptools-scm
35 ];
36
37 propagatedBuildInputs = [
38 backports-entry-points-selectable
39 distlib
40 filelock
41 platformdirs
42 six
43 ] ++ lib.optionals (pythonOlder "3.4" && !stdenv.hostPlatform.isWindows) [
44 pathlib2
45 ] ++ lib.optionals (pythonOlder "3.7") [
46 importlib-resources
47 ] ++ lib.optionals (pythonOlder "3.8") [
48 importlib-metadata
49 ];
50
51 patches = lib.optionals (isPy27) [
52 ./0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
53 ];
54
55 checkInputs = [
56 cython
57 flaky
58 pytest-freezegun
59 pytest-mock
60 pytest-timeout
61 pytestCheckHook
62 ];
63
64 preCheck = ''
65 export HOME=$(mktemp -d)
66 '';
67
68 # Ignore tests which require network access
69 disabledTestPaths = [
70 "tests/unit/create/test_creator.py"
71 "tests/unit/seed/embed/test_bootstrap_link_via_app_data.py"
72 ];
73
74 disabledTests = [
75 # Permission Error
76 "test_bad_exe_py_info_no_raise"
77 ] ++ lib.optionals isPy27 [
78 "test_python_via_env_var"
79 "test_python_multi_value_prefer_newline_via_env_var"
80 ];
81
82 pythonImportsCheck = [ "virtualenv" ];
83
84 meta = with lib; {
85 description = "A tool to create isolated Python environments";
86 homepage = "http://www.virtualenv.org";
87 license = licenses.mit;
88 maintainers = with maintainers; [ goibhniu ];
89 };
90}