Skip to content
Merged
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
43 changes: 19 additions & 24 deletions pkgs/development/python-modules/django-timezone-field/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,45 @@
poetry-core,
django,
djangorestframework,
pytz,
pytest,
pytestCheckHook,
pytest-django,
pytest-lazy-fixture,
python,
}:

buildPythonPackage rec {
pname = "django-timezone-field";
version = "5.1";
disabled = pythonOlder "3.5";
format = "pyproject";
version = "7.0";
pyproject = true;

disabled = pythonOlder "3.8";

src = fetchFromGitHub {
owner = "mfogel";
repo = pname;
rev = version;
hash = "sha256-FAYO8OEE/h4rsbC4Oc57ylWV7TqQ6DOd6/2M+mb/AsM=";
hash = "sha256-q06TuYkBA4z6tJdT3an6Z8o1i/o85XbYa1JYZBHC8lI=";
};

nativeBuildInputs = [ poetry-core ];
build-system = [ poetry-core ];

propagatedBuildInputs = [
django
djangorestframework
pytz
];
dependencies = [ django ];

pythonImportsCheck = [ "timezone_field" ];

# Uses pytest.lazy_fixture directly which is broken in pytest-lazy-fixture
# https://github.com/TvoroG/pytest-lazy-fixture/issues/22
doCheck = false;
pythonImportsCheck = [
# Requested setting USE_DEPRECATED_PYTZ, but settings are not configured.
#"timezone_field"
];

DJANGO_SETTINGS_MODULE = "tests.settings";
preCheck = ''
export DJANGO_SETTINGS_MODULE=tests.settings
'';

nativeCheckInputs = [
pytest
djangorestframework
pytestCheckHook
pytest-django
pytest-lazy-fixture
];

checkPhase = ''
${python.interpreter} -m django test
'';

meta = with lib; {
description = "Django app providing database, form and serializer fields for pytz timezone objects";
homepage = "https://github.com/mfogel/django-timezone-field";
Expand Down