2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
cmake,
|
|
|
|
python,
|
|
|
|
zlib,
|
|
|
|
ncurses,
|
|
|
|
docutils,
|
|
|
|
pygments,
|
|
|
|
numpy,
|
|
|
|
scipy,
|
|
|
|
scikit-learn,
|
|
|
|
spdlog,
|
|
|
|
fmt,
|
|
|
|
rapidjson,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "vowpalwabbit";
|
2023-08-10 07:59:29 +00:00
|
|
|
version = "9.9.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchPypi {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit pname version;
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-YCg2EI4rhEMwcVEzx9ES8Z3CoCddeUFVk4lZ0nuQJUc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
docutils
|
|
|
|
ncurses
|
|
|
|
pygments
|
|
|
|
python.pkgs.boost
|
|
|
|
zlib.dev
|
2021-12-06 16:07:01 +00:00
|
|
|
spdlog
|
|
|
|
fmt
|
|
|
|
rapidjson
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# As we disable configure via cmake, pass explicit global options to enable
|
|
|
|
# spdlog and fmt packages
|
|
|
|
setupPyGlobalFlags = [ "--cmake-options=\"-DSPDLOG_SYS_DEP=ON;-DFMT_SYS_DEP=ON\"" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
2021-05-20 23:08:51 +00:00
|
|
|
scikit-learn
|
2020-04-24 23:36:52 +00:00
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
# Python build script uses CMake, but we don't want CMake to do the
|
|
|
|
# configuration.
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
# Python ctypes.find_library uses DYLD_LIBRARY_PATH.
|
2024-09-26 11:04:55 +00:00
|
|
|
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export DYLD_LIBRARY_PATH="${python.pkgs.boost}/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# check-manifest requires a git clone, not a tarball
|
|
|
|
# check-manifest --ignore "Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*"
|
|
|
|
${python.interpreter} setup.py check -ms
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Vowpal Wabbit is a fast machine learning library for online learning, and this is the python wrapper for the project";
|
2024-06-05 15:53:02 +00:00
|
|
|
homepage = "https://github.com/JohnLangford/vowpal_wabbit";
|
|
|
|
license = licenses.bsd3;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ teh ];
|
2024-07-01 15:47:52 +00:00
|
|
|
# Test again when new version is released
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isLinux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|