nixpkgs/pkgs/development/python-modules/gradient-utils/default.nix
Michael Daniels 075e8c2c4f
treewide: change 'format = "pyproject";' to 'pyproject = true;'
This is almost all find-and-replace.

I manually edited:
* pkgs/development/python-modules/notifications-android-tv/default.nix,
* pkgs/servers/home-assistant/default.nix,
* pkgs/development/tools/continuous-integration/buildbot/master.nix

A few files have not been changed in this PR because they would cause rebuilds.

This PR should have 0 rebuilds.
2026-01-12 17:50:35 -05:00

67 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
hyperopt,
mock,
numpy,
poetry-core,
prometheus-client,
pytestCheckHook,
requests,
}:
buildPythonPackage rec {
pname = "gradient-utils";
version = "0.5.0";
pyproject = true;
src = fetchFromGitHub {
owner = "Paperspace";
repo = "gradient-utils";
tag = "v${version}";
hash = "sha256-swnl0phdOsBSP8AX/OySI/aYI9z60Ss3SsJox/mb9KY=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
hyperopt
prometheus-client
numpy
];
nativeCheckInputs = [
mock
requests
pytestCheckHook
];
postPatch = ''
# https://github.com/Paperspace/gradient-utils/issues/68
# https://github.com/Paperspace/gradient-utils/issues/72
substituteInPlace pyproject.toml \
--replace 'wheel = "^0.35.1"' 'wheel = "*"' \
--replace 'prometheus-client = ">=0.8,<0.10"' 'prometheus-client = "*"' \
--replace 'pymongo = "^3.11.0"' 'pymongo = ">=3.11.0"'
'';
preCheck = ''
export HOSTNAME=myhost-experimentId
'';
disabledTestPaths = [
# Requires a working Prometheus push gateway
"tests/integration/test_metrics.py"
];
pythonImportsCheck = [ "gradient_utils" ];
meta = {
description = "Python utils and helpers library for Gradient";
homepage = "https://github.com/Paperspace/gradient-utils";
license = lib.licenses.mit;
maintainers = [ ];
platforms = lib.platforms.unix;
};
}