2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchNpmDeps
|
2022-04-27 09:35:20 +00:00
|
|
|
, buildPythonPackage
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
, gettext
|
|
|
|
, nodejs
|
|
|
|
, npmHooks
|
|
|
|
, setuptools-scm
|
|
|
|
|
|
|
|
# dependencies
|
2022-04-27 09:35:20 +00:00
|
|
|
, django
|
2023-08-04 22:07:22 +00:00
|
|
|
, django-compat
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# tests
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytest-django
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-hijack";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.3.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "django-hijack";
|
|
|
|
repo = "django-hijack";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-ytQ4xxkBAC3amQbenD8RO5asrbfNAjOspWUY3c2hkig=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'cmd = ["npm", "ci"]' 'cmd = ["true"]' \
|
|
|
|
--replace 'f"{self.build_lib}/{name}.mo"' 'f"{name}.mo"'
|
|
|
|
|
|
|
|
sed -i "/addopts/d" setup.cfg
|
|
|
|
'';
|
|
|
|
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
|
|
|
hash = "sha256-FLfMCn2jsLlTTsC+LRMX0dmVCCbNAr2pQUsSQRKgo6E=";
|
|
|
|
};
|
|
|
|
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
django
|
2023-08-04 22:07:22 +00:00
|
|
|
django-compat
|
2023-01-11 07:51:40 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-11 07:51:40 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-django
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
env.DJANGO_SETTINGS_MODULE = "hijack.tests.test_app.settings";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
2023-05-24 13:37:59 +00:00
|
|
|
"--pyargs" "hijack"
|
|
|
|
"-W" "ignore::DeprecationWarning"
|
2023-01-11 07:51:40 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Allows superusers to hijack (=login as) and work on behalf of another user";
|
|
|
|
homepage = "https://github.com/arteria/django-hijack";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/django-hijack/django-hijack/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
};
|
|
|
|
}
|