Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions pkgs/development/python-modules/before-after/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ buildPythonPackage, fetchPypi, fetchpatch, pytestCheckHook, lib }:

buildPythonPackage rec {
pname = "before-after";
version = "1.0.1";

src = fetchPypi {
pname = "before_after";
inherit version;
hash = "sha256-x9T5uLi7UgldoUxLnFnqaz9bnqn9zop7/HLsrg9aP4U=";
};

patches = [
# drop 'mock' dependency for python >=3.3
(fetchpatch {
url = "https://github.com/c-oreills/before_after/commit/cf3925148782c8c290692883d1215ae4d2c35c3c.diff";
hash = "sha256-FYCpLxcOLolNPiKzHlgrArCK/QKCwzag+G74wGhK4dc=";
})
(fetchpatch {
url = "https://github.com/c-oreills/before_after/commit/11c0ecc7e8a2f90a762831e216c1bc40abfda43a.diff";
hash = "sha256-8YJumF/U8H+hc7rLZLy3UhXHdYJmcuN+O8kMx8yqMJ0=";
})
];

nativeCheckInputs = [ pytestCheckHook ];

pythonImportsCheck = [ "before_after" ];

meta = with lib; {
description = "sugar over the Mock library to help test race conditions";
homepage = "https://github.com/c-oreills/before_after";
maintainers = with maintainers; [ yuka ];
license = licenses.gpl2Only;
};
}
56 changes: 33 additions & 23 deletions pkgs/development/python-modules/django-cacheops/default.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
{ lib
{ stdenv
, lib
, buildPythonPackage
, fetchPypi
, pythonRelaxDepsHook
, django
, funcy
, redis
, pytest-django
, six
, pytestCheckHook
, pytest-django
, mock
, dill
, jinja2
, before-after
, pythonOlder
, six
, nettools
, pkgs
Comment thread
SuperSandro2000 marked this conversation as resolved.
Outdated
}:

buildPythonPackage rec {
pname = "django-cacheops";
version = "6.2";
version = "7.0.1";
format = "setuptools";

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-zHP9ChwUeZJT/yCopFeRo8jSgCIXswHnDPoIroGeQ48=";
hash = "sha256-Ed3qh90DlWiXikCD2JyJ37hm6lWnpI+2haaPwZiotlA=";
};

nativeBuildInputs = [
pythonRelaxDepsHook
];
pythonRelaxDeps = [ "funcy" ];

propagatedBuildInputs = [
django
funcy
Expand All @@ -32,23 +45,21 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-django
mock
dill
jinja2
before-after
nettools
pkgs.redis
];

disabledTests = [
# Tests require networking
"test_cached_as"
"test_invalidation_signal"
"test_queryset"
"test_queryset_empty"
"test_lock"
"test_context_manager"
"test_decorator"
"test_in_transaction"
"test_nested"
"test_unhashable_args"
"test_db_agnostic_by_default"
"test_db_agnostic_disabled"
];
preCheck = ''
redis-server &
while ! redis-cli --scan ; do
echo waiting for redis to be ready
sleep 1
done
Comment thread
SuperSandro2000 marked this conversation as resolved.
'';

DJANGO_SETTINGS_MODULE = "tests.settings";

Expand All @@ -58,8 +69,7 @@ buildPythonPackage rec {
changelog = "https://github.com/Suor/django-cacheops/blob/${version}/CHANGELOG";
license = licenses.bsd3;
maintainers = with maintainers; [ onny ];
# No support for funcy > 2
# https://github.com/Suor/django-cacheops/issues/454
broken = true;
# Times out for unknown reasons
broken = stdenv.isDarwin;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,8 @@ self: super: with self; {

beaker = callPackage ../development/python-modules/beaker { };

before-after = callPackage ../development/python-modules/before-after { };

beancount = callPackage ../development/python-modules/beancount { };

beancount-black = callPackage ../development/python-modules/beancount-black { };
Expand Down