2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
absl-py,
|
|
|
|
buildPythonPackage,
|
|
|
|
contextlib2,
|
|
|
|
fetchPypi,
|
|
|
|
fetchurl,
|
|
|
|
lib,
|
|
|
|
pyyaml,
|
2021-12-19 01:06:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
requirements = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/google/ml_collections/7f749a281c69f9d0b339c05ecb94b80d95029f25/requirements.txt";
|
|
|
|
sha256 = "1xb351hiscj4zmajfkql3swpacdp6lmz8iwdvwwdx2zqw9a62zps";
|
|
|
|
};
|
|
|
|
requirements-test = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/google/ml_collections/7f749a281c69f9d0b339c05ecb94b80d95029f25/requirements-test.txt";
|
|
|
|
sha256 = "0r457k2nrg5jkf093r0x29yf8xwy6l7jxi6al0fh7mmnfrhr9cb1";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ml-collections";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.1.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
# ml-collections does not have any git release tags. See https://github.com/google/ml_collections/issues/8.
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "ml_collections";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-P+/McuxDOqHl0yMHo+R0u7Z/QFvoFOpSohZr/J2+aMw=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# The pypi source archive does not include requirements.txt or
|
|
|
|
# requirements-test.txt. See https://github.com/google/ml_collections/issues/7.
|
|
|
|
postPatch = ''
|
|
|
|
cp ${requirements} requirements.txt
|
|
|
|
cp ${requirements-test} requirements-test.txt
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
absl-py
|
|
|
|
contextlib2
|
|
|
|
pyyaml
|
|
|
|
];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
# The official test suite uses bazel. With pytestCheckHook there are name
|
|
|
|
# conflicts between files and tests have assumptions that are broken by the
|
|
|
|
# nix-build environment, eg. re module names and __file__ attributes.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "ml_collections" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "ML Collections is a library of Python collections designed for ML usecases.";
|
|
|
|
homepage = "https://github.com/google/ml_collections";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ samuela ];
|
|
|
|
};
|
|
|
|
}
|