Skip to content

Commit 962cced

Browse files
committed
python311Packages.openai-triton: add import-triton passthru test
1 parent ba0457c commit 962cced

File tree

1 file changed

+15
-1
lines changed
  • pkgs/development/python-modules/openai-triton

1 file changed

+15
-1
lines changed

pkgs/development/python-modules/openai-triton/default.nix

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
, filelock
2020
, torchWithRocm
2121
, python
22+
23+
, runCommand
24+
2225
, cudaPackages
2326
, cudaSupport ? config.cudaSupport
2427
}:
@@ -158,7 +161,18 @@ buildPythonPackage rec {
158161
# ];
159162

160163
# Ultimately, torch is our test suite:
161-
passthru.tests = { inherit torchWithRocm; };
164+
passthru.tests = {
165+
inherit torchWithRocm;
166+
# Implemented as alternative to pythonImportsCheck, in case if circular dependency on torch occurs again,
167+
# and pythonImportsCheck is commented back.
168+
import-triton = runCommand "import-triton" { nativeBuildInputs = [(python.withPackages (ps: [ps.openai-triton]))]; } ''
169+
python << \EOF
170+
import triton
171+
import triton.language
172+
EOF
173+
touch "$out"
174+
'';
175+
};
162176

163177
pythonRemoveDeps = [
164178
# Circular dependency, cf. https://github.com/openai/triton/issues/1374

0 commit comments

Comments
 (0)