2022-04-27 09:35:20 +00:00
{ lib
, stdenv
, azure-core
2022-02-10 20:34:41 +00:00
, bokeh
2022-01-13 20:06:32 +00:00
, buildPythonPackage
, click
, docker_pycreds
, fetchFromGitHub
, flask
, git
, GitPython
, jsonref
, jsonschema
, matplotlib
2022-05-18 14:49:53 +00:00
, nbclient
2022-02-10 20:34:41 +00:00
, nbformat
2022-01-13 20:06:32 +00:00
, pandas
, pathtools
, promise
, protobuf
, psutil
, pydantic
, pytest-mock
, pytest-xdist
, pytestCheckHook
, python-dateutil
2022-04-27 09:35:20 +00:00
, pythonOlder
2022-01-13 20:06:32 +00:00
, pyyaml
, requests
, scikit-learn
, sentry-sdk
2022-03-05 16:20:37 +00:00
, setproctitle
2022-01-13 20:06:32 +00:00
, setuptools
, shortuuid
, tqdm
} :
buildPythonPackage rec {
pname = " w a n d b " ;
2022-04-27 09:35:20 +00:00
version = " 0 . 1 2 . 1 6 " ;
format = " s e t u p t o o l s " ;
disabled = pythonOlder " 3 . 6 " ;
2022-01-13 20:06:32 +00:00
src = fetchFromGitHub {
owner = pname ;
repo = " c l i e n t " ;
rev = " v ${ version } " ;
2022-04-27 09:35:20 +00:00
hash = " s h a 2 5 6 - Z Y 7 n T j 9 3 p i T E e H h W + H + n Q + w s 2 d D m m Y 6 u 3 p 7 u z 2 9 6 P b A = " ;
2022-01-13 20:06:32 +00:00
} ;
# setuptools is necessary since pkg_resources is required at runtime.
propagatedBuildInputs = [
click
docker_pycreds
GitPython
pathtools
promise
protobuf
psutil
python-dateutil
pyyaml
requests
sentry-sdk
2022-03-05 16:20:37 +00:00
setproctitle
2022-01-13 20:06:32 +00:00
setuptools
shortuuid
] ;
2022-04-15 01:41:22 +00:00
# wandb expects git to be in PATH. See https://gist.github.com/samuela/57aeee710e41ab2bf361b7ed8fbbeabf
# for the error message, and an example usage here: https://github.com/wandb/client/blob/d5f655b7ca7e3eac2f3a67a84bc5c2a664a31baf/wandb/sdk/internal/meta.py#L128.
# See https://github.com/NixOS/nixpkgs/pull/164176#discussion_r828801621 as to
# why we don't put it in propagatedBuildInputs. Note that this is difficult to
# test offline due to https://github.com/wandb/client/issues/3519.
postInstall = ''
mkdir - p $ out/bin
ln - s $ { git } /bin/git $ out/bin/git
'' ;
2022-04-27 09:35:20 +00:00
preCheck = ''
export HOME = $ ( mktemp - d )
'' ;
checkInputs = [
azure-core
bokeh
flask
jsonref
jsonschema
matplotlib
2022-05-18 14:49:53 +00:00
nbclient
2022-04-27 09:35:20 +00:00
nbformat
pandas
pydantic
pytest-mock
pytest-xdist
pytestCheckHook
scikit-learn
tqdm
] ;
2022-01-13 20:06:32 +00:00
disabledTestPaths = [
# Tests that try to get chatty over sockets or spin up servers, not possible in the nix build environment.
" t e s t s / t e s t _ c l i . p y "
" t e s t s / t e s t _ d a t a _ t y p e s . p y "
" t e s t s / t e s t _ f i l e _ s t r e a m . p y "
" t e s t s / t e s t _ f i l e _ u p l o a d . p y "
" t e s t s / t e s t _ f o o t e r . p y "
" t e s t s / t e s t _ i n t e r n a l _ a p i . p y "
" t e s t s / t e s t _ l a b e l _ f u l l . p y "
" t e s t s / t e s t _ l o g i n . p y "
" t e s t s / t e s t _ m e t a . p y "
" t e s t s / t e s t _ m e t r i c _ f u l l . p y "
" t e s t s / t e s t _ m e t r i c _ i n t e r n a l . p y "
" t e s t s / t e s t _ m o d e _ d i s a b l e d . p y "
" t e s t s / t e s t _ m p _ f u l l . p y "
" t e s t s / t e s t _ p u b l i c _ a p i . p y "
" t e s t s / t e s t _ r e d i r . p y "
" t e s t s / t e s t _ r u n t i m e . p y "
" t e s t s / t e s t _ s e n d e r . p y "
" t e s t s / t e s t _ s t a r t _ m e t h o d . p y "
" t e s t s / t e s t _ t b _ w a t c h e r . p y "
" t e s t s / t e s t _ t e l e m e t r y _ f u l l . p y "
" t e s t s / w a n d b _ a g e n t _ t e s t . p y "
" t e s t s / w a n d b _ a r t i f a c t s _ t e s t . p y "
" t e s t s / w a n d b _ i n t e g r a t i o n _ t e s t . p y "
" t e s t s / w a n d b _ r u n _ t e s t . p y "
" t e s t s / w a n d b _ s e t t i n g s _ t e s t . p y "
" t e s t s / w a n d b _ s w e e p _ t e s t . p y "
2022-03-05 16:20:37 +00:00
" t e s t s / w a n d b _ v e r i f y _ t e s t . p y "
2022-04-15 01:41:22 +00:00
" t e s t s / t e s t _ m o d e l _ w o r k f l o w s . p y "
2022-01-13 20:06:32 +00:00
# Fails and borks the pytest runner as well.
" t e s t s / w a n d b _ t e s t . p y "
2022-02-10 20:34:41 +00:00
# Tries to access /homeless-shelter
" t e s t s / t e s t _ t a b l e s . p y "
2022-01-13 20:06:32 +00:00
] ;
2022-04-15 01:41:22 +00:00
# Disable test that fails on darwin due to issue with python3Packages.psutil:
# https://github.com/giampaolo/psutil/issues/1219
2022-04-27 09:35:20 +00:00
disabledTests = lib . optional stdenv . isDarwin [
" t e s t _ t p u _ s y s t e m _ s t a t s "
2022-01-13 20:06:32 +00:00
] ;
2022-04-27 09:35:20 +00:00
pythonImportsCheck = [
" w a n d b "
] ;
2022-01-13 20:06:32 +00:00
meta = with lib ; {
description = " A C L I a n d l i b r a r y f o r i n t e r a c t i n g w i t h t h e W e i g h t s a n d B i a s e s A P I " ;
homepage = " h t t p s : / / g i t h u b . c o m / w a n d b / c l i e n t " ;
license = licenses . mit ;
maintainers = with maintainers ; [ samuela ] ;
} ;
}