nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 django,
5 fetchFromGitHub,
6 icalendar,
7 pytestCheckHook,
8 pytest-django,
9 python-dateutil,
10 pytz,
11 setuptools,
12}:
13
14buildPythonPackage rec {
15 pname = "django-scheduler";
16 version = "1.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "llazzaro";
21 repo = "django-scheduler";
22 tag = "v${version}";
23 hash = "sha256-TgIp2oqju3O6zPp3WMEB9HeNgAJILNkWWfbDFmMQ3eA=";
24 };
25
26 build-system = [ setuptools ];
27
28 dependencies = [
29 django
30 icalendar
31 python-dateutil
32 pytz
33 ];
34
35 nativeCheckInputs = [
36 pytestCheckHook
37 pytest-django
38 ];
39
40 preCheck = ''
41 export DJANGO_SETTINGS_MODULE=tests.settings
42 '';
43
44 patches = [
45 # Remove in Django 5.1
46 # https://github.com/llazzaro/django-scheduler/pull/567
47 ./index_together.patch
48 ];
49
50 postPatch = ''
51 # Remove in Django 5.1
52 substituteInPlace tests/settings.py \
53 --replace-fail "SHA1PasswordHasher" "PBKDF2PasswordHasher"
54 '';
55
56 disabledTests = lib.optionals (lib.versionAtLeast django.version "5.1") [
57 # test_delete_event_authenticated_user - AssertionError: 302 != 200
58 "test_delete_event_authenticated_user"
59 "test_event_creation_authenticated_user"
60 ];
61
62 pythonImportsCheck = [ "schedule" ];
63
64 meta = {
65 description = "Calendar app for Django";
66 homepage = "https://github.com/llazzaro/django-scheduler";
67 changelog = "https://github.com/llazzaro/django-scheduler/releases/tag/${src.tag}";
68 license = lib.licenses.bsd3;
69 maintainers = with lib.maintainers; [ derdennisop ];
70 };
71}