diff --git a/attrs.nix b/attrs.nix deleted file mode 100644 index 96037464e5a0b3ee883e273b2c0380015100ae36..0000000000000000000000000000000000000000 --- a/attrs.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ 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; - }; -} diff --git a/hypothesis.nix b/hypothesis.nix deleted file mode 100644 index 32490967a437e31d670a6a25a7c2f2793d7c12f2..0000000000000000000000000000000000000000 --- a/hypothesis.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ 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; - }; -} diff --git a/overlays.nix b/overlays.nix index 25a69fb11a199e50b0662fd2654d41b733c272d0..9a50dadb40152a238832c1402b3b9944ee45c4a1 100644 --- a/overlays.nix +++ b/overlays.nix @@ -5,19 +5,16 @@ 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.callPackage ./pytest.nix { }; - + # The newest typing is incompatible with the packaged version of + # 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 + # upgrade route because pytest has dropped Python 2 support. + # Fortunately, downgrading typing ends up being fairly straightforward. + # + # For now. This is, no doubt, a sign of things to come for the Python 2 + # ecosystem - the early stages of a slow, painful death by the thousand + # cuts of incompatibilities between libraries with no maintained Python + # 2 support. typing = python-super.callPackage ./typing.nix { }; # new tahoe-lafs dependency diff --git a/pytest.nix b/pytest.nix deleted file mode 100644 index d9634ea0762acff5c9d7fdb6ebaa139538776780..0000000000000000000000000000000000000000 --- a/pytest.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ 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; - }; -}