def get_possible_modules(self) -> tuple[str, ...]:
        """Get module names that could be imported. Mirrors get_possible_paths logic."""
        path = self.python_file_path

        # st2 adds the parent dir of the python file to sys.path at runtime.
        module = path.stem if path.suffix == ".py" else path.name
        modules = [module]

        # By convention, however, just actions/ is on sys.path during tests.
        # so, also construct the module name from actions/ to support tests.
        _, relative_to_pack_content_dir = self._split_pack_content_path(path)
        module = module_from_stripped_path(relative_to_pack_content_dir)
        if module not in modules:
            modules.append(module)

        return tuple(modules)
Get module names that could be imported. Mirrors get_possible_paths logic.
pants-plugins/pack_metadata/python_rules/python_pack_content.py