Martin Weinelt 2023-05-16 17:44:33 +02:00
parent 1149329a28
commit 31aa936b15
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -1,28 +1,57 @@
{ lib { lib
, fetchPypi , fetchFromGitHub
, fetchNpmDeps
, buildPythonPackage , buildPythonPackage
# build-system
, gettext
, nodejs
, npmHooks
, setuptools-scm
# dependencies
, django , django
, django_compat , django_compat
# tests
, pytest-django , pytest-django
, pytestCheckHook , pytestCheckHook
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "django-hijack"; pname = "django-hijack";
version = "3.2.6"; version = "3.3.0";
format = "setuptools";
# the wheel comes with pre-built assets, allowing us to avoid fighting src = fetchFromGitHub {
# with npm/webpack/gettext to build them ourselves. owner = "django-hijack";
format = "wheel"; repo = "django-hijack";
rev = "refs/tags/${version}";
src = fetchPypi { hash = "sha256-ytQ4xxkBAC3amQbenD8RO5asrbfNAjOspWUY3c2hkig=";
inherit version format;
pname = "django_hijack";
dist = "py3";
python = "py3";
hash = "sha256-xFPZ03II1814+bZ5gx7GD/AxYMiLuH6awfSeXEraOHQ=";
}; };
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
];
propagatedBuildInputs = [ propagatedBuildInputs = [
django django
django_compat django_compat
@ -33,13 +62,11 @@ buildPythonPackage rec {
pytest-django pytest-django
]; ];
preCheck = '' env.DJANGO_SETTINGS_MODULE = "hijack.tests.test_app.settings";
export DJANGO_SETTINGS_MODULE='hijack.tests.test_app.settings'
'';
pytestFlagsArray = [ pytestFlagsArray = [
"--pyargs" "--pyargs" "hijack"
"hijack" "-W" "ignore::DeprecationWarning"
]; ];
meta = with lib; { meta = with lib; {