-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from pedrobiqua/33-bug-missing-so-file-in-buil…
…d-output fix(Build-system): Add __init__.py copy .so files to right folder
- Loading branch information
Showing
7 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include search_engine_cpp/lib/*.so | ||
recursive-include search_engine_cpp/lib *.so |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
# __all__ [ | ||
# 'crawler', | ||
# ] | ||
import ctypes | ||
import os | ||
|
||
# Obtenha o caminho absoluto do .so | ||
lib_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "lib", "libsearch_engine.so")) | ||
|
||
# Carregue o .so com ctypes | ||
try: | ||
ctypes.CDLL(lib_path) | ||
except OSError as e: | ||
raise ImportError(f"Erro ao carregar a biblioteca compartilhada '{lib_path}': {e}") | ||
|
||
# Agora, importe os submódulos normalmente | ||
from . import _hello | ||
from . import _page_rank | ||
from . import _inverted_index | ||
|
||
__all__ = ["_hello", "_page_rank", "_inverted_index"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters