Skip to content

Commit

Permalink
feat(loom): Add loom.ociImg attribute
Browse files Browse the repository at this point in the history
Loom docker images attribute exposed as passthru field of loom.

Fixes #12
  • Loading branch information
srounce committed May 21, 2024
1 parent 8703176 commit 1fa5d6c
Showing 1 changed file with 127 additions and 115 deletions.
242 changes: 127 additions & 115 deletions pkgs/loom/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
, zlib
, eigen
, gperftools
, dockerTools
, basicTools
}:
let
goftests = callPackage ./../goftests { };
Expand Down Expand Up @@ -89,125 +91,135 @@ let
hash = "sha256-FSx/vKctoFl4NlwzNDa9eDNUXeW1J875/nB6of+5gQk=";
};
});
in
buildPythonPackage {
inherit version;

src = loom-cpp.dev;

pname = "loom";

nativeBuildInputs = [
cmake
setuptools
wheel
protobuf
];

buildInputs = [
cmake
gnumake

distributions.distributions-shared
distributions
zlib
eigen
gperftools
];

nativeCheckInputs = [
pyflakes
];

# https://github.com/numba/numba/issues/8698#issuecomment-1584888063
env.NUMPY_EXPERIMENTAL_DTYPE_API = 1;

env.DISTRIBUTIONS_USE_PROTOBUF = 1;

propagatedBuildInputs = [
loom-cpp
contextlib2
cpplint
cython_0
distributions
distributions.distributions-shared
goftests
imageio
matplotlib
mock
nose
numpy
pandas
parsable
pep8
python3Packages.protobuf
pyflakes
pymetis
scikit-learn
scipy
setuptools
simplejson
pytest
];

# TODO: make tests run in checkPhase
doCheck = false;

pythonImportsCheck = [
"loom"
"loom.cleanse"
"loom.crossvalidate"
"loom.datasets"
"loom.format"
"loom.generate"
"loom.preql"
"loom.query"
"loom.schema_pb2"
"loom.store"
"loom.tasks"
"loom.transforms"
"loom.util"
"loom.watch"
];

dontUseCmakeConfigure = true;

enableParallelBuilding = true;

prePatch = ''
sed -i 's/-Werror//g' CMakeLists.txt # remove -Werror
'';

passthru.loom-cpp = loom-cpp;

passthru.more_packages = {
inherit

loom = buildPythonPackage {
inherit version;

src = loom-cpp.dev;

pname = "loom";

nativeBuildInputs = [
cmake
setuptools
wheel
protobuf
];

buildInputs = [
cmake
gnumake

distributions.distributions-shared
distributions
zlib
eigen
gperftools
];

nativeCheckInputs = [
pyflakes
];

# https://github.com/numba/numba/issues/8698#issuecomment-1584888063
env.NUMPY_EXPERIMENTAL_DTYPE_API = 1;

env.DISTRIBUTIONS_USE_PROTOBUF = 1;

propagatedBuildInputs = [
loom-cpp
contextlib2
cpplint
cython_0
distributions
distributions.distributions-shared
goftests
imageio
matplotlib
mock
nose
numpy
pandas
parsable
pep8
python3Packages.protobuf
pyflakes
pymetis
scikit-learn
scipy
setuptools
simplejson
pytest
];

# TODO: make tests run in checkPhase
doCheck = false;

pythonImportsCheck = [
"loom"
"loom.cleanse"
"loom.crossvalidate"
"loom.datasets"
"loom.format"
"loom.generate"
"loom.preql"
"loom.query"
"loom.schema_pb2"
"loom.store"
"loom.tasks"
"loom.transforms"
"loom.util"
"loom.watch"
];

dontUseCmakeConfigure = true;

enableParallelBuilding = true;

prePatch = ''
sed -i 's/-Werror//g' CMakeLists.txt # remove -Werror
'';

passthru.loom-cpp = loom-cpp;

passthru.more_packages = {
inherit
goftests
distributions
pymetis
parsable
;
};
;
};

passthru.tests.run = callPackage ./test.nix { inherit src; };

passthru.test-shell = callPackage ({
mkShell
, python3
, loom
, which
}: mkShell {
packages = [
python3
loom
which
];
}) {};
passthru.ociImg = dockerTools.buildLayeredImage {
name = "probcomp/loom";
contents =
with pkgs; [ loom bashInteractive ] ++
basicTools
;
};

meta = with lib; {
description = "A streaming cross-cat inference engine";
homepage = "https://github.com/emilyfertig/loom";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
passthru.tests.run = callPackage ./test.nix { inherit src; };

passthru.test-shell = callPackage ({
mkShell
, python3
, loom
, which
}: mkShell {
packages = [
python3
loom
which
];
}) {};

meta = with lib; {
description = "A streaming cross-cat inference engine";
homepage = "https://github.com/emilyfertig/loom";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
};
};
}
in
loom

0 comments on commit 1fa5d6c

Please sign in to comment.