@@ -61,8 +61,6 @@ def define_arm_tests():
6161 "misc/tosa_dialect/test_tosa_dialect_mxfp_conv2d.py" ,
6262 "misc/tosa_dialect/test_tosa_dialect_mxfp_linear.py" ,
6363 "misc/tosa_dialect/test_tosa_resize.py" ,
64- "misc/test_public_api_manifest.py" ,
65- "misc/test_validate_public_api_manifest.py" ,
6664 "misc/test_tosa_spec.py" ,
6765 "misc/test_bn_relu_folding_qat.py" ,
6866 "misc/test_custom_partition.py" ,
@@ -81,6 +79,16 @@ def define_arm_tests():
8179 "deprecation/test_arm_compile_spec_deprecation.py" ,
8280 ]
8381
82+ # These import the top-level executorch.backends.arm package, whose
83+ # __init__ eagerly imports torch. Pulling that into pytest collection fails
84+ # in the packaged (non-OSS) build, so build them in OSS only; the public API
85+ # surface is covered by a dedicated backward-compatibility CI job.
86+ if runtime .is_oss :
87+ test_files += [
88+ "misc/test_public_api_manifest.py" ,
89+ "misc/test_validate_public_api_manifest.py" ,
90+ ]
91+
8492 TESTS = {}
8593
8694 for test_file in test_files :
@@ -116,8 +124,6 @@ def define_arm_tests():
116124 "//executorch/backends/arm/test:mxfp_test_common" ,
117125 "//executorch/backends/arm/test/misc:dw_convs_shared_weights_module" ,
118126 "//executorch/backends/arm:ao_ext" ,
119- "//executorch/backends/arm/scripts/public_api_manifest:public_api_manifest" ,
120- "//executorch/backends/arm:public_api" ,
121127 "//executorch/backends/arm:ethosu" ,
122128 "//executorch/backends/arm/tosa:compile_spec" ,
123129 "//executorch/backends/arm/tosa:partitioner" ,
@@ -129,5 +135,11 @@ def define_arm_tests():
129135 "fbsource//third-party/pypi/pytest:pytest" ,
130136 "fbsource//third-party/pypi/parameterized:parameterized" ,
131137 "fbsource//third-party/tosa_tools:tosa_reference_model" ,
132- ],
138+ ] + ([
139+ # Needed only by the OSS-only public API manifest tests above.
140+ # Depending on them everywhere drags the top-level package
141+ # __init__ (and its torch import) into pytest collection.
142+ "//executorch/backends/arm/scripts/public_api_manifest:public_api_manifest" ,
143+ "//executorch/backends/arm:public_api" ,
144+ ] if runtime .is_oss else []),
133145 )
0 commit comments