Skip to content
Snippets Groups Projects
Commit 0f32cca4 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Update Hypothesis and attrs for compatibility with newer nixpkgs

Newer typing in nixpkgs requires newer Hypothesis than it has.
parent 352c970a
No related branches found
No related tags found
1 merge request!35An assortment of packaging fixes
{ lib, stdenv, buildPythonPackage, fetchPypi, pytest, hypothesis, zope_interface
, pympler, coverage, six, clang }:
buildPythonPackage rec {
pname = "attrs";
version = "19.2.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256:15hkbvwzw87474ra22mmzbbikkqkrnk9npifa1pw7lv32qp4j4zr";
};
# macOS needs clang for testing
checkInputs = [
pytest hypothesis zope_interface pympler coverage six
] ++ lib.optionals (stdenv.isDarwin) [ clang ];
checkPhase = ''
py.test
'';
# To prevent infinite recursion with pytest
doCheck = false;
meta = with lib; {
description = "Python attributes without boilerplate";
homepage = https://github.com/hynek/attrs;
license = licenses.mit;
};
}
{ lib, buildPythonPackage, fetchFromGitHub
, isPy3k, attrs, coverage, enum34
, doCheck ? true, pytest, pytest_xdist, flaky, mock, pexpect
}:
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.
version = "4.38.3";
pname = "hypothesis";
# Use github tarballs that includes tests
src = fetchFromGitHub {
owner = "HypothesisWorks";
repo = "hypothesis-python";
rev = "hypothesis-python-${version}";
sha256 = "1w9mjc3bad8qgx3pygawvvwrbdrm4yix0ys4x6ry6hhln85xnpxx";
};
postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
propagatedBuildInputs = [ attrs coverage ] ++ lib.optional (!isPy3k) [ enum34 ];
checkInputs = [ pytest pytest_xdist flaky mock pexpect ];
inherit doCheck;
checkPhase = ''
rm tox.ini # This file changes how py.test runs and breaks it
py.test tests/cover
'';
meta = with lib; {
description = "A Python library for property based testing";
homepage = https://github.com/HypothesisWorks/hypothesis;
license = licenses.mpl20;
};
}
......@@ -5,6 +5,21 @@ self: super: {
python27 = super.python27.override {
packageOverrides = python-self: python-super: {
# A newer version of Hypothesis is required for compatibility with the
# typing module which gets pulled in by some dependency or other.
#
# A bug report filed against nixpkgs -
# https://github.com/NixOS/nixpkgs/issues/70431
hypothesis = python-super.callPackage ./hypothesis.nix { };
# The newer hypothesis requires a newer attrs.
attrs = python-super.callPackage ./attrs.nix { };
# The newer hypothesis or attrs breaks the pytest test suite.
pytest = python-super.pytest.overrideAttrs (old: {
doInstallCheck = false;
});
# new tahoe-lafs dependency
eliot = python-super.callPackage ./eliot.nix { };
# new autobahn requires a newer cryptography
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment