Files
nixpkgs/pkgs/development/python-modules/django-silk/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

92 lines
1.8 KiB
Nix

{
lib,
autopep8,
buildPythonPackage,
django,
factory-boy,
fetchFromGitHub,
freezegun,
gprof2dot,
jinja2,
mock,
networkx,
pillow,
pydot,
pygments,
python,
python-dateutil,
pytz,
requests,
setuptools-scm,
simplejson,
sqlparse,
}:
buildPythonPackage rec {
pname = "django-silk";
version = "5.3.2";
format = "setuptools";
src = fetchFromGitHub {
owner = "jazzband";
repo = "django-silk";
tag = version;
hash = "sha256-+JOUpjKR0rx+4+hU/5gSov5nW2aj7HR+HYr5FPbUkSA=";
};
# "test_time_taken" tests aren't suitable for reproducible execution, but Django's
# test runner doesn't have an easy way to ignore tests - so instead prevent it from picking
# them up as tests
postPatch = ''
substituteInPlace project/tests/test_silky_profiler.py \
--replace "def test_time_taken" "def _test_time_taken"
substituteInPlace setup.py \
--replace 'use_scm_version=True' 'version="${version}"'
'';
nativeBuildInputs = [ setuptools-scm ];
buildInputs = [ mock ];
propagatedBuildInputs = [
autopep8
django
gprof2dot
jinja2
pillow
pygments
python-dateutil
pytz
requests
simplejson
sqlparse
];
nativeCheckInputs = [
freezegun
networkx
pydot
factory-boy
];
pythonImportsCheck = [ "silk" ];
checkPhase = ''
runHook preCheck
pushd project
DB_ENGINE=sqlite3 DB_NAME=':memory:' ${python.interpreter} manage.py test
popd # project
runHook postCheck
'';
meta = {
description = "Silky smooth profiling for the Django Framework";
homepage = "https://github.com/jazzband/django-silk";
changelog = "https://github.com/jazzband/django-silk/blob/${version}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ris ];
};
}