python3Packages.locust: init at 2.31.2 (#334644)
This commit is contained in:
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
'';
|
||||
})
|
||||
@@ -7643,6 +7643,8 @@ self: super: with self; {
|
||||
|
||||
lockfile = callPackage ../development/python-modules/lockfile { };
|
||||
|
||||
locust = callPackage ../development/python-modules/locust { };
|
||||
|
||||
log-symbols = callPackage ../development/python-modules/log-symbols { };
|
||||
|
||||
logbook = callPackage ../development/python-modules/logbook { };
|
||||
|
||||
Reference in New Issue
Block a user