Unverified Commit 7465ec49 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

Merge pull request #325608 from erictapen/python-django-timezone-field

python3Packages.django-timezone-field: 5.1 -> 7.0
parents a53b95f1 d0ae2b83
Loading
Loading
Loading
Loading
+19 −24
Original line number Diff line number Diff line
@@ -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";