@@ -930,6 +930,25 @@ def test_repoints_across_multiple_prebundle_dirs(self, tmp_path):
930930 for pb in (pb1 , pb2 ):
931931 assert (pb / "torch" ).is_symlink (), f"torch in { pb } should be repointed"
932932
933+ def test_repoints_package_inside_expanded_extra_bundle (self , tmp_path ):
934+ """Expanded extras bundles must not retain file links into a replaced package."""
935+ isaacsim_path , prebundle = self ._sim_with_prebundle (tmp_path / "sim" , ["newton" ])
936+ shared_init = prebundle / "newton" / "legacy" / "__init__.py"
937+ shared_init .parent .mkdir ()
938+ shared_init .write_text ("" )
939+ bundled_newton = prebundle / "newton[sim]" / "newton-wheel" / "newton"
940+ bundled_init = bundled_newton / "legacy" / "__init__.py"
941+ bundled_init .parent .mkdir (parents = True )
942+ bundled_init .symlink_to (shared_init )
943+ site_pkgs = _make_site_packages (tmp_path / "env" , ["newton" ])
944+
945+ with self ._patch (isaacsim_path , site_pkgs , str (tmp_path / "env" / "bin" / "python" )):
946+ _repoint_prebundle_packages ()
947+
948+ assert (prebundle / "newton" ).resolve () == (site_pkgs / "newton" ).resolve ()
949+ assert bundled_newton .is_symlink ()
950+ assert bundled_newton .resolve () == (site_pkgs / "newton" ).resolve ()
951+
933952 # ---- Windows: copy instead of symlink -----------------------------------
934953
935954 def test_copies_package_on_windows_instead_of_symlinking (self , tmp_path ):
0 commit comments