1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, poetry-core
6, django
7, djangorestframework
8, pytz
9, pytest
10, pytest-lazy-fixture
11, python
12}:
13
14buildPythonPackage rec {
15 pname = "django-timezone-field";
16 version = "4.2.1";
17 format = "setuptools";
18 disabled = pythonOlder "3.5";
19
20 src = fetchFromGitHub {
21 owner = "mfogel";
22 repo = pname;
23 rev = version;
24 sha256 = "0swld4168pfhppr9q3i9r062l832cmmx792kkvlcvxfbdhk6qz9h";
25 };
26
27 nativeBuildInputs = [
28 poetry-core
29 ];
30
31 propagatedBuildInputs = [
32 django
33 djangorestframework
34 pytz
35 ];
36
37 pythonImportsCheck = [
38 "timezone_field"
39 ];
40
41 # Uses pytest.lazy_fixture directly which is broken in pytest-lazy-fixture
42 # https://github.com/TvoroG/pytest-lazy-fixture/issues/22
43 doCheck = false;
44
45 DJANGO_SETTINGS_MODULE = "tests.settings";
46
47 checkInputs = [
48 pytest
49 pytest-lazy-fixture
50 ];
51
52 checkPhase = ''
53 ${python.interpreter} -m django test
54 '';
55
56 meta = with lib; {
57 description = "Django app providing database, form and serializer fields for pytz timezone objects";
58 homepage = "https://github.com/mfogel/django-timezone-field";
59 license = licenses.bsd2;
60 maintainers = with maintainers; [ hexa ];
61 };
62}