Skip to content

Commit f726341

Browse files
committed
add an .so test file
1 parent c844aa0 commit f726341

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

python/private/py_library.bzl

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,16 @@ def _get_venv_symlinks(ctx, dist_info_metadata):
297297
path = path.removeprefix(site_packages_root)
298298
dir_name, _, filename = path.rpartition("/")
299299

300-
if src.extension not in PYTHON_FILE_EXTENSIONS:
301-
if dir_name.endswith(".dist-info"):
302-
# we have already handled the stuff
303-
pass
304-
elif dir_name:
305-
# TODO @aignas 2025-05-30: is this the right way?
306-
dirs_with_init[dir_name] = None
307-
repo_runfiles_dirname = runfiles_root_path(ctx, src.short_path).partition("/")[0]
308-
elif dir_name and filename.startswith("__init__."):
300+
if dir_name.endswith(".dist-info") and src.extension not in PYTHON_FILE_EXTENSIONS:
301+
# we have already handled the stuff
302+
continue
303+
elif dir_name:
304+
# This can be either a directory with libs (e.g. numpy.libs)
305+
# or a directory with `__init__.py` file that potentially also needs to be
306+
# symlinked.
309307
dirs_with_init[dir_name] = None
310308
repo_runfiles_dirname = runfiles_root_path(ctx, src.short_path).partition("/")[0]
311-
elif not dir_name:
309+
else:
312310
repo_runfiles_dirname = runfiles_root_path(ctx, src.short_path).partition("/")[0]
313311

314312
# This would be files that do not have directories and we just need to add

tests/modules/other/simple_v1/site-packages/simple_extras/__init__.py renamed to tests/modules/other/simple_v1/site-packages/simple_v1_extras/__init__.py

File renamed without changes.

tests/modules/other/simple_v2/site-packages/simple.libs/data.txt renamed to tests/modules/other/simple_v2/site-packages/simple.libs/data.so

File renamed without changes.

tests/venv_site_packages_libs/bin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_dirs_from_replaced_package_are_not_present(self):
7171

7272
# Ensure that packages from simple v1 are not present
7373
files = [p.name for p in site_packages.glob("*")]
74-
self.assertNotIn("simple_extras", files)
74+
self.assertNotIn("simple_v1_extras", files)
7575

7676

7777
if __name__ == "__main__":

0 commit comments

Comments
 (0)