23 buildPythonPackage rec {
28 # version 1.0.0 uses distutils which was removed in Python 3.12
29 disabled = pythonAtLeast "3.12";
31 src = fetchFromGitHub {
34 rev = "refs/tags/v${version}";
35 hash = "sha256-L2mwGFivq/gtAw+1D6U2jbW6VxYgetHX7OUrjwyybqE=";
38 # See https://github.com/libffcv/ffcv/issues/159.
40 substituteInPlace setup.py \
41 --replace-fail "'assertpy'," "" \
42 --replace-fail "'fastargs'," "" \
43 --replace-fail "'opencv-python'," "" \
44 --replace-fail "'psutil'," "" \
47 build-system = [ setuptools ];
48 nativeBuildInputs = [ pkg-config ];
49 buildInputs = [ libjpeg ];
50 propagatedBuildInputs = [
59 pythonImportsCheck = [ "ffcv" ];
61 # C/C++ python modules are only in the installed output and not in the build
62 # directory. Since tests are run from the build directory python prefers to
63 # import the local module first which does not contain the C/C++ python
64 # modules and results in an import error. By changing the directory to
65 # 'tests' the build directory is no long available and python will import
66 # from the installed output in the nix store which does contain the C/C++
81 # Tests require network access and do not work in the sandbox
82 "test_augmentations.py"
83 # Occasionally causes the testing phase to hang
84 "test_basic_pipeline.py"
88 # Tests require network access and do not work in the sandbox
90 # Requires CUDA which is unfree and unfree packages are not built by Hydra
92 "test_gpu_normalization"
93 # torch.multiprocessing.spawn.ProcessRaisedException
94 "test_traversal_sequential_2"
95 "test_traversal_sequential_3"
96 "test_traversal_sequential_4"
97 "test_traversal_random_2"
98 "test_traversal_random_3"
99 "test_traversal_random_4"
100 "test_traversal_sequential_distributed_with_indices"
101 "test_traversal_random_distributed_with_indices"
105 description = "FFCV: Fast Forward Computer Vision";
106 homepage = "https://ffcv.io";
107 license = lib.licenses.asl20;
108 maintainers = with lib.maintainers; [
112 # OSError: dlopen(libc.so.6, 0x0006): tried: '/usr/lib/libc.so.6' (no such file, not in dyld cache),
113 # 'libc.so.6' (no such file), '/usr/local/lib/libc.so.6' (no such file), '/usr/lib/libc.so.6' (no such file, not in dyld cache)
114 broken = stdenv.hostPlatform.isDarwin;