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

downgrade typing instead of upgrading a bunch of stuff

parent e7faa761
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,19 +5,16 @@ self: super: { ...@@ -5,19 +5,16 @@ self: super: {
python27 = super.python27.override { python27 = super.python27.override {
packageOverrides = python-self: python-super: { packageOverrides = python-self: python-super: {
# # A newer version of Hypothesis is required for compatibility with the # The newest typing is incompatible with the packaged version of
# # typing module which gets pulled in by some dependency or other. # Hypothesis. Upgrading Hypothesis is like pulling on a loose thread in
# # # a sweater. I pulled it as far as pytest where I found there was no
# # A bug report filed against nixpkgs - # upgrade route because pytest has dropped Python 2 support.
# # https://github.com/NixOS/nixpkgs/issues/70431 # Fortunately, downgrading typing ends up being fairly straightforward.
# hypothesis = python-super.callPackage ./hypothesis.nix { }; #
# For now. This is, no doubt, a sign of things to come for the Python 2
# # The newer hypothesis requires a newer attrs. # ecosystem - the early stages of a slow, painful death by the thousand
# attrs = python-super.callPackage ./attrs.nix { }; # cuts of incompatibilities between libraries with no maintained Python
# 2 support.
# # The newer hypothesis or attrs breaks the pytest test suite.
# pytest = python-super.callPackage ./pytest.nix { };
typing = python-super.callPackage ./typing.nix { }; typing = python-super.callPackage ./typing.nix { };
# new tahoe-lafs dependency # new tahoe-lafs dependency
......
{ stdenv, buildPythonPackage, pythonOlder, fetchPypi, attrs, hypothesis, py
, setuptools_scm, setuptools, six, pluggy, funcsigs, isPy3k, more-itertools
, atomicwrites, mock, writeText, pathlib2, wcwidth, packaging, isPyPy, python
}:
buildPythonPackage rec {
version = "5.2.1";
pname = "pytest";
disabled = !isPy3k;
preCheck = ''
# don't test bash builtins
rm testing/test_argcomplete.py
'';
src = fetchPypi {
inherit pname version;
sha256 = "3805d095f1ea279b9870c3eeae5dddf8a81b10952c8835cd628cf1875b0ef032";
};
checkInputs = [ hypothesis mock ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ attrs py setuptools six pluggy more-itertools atomicwrites wcwidth packaging ]
++ stdenv.lib.optionals (pythonOlder "3.6") [ pathlib2 ];
doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460
# Ignored file https://github.com/pytest-dev/pytest/pull/5605#issuecomment-522243929
checkPhase = ''
runHook preCheck
$out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths" --ignore=testing/test_junitxml.py
runHook postCheck
'';
# Remove .pytest_cache when using py.test in a Nix build
setupHook = writeText "pytest-hook" ''
pytestcachePhase() {
find $out -name .pytest_cache -type d -exec rm -rf {} +
}
preDistPhases+=" pytestcachePhase"
'';
pythonImportsCheck = [
"pytest"
];
meta = with stdenv.lib; {
homepage = https://docs.pytest.org;
description = "Framework for writing tests";
maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
license = licenses.mit;
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment