Skip to content

Instantly share code, notes, and snippets.

@teh
Created October 1, 2023 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teh/403295431ded71fc3a003455982e9abc to your computer and use it in GitHub Desktop.
Save teh/403295431ded71fc3a003455982e9abc to your computer and use it in GitHub Desktop.
autogluon nixpkgs
{ lib
, buildPythonPackage
, fetchFromGitHub
, networkx
, tqdm
, scipy
, pandas
, lightgbm
, catboost
, xgboost
, ray
, setuptools
}:
let
version = "0.8.2";
src = fetchFromGitHub {
owner = "autogluon";
repo = "autogluon";
rev = "refs/tags/v${version}";
hash = "sha256-AjV/SY4wyAqGPba/SXtRDBXQ66gZZgVbQQG3GfAG8hk=";
};
core = buildPythonPackage {
pname = "autogluon-core";
inherit version src;
nativeBuildInputs = [ setuptools ];
format = "pyproject";
RELEASE = "true";
preConfigure = ''
substituteInPlace ../core/src/autogluon/core/_setup_utils.py \
--replace 'with open(version_path, "w")' 'with open("src/autogluon/core/version.py", "w")'
'';
sourceRoot = "${src.name}/core";
};
common = buildPythonPackage {
pname = "autogluon-common";
inherit version src;
nativeBuildInputs = [ setuptools ];
format = "pyproject";
RELEASE = "true";
preConfigure = ''
substituteInPlace ../core/src/autogluon/core/_setup_utils.py \
--replace 'with open(version_path, "w")' 'with open("src/autogluon/common/version.py", "w")'
'';
sourceRoot = "${src.name}/common";
};
features = buildPythonPackage {
pname = "autogluon-features";
inherit version src;
nativeBuildInputs = [ setuptools ];
format = "pyproject";
RELEASE = "true";
preConfigure = ''
substituteInPlace ../core/src/autogluon/core/_setup_utils.py \
--replace 'with open(version_path, "w")' 'with open("src/autogluon/features/version.py", "w")'
'';
sourceRoot = "${src.name}/features";
};
in
buildPythonPackage rec {
pname = "autogluon-tabular";
inherit version src;
format = "pyproject";
sourceRoot = "${src.name}/tabular";
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = [
networkx
tqdm
scipy
pandas
lightgbm
catboost
xgboost
ray
common
core
features
];
RELEASE = "true";
pythonImportsCheck = [
"autogluon.features"
"autogluon.common"
"autogluon.tabular"
];
meta = with lib; {
description = "AutoML libraru";
homepage = "https://auto.gluon.ai/";
license = licenses.asl20;
maintainers = with maintainers; [ teh ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment