File tree Expand file tree Collapse file tree 3 files changed +139
-0
lines changed
development/python-modules/locust Expand file tree Collapse file tree 3 files changed +139
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ buildPythonPackage ,
4+ python ,
5+ callPackage ,
6+ fetchFromGitHub ,
7+ poetry-core ,
8+ poetry-dynamic-versioning ,
9+ pytestCheckHook ,
10+ configargparse ,
11+ cryptography ,
12+ flask ,
13+ flask-cors ,
14+ flask-login ,
15+ gevent ,
16+ geventhttpclient ,
17+ msgpack ,
18+ psutil ,
19+ pyquery ,
20+ pyzmq ,
21+ requests ,
22+ retry ,
23+ tomli ,
24+ werkzeug ,
25+ } :
26+
27+ buildPythonPackage rec {
28+ pname = "locust" ;
29+ version = "2.31.2" ;
30+ pyproject = true ;
31+
32+ src = fetchFromGitHub {
33+ owner = "locustio" ;
34+ repo = "locust" ;
35+ rev = "refs/tags/${ version } " ;
36+ hash = "sha256-xDquVQjkWVER9h0a6DHWRZH6KtRf0jsThycSojDEdh4=" ;
37+ } ;
38+
39+ postPatch = ''
40+ substituteInPlace pyproject.toml \
41+ --replace-fail 'script = "pre_build.py"' ""
42+
43+ substituteInPlace locust/test/test_main.py \
44+ --replace-fail '"locust"' '"${ placeholder "out" } /bin/locust"'
45+
46+ substituteInPlace locust/test/test_log.py \
47+ --replace-fail '"locust"' '"${ placeholder "out" } /bin/locust"'
48+ '' ;
49+
50+ webui = callPackage ./webui.nix {
51+ inherit version ;
52+ src = "${ src } /locust/webui" ;
53+ } ;
54+
55+ preBuild = ''
56+ mkdir -p $out/${ python . sitePackages } /${ pname }
57+ ln -sf ${ webui } $out/${ python . sitePackages } /${ pname } /webui
58+ '' ;
59+
60+ build-system = [
61+ poetry-core
62+ poetry-dynamic-versioning
63+ ] ;
64+
65+ pythonRelaxDeps = [
66+ # version 0.7.0.dev0 is not considered to be >= 0.6.3
67+ "flask-login"
68+ ] ;
69+
70+ dependencies = [
71+ configargparse
72+ flask
73+ flask-cors
74+ flask-login
75+ gevent
76+ geventhttpclient
77+ msgpack
78+ psutil
79+ pyzmq
80+ requests
81+ tomli
82+ werkzeug
83+ ] ;
84+
85+ pythonImportsCheck = [ "locust" ] ;
86+
87+ nativeCheckInputs = [
88+ cryptography
89+ pyquery
90+ pytestCheckHook
91+ retry
92+ ] ;
93+
94+ # locust's test suite is very flaky, due to heavy reliance on timing-based tests and access to the
95+ # network.
96+ doCheck = false ;
97+
98+ meta = {
99+ description = "Developer-friendly load testing framework" ;
100+ homepage = "https://docs.locust.io/" ;
101+ changelog = "https://github.com/locustio/locust/blob/${ version } /CHANGELOG.md" ;
102+ license = lib . licenses . mit ;
103+ maintainers = with lib . maintainers ; [ jokatzke ] ;
104+ } ;
105+ }
Original file line number Diff line number Diff line change 1+ {
2+ stdenv ,
3+ fetchYarnDeps ,
4+ yarnConfigHook ,
5+ yarnBuildHook ,
6+ nodejs ,
7+ version ,
8+ src ,
9+ } :
10+
11+ stdenv . mkDerivation ( finalAttrs : {
12+ pname = "locust-ui" ;
13+ inherit version src ;
14+
15+ yarnOfflineCache = fetchYarnDeps {
16+ yarnLock = "${ finalAttrs . src } /yarn.lock" ;
17+ hash = "sha256-ek02mjB8DsBUOR28WSuqj6oVvxTq8EKTNXWFFI3OhuU=" ;
18+ } ;
19+
20+ nativeBuildInputs = [
21+ yarnConfigHook
22+ yarnBuildHook
23+ nodejs
24+ ] ;
25+
26+ dontNpmPrune = true ;
27+ yarnBuildScript = "build" ;
28+ postInstall = ''
29+ mkdir -p $out/dist
30+ cp -r dist/** $out/dist
31+ '' ;
32+ } )
Original file line number Diff line number Diff line change @@ -7643,6 +7643,8 @@ self: super: with self; {
76437643
76447644 lockfile = callPackage ../development/python-modules/lockfile { };
76457645
7646+ locust = callPackage ../development/python-modules/locust { };
7647+
76467648 log-symbols = callPackage ../development/python-modules/log-symbols { };
76477649
76487650 logbook = callPackage ../development/python-modules/logbook { };
You can’t perform that action at this time.
0 commit comments