-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3Packages.locust: init at 2.31.2
- Loading branch information
Showing
3 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
python, | ||
callPackage, | ||
fetchFromGitHub, | ||
poetry-core, | ||
poetry-dynamic-versioning, | ||
pytestCheckHook, | ||
configargparse, | ||
cryptography, | ||
flask, | ||
flask-cors, | ||
flask-login, | ||
gevent, | ||
geventhttpclient, | ||
msgpack, | ||
psutil, | ||
pyquery, | ||
pyzmq, | ||
requests, | ||
retry, | ||
tomli, | ||
werkzeug, | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "locust"; | ||
version = "2.31.2"; | ||
pyproject = true; | ||
|
||
src = fetchFromGitHub { | ||
owner = "locustio"; | ||
repo = "locust"; | ||
rev = "refs/tags/${version}"; | ||
hash = "sha256-xDquVQjkWVER9h0a6DHWRZH6KtRf0jsThycSojDEdh4="; | ||
}; | ||
|
||
postPatch = '' | ||
substituteInPlace pyproject.toml \ | ||
--replace-fail 'script = "pre_build.py"' "" | ||
substituteInPlace locust/test/test_main.py \ | ||
--replace-fail '"locust"' '"${placeholder "out"}/bin/locust"' | ||
substituteInPlace locust/test/test_log.py \ | ||
--replace-fail '"locust"' '"${placeholder "out"}/bin/locust"' | ||
''; | ||
|
||
webui = callPackage ./webui.nix { | ||
inherit version; | ||
src = "${src}/locust/webui"; | ||
}; | ||
|
||
preBuild = '' | ||
mkdir -p $out/${python.sitePackages}/${pname} | ||
ln -sf ${webui} $out/${python.sitePackages}/${pname}/webui | ||
''; | ||
|
||
build-system = [ | ||
poetry-core | ||
poetry-dynamic-versioning | ||
]; | ||
|
||
pythonRelaxDeps = [ | ||
# version 0.7.0.dev0 is not considered to be >= 0.6.3 | ||
"flask-login" | ||
]; | ||
|
||
dependencies = [ | ||
configargparse | ||
flask | ||
flask-cors | ||
flask-login | ||
gevent | ||
geventhttpclient | ||
msgpack | ||
psutil | ||
pyzmq | ||
requests | ||
tomli | ||
werkzeug | ||
]; | ||
|
||
pythonImportsCheck = [ "locust" ]; | ||
|
||
nativeCheckInputs = [ | ||
cryptography | ||
pyquery | ||
pytestCheckHook | ||
retry | ||
]; | ||
|
||
# locust's test suite is very flaky, due to heavy reliance on timing-based tests and access to the | ||
# network. | ||
doCheck = false; | ||
|
||
meta = { | ||
description = "Developer-friendly load testing framework"; | ||
homepage = "https://docs.locust.io/"; | ||
changelog = "https://github.com/locustio/locust/blob/${version}/CHANGELOG.md"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ jokatzke ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
stdenv, | ||
fetchYarnDeps, | ||
yarnConfigHook, | ||
yarnBuildHook, | ||
nodejs, | ||
version, | ||
src, | ||
}: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "locust-ui"; | ||
inherit version src; | ||
|
||
yarnOfflineCache = fetchYarnDeps { | ||
yarnLock = "${finalAttrs.src}/yarn.lock"; | ||
hash = "sha256-ek02mjB8DsBUOR28WSuqj6oVvxTq8EKTNXWFFI3OhuU="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
yarnConfigHook | ||
yarnBuildHook | ||
nodejs | ||
]; | ||
|
||
dontNpmPrune = true; | ||
yarnBuildScript = "build"; | ||
postInstall = '' | ||
mkdir -p $out/dist | ||
cp -r dist/** $out/dist | ||
''; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters