1{ lib
2, buildPythonPackage
3, pythonOlder
4, isPy27
5, isPyPy
6, cython
7, distlib
8, fetchPypi
9, filelock
10, flaky
11, hatch-vcs
12, hatchling
13, importlib-metadata
14, platformdirs
15, pytest-freezegun
16, pytest-mock
17, pytest-timeout
18, pytestCheckHook
19, time-machine
20}:
21
22buildPythonPackage rec {
23 pname = "virtualenv";
24 version = "20.24.5";
25 format = "pyproject";
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchPypi {
30 inherit pname version;
31 hash = "sha256-6DYZZ/bab73xQmSDv+n8qCh8JCrAvDBCmQVyHO+/91I=";
32 };
33
34 nativeBuildInputs = [
35 hatch-vcs
36 hatchling
37 ];
38
39 propagatedBuildInputs = [
40 distlib
41 filelock
42 platformdirs
43 ] ++ lib.optionals (pythonOlder "3.8") [
44 importlib-metadata
45 ];
46
47 nativeCheckInputs = [
48 cython
49 flaky
50 pytest-freezegun
51 pytest-mock
52 pytest-timeout
53 pytestCheckHook
54 ] ++ lib.optionals (!isPyPy) [
55 time-machine
56 ];
57
58 preCheck = ''
59 export HOME=$(mktemp -d)
60 '';
61
62 disabledTestPaths = [
63 # Ignore tests which require network access
64 "tests/unit/create/test_creator.py"
65 "tests/unit/seed/embed/test_bootstrap_link_via_app_data.py"
66 ];
67
68 disabledTests = [
69 # Network access
70 "test_create_no_seed"
71 "test_seed_link_via_app_data"
72 # Permission Error
73 "test_bad_exe_py_info_no_raise"
74 ] ++ lib.optionals (isPyPy) [
75 # encoding problems
76 "test_bash"
77 # permission error
78 "test_can_build_c_extensions"
79 # fails to detect pypy version
80 "test_discover_ok"
81 ];
82
83 pythonImportsCheck = [
84 "virtualenv"
85 ];
86
87 meta = with lib; {
88 description = "A tool to create isolated Python environments";
89 homepage = "http://www.virtualenv.org";
90 changelog = "https://github.com/pypa/virtualenv/blob/${version}/docs/changelog.rst";
91 license = licenses.mit;
92 maintainers = with maintainers; [ goibhniu ];
93 };
94}