Merge pull request #232255 from mweinelt/django-hijack

python310Packages.django-hijack: 3.2.6 -> 3.3.0, build from source, rename from django_hijack
This commit is contained in:
Martin Weinelt 2023-05-20 03:37:43 +02:00 committed by GitHub
commit f7bc986072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 50 additions and 22 deletions

View File

@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchFromGitHub, python,
django_hijack, django_nose }:
django-hijack, django_nose }:
buildPythonPackage rec {
pname = "django-hijack-admin";
version = "2.1.10";
@ -13,7 +13,7 @@ buildPythonPackage rec {
};
nativeCheckInputs = [ django_nose ];
propagatedBuildInputs = [ django_hijack ];
propagatedBuildInputs = [ django-hijack ];
checkPhase = ''
runHook preCheck

View File

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

View File

@ -86,6 +86,8 @@ mapAliases ({
django_environ = django-environ; # added 2021-12-25
django_extensions = django-extensions; # added 2022-01-09
django_guardian = django-guardian; # added 2022-05-19
django_hijack = django-hijack; # added 2023-05-16
django_hijack_admin = django-hijack-admin; # added 2023-05-16
django_modelcluster = django-modelcluster; # added 2022-04-02
django_reversion = django-reversion; # added 2022-06-18
django_polymorphic = django-polymorphic; # added 2022-05-24

View File

@ -2693,10 +2693,9 @@ self: super: with self; {
django-hierarkey = callPackage ../development/python-modules/django-hierarkey { };
django_hijack_admin = callPackage ../development/python-modules/django-hijack-admin { };
django-hijack-admin = callPackage ../development/python-modules/django-hijack-admin { };
django_hijack = callPackage ../development/python-modules/django-hijack { };
# 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 = callPackage ../development/python-modules/django-hijack { };
django-i18nfield = callPackage ../development/python-modules/django-i18nfield { };