Something went wrong. Try again.
lol
Something went wrong. Try again.
2.8 kB · 140 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141{ lib, stdenv, buildPythonPackage, fetchFromGitHub, replaceVars,
# build-system setuptools,
# patched in geos, gdal, withGdal ? false,
# dependencies asgiref, sqlparse,
# optional-dependencies argon2-cffi, bcrypt,
# tests aiosmtpd, docutils, geoip2, jinja2, numpy, pillow, pylibmc, pymemcache, python, pyyaml, pytz, redis, selenium, tblib, tzdata,}:
buildPythonPackage rec { pname = "django"; version = "5.2.13"; pyproject = true;
src = fetchFromGitHub { owner = "django"; repo = "django"; tag = version; hash = "sha256-8tRDExsCtyEonz+e18PYnfhb8qmgZNeBWUjg+LbB39U="; };
patches = [ (replaceVars ./5.2/zoneinfo.patch { zoneinfo = tzdata + "/share/zoneinfo"; }) # prevent tests from messing with our pythonpath ./5.2/pythonpath.patch # disable test that expects timezone issues ./5.2/disable-failing-test.patch ] ++ lib.optionals withGdal [ (replaceVars ./5.2/gdal.patch { geos = geos; gdal = gdal; extension = stdenv.hostPlatform.extensions.sharedLibrary; }) ];
postPatch = '' substituteInPlace tests/utils_tests/test_autoreload.py \ --replace-fail "/usr/bin/python" "${python.interpreter}" '';
build-system = [ setuptools ];
dependencies = [ asgiref sqlparse ];
optional-dependencies = { argon2 = [ argon2-cffi ]; bcrypt = [ bcrypt ]; };
nativeCheckInputs = [ # tests/requirements/py3.txt aiosmtpd docutils geoip2 jinja2 numpy pillow pylibmc pymemcache pyyaml pytz redis selenium tblib tzdata ] ++ lib.concatAttrValues optional-dependencies;
preCheck = '' # make sure the installed library gets imported rm -rf django
# fails to import github_links from docs/_ext/github_links.py rm tests/sphinx/test_github_links.py
# provide timezone data, works only on linux export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
export PYTHONPATH=$PWD/docs/_ext:$PYTHONPATH '';
checkPhase = '' runHook preCheck
pushd tests # without --parallel=1, tests fail with an "unexpected error due to a database lock" on Darwin ${python.interpreter} runtests.py --settings=test_sqlite ${lib.optionalString stdenv.hostPlatform.isDarwin "--parallel=1"} popd
runHook postCheck '';
__darwinAllowLocalNetworking = true;
meta = { changelog = "https://docs.djangoproject.com/en/${lib.versions.majorMinor version}/releases/${version}/"; description = "High-level Python Web framework that encourages rapid development and clean, pragmatic design"; homepage = "https://www.djangoproject.com"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ hexa ]; };}