From 596e5eed55cbb4c368a89253976eef2e324aa725 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sun, 4 Apr 2021 18:46:44 +0200 Subject: [PATCH 1/2] pythonPackages.backports-entry-points-selectable: init at 1.0.3 --- .../default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/backports-entry-points-selectable/default.nix diff --git a/pkgs/development/python-modules/backports-entry-points-selectable/default.nix b/pkgs/development/python-modules/backports-entry-points-selectable/default.nix new file mode 100644 index 000000000000..a14d1fa920da --- /dev/null +++ b/pkgs/development/python-modules/backports-entry-points-selectable/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, importlib-metadata +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "backports.entry-points-selectable"; + version = "1.0.3"; + + src = fetchPypi { + inherit version; + # pypi project name and tarball name differ + pname = builtins.replaceStrings [ "-" ] [ "_" ] pname; + sha256 = "f30bcd19c5e2728ac93821d2b6ae0a325597e0ca12324fd91a39fa80e1cd0dd8"; + }; + + format = "pyproject"; + + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ + importlib-metadata + ]; + + checkInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + description = "Compatibility shim providing selectable entry points for older implementations"; + license = licenses.mit; + maintainers = [ maintainers.sternenseemann ]; + homepage = "https://github.com/jaraco/backports.entry_points_selectable"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f460f07a0fc5..681497fc92da 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -896,6 +896,8 @@ in { backports-datetime-fromisoformat = callPackage ../development/python-modules/backports-datetime-fromisoformat { }; + backports-entry-points-selectable = callPackage ../development/python-modules/backports-entry-points-selectable { }; + backports_functools_lru_cache = callPackage ../development/python-modules/backports_functools_lru_cache { }; backports_lzma = callPackage ../development/python-modules/backports_lzma { }; From 563366d673d2537396de708e003d407383997141 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sun, 4 Apr 2021 18:47:02 +0200 Subject: [PATCH 2/2] pythonPackages.pytest-randomly: 3.5.0 -> 3.6.0 * clean up some erroneously propagated dependencies * use pytestCheckHook, clarify specific test settings --- .../pytest-randomly/default.nix | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/pytest-randomly/default.nix b/pkgs/development/python-modules/pytest-randomly/default.nix index be8d675fc1ea..f8e240ca57e4 100644 --- a/pkgs/development/python-modules/pytest-randomly/default.nix +++ b/pkgs/development/python-modules/pytest-randomly/default.nix @@ -1,26 +1,35 @@ -{ lib, buildPythonPackage, fetchPypi, isPy27 -, factory_boy, faker, numpy -, pytest, pytest_xdist +{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder +, factory_boy, faker, numpy, backports-entry-points-selectable +, pytestCheckHook, pytest_xdist }: buildPythonPackage rec { pname = "pytest-randomly"; - version = "3.5.0"; + version = "3.6.0"; - disabled = isPy27; + disabled = pythonOlder "3.6"; - src = fetchPypi { - inherit pname version; - sha256 = "440cec143fd9b0adeb072006c71e0294402a2bc2ccd08079c2341087ba4cf2d1"; + # fetch from GitHub as pypi tarball doesn't include tests + src = fetchFromGitHub { + repo = pname; + owner = "pytest-dev"; + rev = version; + sha256 = "17s7gx8b7sl7mp77f5dxzwbb32qliz9awrp6xz58bhjqp7pcsa5h"; }; - propagatedBuildInputs = [ numpy factory_boy faker ]; + propagatedBuildInputs = [ + backports-entry-points-selectable + ]; - checkInputs = [ pytest pytest_xdist ]; - - # test warnings are fixed on an unreleased version: - # https://github.com/pytest-dev/pytest-randomly/pull/281 - checkPhase = "pytest -p no:randomly"; + checkInputs = [ + pytestCheckHook + pytest_xdist + numpy + factory_boy + faker + ]; + # needs special invocation, copied from tox.ini + pytestFlagsArray = [ "-p" "no:randomly" ]; meta = with lib; { description = "Pytest plugin to randomly order tests and control random.seed";