From fa44b72d91625bcf5aee5438b10abdd0eb4e5acb Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 28 May 2017 12:24:02 +0100 Subject: [PATCH] python.pkgs.django_hijack: 2.0.7 -> 2.1.4 also fix & enable tests, add self as maintainer --- .../python-modules/django-hijack/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 20 +--------- 2 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 pkgs/development/python-modules/django-hijack/default.nix diff --git a/pkgs/development/python-modules/django-hijack/default.nix b/pkgs/development/python-modules/django-hijack/default.nix new file mode 100644 index 00000000000..8eb98924491 --- /dev/null +++ b/pkgs/development/python-modules/django-hijack/default.nix @@ -0,0 +1,39 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub, python, + django, django_compat, django_nose +}: +buildPythonPackage rec { + name = "django-hijack-${version}"; + version = "2.1.4"; + + # the pypi packages don't include everything required for the tests + src = fetchFromGitHub { + owner = "arteria"; + repo = "django-hijack"; + rev = "v${version}"; + sha256 = "1wbm6l8mzpkj4wsj4fyfamzpzi3day2v1cva5j89v4dn4403jq21"; + }; + + checkInputs = [ django_nose ]; + propagatedBuildInputs = [ django django_compat ]; + + checkPhase = '' + runHook preCheck + + # we have to do a little bit of tinkering to convince the tests to run against the installed package, not the + # source directory + mkdir testbase + pushd testbase + cp ../runtests.py . + ${python.interpreter} runtests.py hijack + popd + + runHook postCheck + ''; + + meta = with stdenv.lib; { + description = "Allows superusers to hijack (=login as) and work on behalf of another user"; + homepage = https://github.com/arteria/django-hijack; + license = licenses.mit; + maintainers = with maintainers; [ ris ]; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3732556bfad..83f2e9cfcae 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10195,26 +10195,10 @@ in { }; }; - # This package likely needs an older version of Django. + # This package may need an older version of Django. # Override the package set and set e.g. `django = super.django_1_9`. # See the Nixpkgs manual for examples on how to override the package set. - django_hijack = buildPythonPackage rec { - name = "django-hijack-${version}"; - version = "2.0.7"; - - src = pkgs.fetchurl { - url = "mirror://pypi/d/django-hijack/${name}.tar.gz"; - sha256 = "0rpi1bkfx74xfbb2nk874kfdra1jcqp2vzky1r3z7zidlc9kah04"; - }; - - propagatedBuildInputs = with self; [ django django_compat ]; - - meta = { - description = "Allows superusers to hijack (=login as) and work on behalf of another user"; - homepage = https://github.com/arteria/django-hijack; - license = licenses.mit; - }; - }; + django_hijack = callPackage ../development/python-modules/django-hijack { }; django_nose = buildPythonPackage rec { name = "django-nose-${version}";