2020-08-17 08:02:06 +00:00
|
|
|
{
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
|
|
|
isPy3k,
|
|
|
|
cython,
|
|
|
|
numpy,
|
|
|
|
toml,
|
|
|
|
pytest,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "finalfusion";
|
|
|
|
version = "0.7.1";
|
2023-12-07 03:53:02 +00:00
|
|
|
format = "setuptools";
|
2020-08-17 08:02:06 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "finalfusion";
|
|
|
|
repo = "finalfusion-python";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0pwzflamxqvpl1wcz0zbhhd6aa4xn18rmza6rggaic3ckidhyrh4";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
toml
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
2020-08-17 08:02:06 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests/integration
|
2023-05-17 18:09:18 +00:00
|
|
|
|
|
|
|
# `np.float` was a deprecated alias of the builtin `float`
|
|
|
|
substituteInPlace tests/test_storage.py \
|
|
|
|
--replace 'dtype=np.float)' 'dtype=float)'
|
2020-08-17 08:02:06 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
# Regular unit tests.
|
|
|
|
pytest
|
|
|
|
|
|
|
|
# Integration tests for command-line utilities.
|
|
|
|
PATH=$PATH:$out/bin tests/integration/all.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module for using finalfusion, word2vec, and fastText word embeddings";
|
|
|
|
homepage = "https://github.com/finalfusion/finalfusion-python/";
|
2024-07-28 14:44:11 +00:00
|
|
|
maintainers = [ ];
|
2020-08-17 08:02:06 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.blueOak100;
|
|
|
|
};
|
|
|
|
}
|