depot/third_party/nixpkgs/pkgs/development/python-modules/virtualenv/default.nix
Default email 841d9c7fc1 Project import generated by Copybara.
GitOrigin-RevId: 3a8d7958a610cd3fec3a6f424480f91a1b259185
2021-06-29 00:13:55 +01:00

91 lines
1.8 KiB
Nix

{ buildPythonPackage
, appdirs
, contextlib2
, cython
, distlib
, fetchPypi
, filelock
, flaky
, importlib-metadata
, importlib-resources
, isPy27
, lib
, pathlib2
, pytest-freezegun
, pytest-mock
, pytest-timeout
, pytestCheckHook
, pythonOlder
, setuptools-scm
, six
, stdenv
}:
buildPythonPackage rec {
pname = "virtualenv";
version = "20.4.7";
src = fetchPypi {
inherit pname version;
sha256 = "14fdf849f80dbb29a4eb6caa9875d476ee2a5cf76a5f5415fa2f1606010ab467";
};
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [
appdirs
distlib
filelock
six
] ++ lib.optionals isPy27 [
contextlib2
] ++ lib.optionals (isPy27 && !stdenv.hostPlatform.isWindows) [
pathlib2
] ++ lib.optionals (pythonOlder "3.7") [
importlib-resources
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
];
patches = lib.optionals (isPy27) [
./0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch
];
checkInputs = [
cython
flaky
pytest-freezegun
pytest-mock
pytest-timeout
pytestCheckHook
];
preCheck = ''
export HOME=$(mktemp -d)
'';
# Ignore tests which require network access
disabledTestPaths = [
"tests/unit/create/test_creator.py"
"tests/unit/seed/embed/test_bootstrap_link_via_app_data.py"
];
disabledTests = [
"test_can_build_c_extensions"
"test_xonsh" # imports xonsh, which is not in pythonPackages
# tests search `python3`, fail on python2, pypy
"test_python_via_env_var"
"test_python_multi_value_prefer_newline_via_env_var"
];
pythonImportsCheck = [ "virtualenv" ];
meta = with lib; {
description = "A tool to create isolated Python environments";
homepage = "http://www.virtualenv.org";
license = licenses.mit;
maintainers = with maintainers; [ goibhniu ];
};
}