mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 03:34:58 +00:00
71 lines
1.4 KiB
Nix
71 lines
1.4 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, pythonAtLeast
|
|
, fetchFromGitHub
|
|
, attrs
|
|
, pexpect
|
|
, doCheck ? true
|
|
, pytestCheckHook
|
|
, pytest-xdist
|
|
, sortedcontainers
|
|
, tzdata
|
|
, pythonOlder
|
|
}:
|
|
buildPythonPackage rec {
|
|
# https://hypothesis.readthedocs.org/en/latest/packaging.html
|
|
|
|
# Hypothesis has optional dependencies on the following libraries
|
|
# pytz fake_factory django numpy pytest
|
|
# If you need these, you can just add them to your environment.
|
|
|
|
pname = "hypothesis";
|
|
version = "6.35.0";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "HypothesisWorks";
|
|
repo = "hypothesis-python";
|
|
rev = "hypothesis-python-${version}";
|
|
sha256 = "08wph7q3c08480ma2p7m7mamy0g7g7r5jqpwdyhdga4cfg734527";
|
|
};
|
|
|
|
postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
|
|
|
|
propagatedBuildInputs = [
|
|
attrs
|
|
sortedcontainers
|
|
];
|
|
|
|
checkInputs = [
|
|
pexpect
|
|
pytest-xdist
|
|
pytestCheckHook
|
|
] ++ lib.optional (pythonAtLeast "3.9") [
|
|
tzdata
|
|
];
|
|
|
|
inherit doCheck;
|
|
|
|
# This file changes how pytest runs and breaks it
|
|
preCheck = ''
|
|
rm tox.ini
|
|
'';
|
|
|
|
pytestFlagsArray = [
|
|
"tests/cover"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"hypothesis"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Library for property based testing";
|
|
homepage = "https://github.com/HypothesisWorks/hypothesis";
|
|
license = licenses.mpl20;
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
|
};
|
|
}
|