2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2022-11-02 22:02:43 +00:00
|
|
|
, autopep8
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-11-02 22:02:43 +00:00
|
|
|
, django
|
2023-10-19 13:55:26 +00:00
|
|
|
, factory-boy
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
, fetchpatch
|
2022-11-02 22:02:43 +00:00
|
|
|
, freezegun
|
|
|
|
, gprof2dot
|
|
|
|
, jinja2
|
|
|
|
, mock
|
|
|
|
, networkx
|
|
|
|
, pillow
|
|
|
|
, pydot
|
2020-04-24 23:36:52 +00:00
|
|
|
, pygments
|
2022-11-02 22:02:43 +00:00
|
|
|
, python
|
2021-07-04 02:40:35 +00:00
|
|
|
, python-dateutil
|
2022-11-02 22:02:43 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pytz
|
2020-04-24 23:36:52 +00:00
|
|
|
, requests
|
2021-04-26 19:14:03 +00:00
|
|
|
, setuptools-scm
|
2022-11-02 22:02:43 +00:00
|
|
|
, simplejson
|
2020-04-24 23:36:52 +00:00
|
|
|
, sqlparse
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-silk";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "5.1.0";
|
2022-11-02 22:02:43 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jazzband";
|
|
|
|
repo = "django-silk";
|
2022-11-02 22:02:43 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-QqY1bRa0v4DZ2/gDbssyhJA9Kb+5jig4hZEBVKZiowY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
# "test_time_taken" tests aren't suitable for reproducible execution, but Django's
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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"
|
2020-08-20 17:08:02 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'use_scm_version=True' 'version="${version}"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
mock
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-11-02 22:02:43 +00:00
|
|
|
autopep8
|
|
|
|
django
|
|
|
|
gprof2dot
|
|
|
|
jinja2
|
|
|
|
pillow
|
|
|
|
pygments
|
|
|
|
python-dateutil
|
|
|
|
pytz
|
|
|
|
requests
|
|
|
|
simplejson
|
|
|
|
sqlparse
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-02 22:02:43 +00:00
|
|
|
freezegun
|
|
|
|
networkx
|
|
|
|
pydot
|
2023-10-19 13:55:26 +00:00
|
|
|
factory-boy
|
2022-11-02 22:02:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"silk"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
pushd project
|
|
|
|
DB_ENGINE=sqlite3 DB_NAME=':memory:' ${python.interpreter} manage.py test
|
|
|
|
popd # project
|
|
|
|
|
|
|
|
runHook postCheck
|
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 = "Silky smooth profiling for the Django Framework";
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://github.com/jazzband/django-silk";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/jazzband/django-silk/blob/${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ris ];
|
|
|
|
};
|
|
|
|
}
|