everything good? I'm obfuscating the hexlet_python_package project. A template package for python. However, when I try to import and use the library implementations, I get an error where libruntime is located.
To generate the code obfuscation I am using the Building obfuscated wheel tutorial.
my machine (Mac m1) is configured with:
Python 3.11.7
Poetry (version 1.8.2)
Pyarmor 8.5.0 (trial), 000000, non-profits
License Type : pyarmor-trial
License No. : pyarmor-vax-000000
License To :
License Product : non-profits
BCC Mode : No
RFT Mode : No
my setup.cfg:
[flake8]
accept-encodings = utf-8
max-complexity = 6
statistics = False
max-line-length = 80
enable-extensions = G
isort-show-traceback = True
exclude = .git,__pycache__,.venv,dist,build
ignore =
# line break occurred before a binary operator
W503
per-file-ignores =
# init modules can contain the local imports, logic, unused imports
__init__.py: F401
[isort]
multi_line_output = 3
include_trailing_comma = true
default_section = FIRSTPARTY
line_length = 79
[metadata]
name = hexlet_python_package
version = attr: hexlet_python_package.VERSION
[options]
package_dir =
=dist/
packages =
hexlet_python_package
hexlet_python_package.pyarmor_runtime_000000
include_package_data = True
my pyproject.toml:
[tool.poetry]
name = "hexlet-python-package"
version = "0.3.0"
description = ""
authors = ["skip"]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.2"
pytest-cov = "^4.1.0"
flake8 = "^6.1.0"
[tool.poetry.scripts]
hexlet-python-package = "hexlet_python_package.scripts.hexlet_python_package:main"
[build-system]
requires = [
"poetry-core>=1.0.0",
"setuptools>=66.1.1",
"wheel"
]
build-backend = "setuptools.build_meta"
my MANIFEST.in:
recursive-include dist/hexlet_python_package/pyarmor_runtime_000000 *.so
recursive-include dist/hexlet_python_package/libruntime *.so
Error log when i try use into another project from pip install:
Ocorreu uma exceção: ImportError
cannot import name '__pyarmor__' from 'hexlet_python_package.libruntime' (unknown location)
File "/Users/x/Desktop/babel-fish/python-sample-vscode-django-tutorial/feature/homeList/business/get_LogUseCase.py", line 2, in <module>
from hexlet_python_package import user
File "/Users/x/Desktop/babel-fish/python-sample-vscode-django-tutorial/hello/views.py", line 4, in <module>
from feature.homeList.business.get_LogUseCase import GetLogUseCase
File "/Users/x/Desktop/babel-fish/python-sample-vscode-django-tutorial/hello/urls.py", line 3, in <module>
from hello import views
File "/Users/x/Desktop/babel-fish/python-sample-vscode-django-tutorial/web_project/urls.py", line 22, in <module>
path("", include("hello.urls")),
^^^^^^^^^^^^^^^^^^^^^
File "/Users/x/Desktop/babel-fish/python-sample-vscode-django-tutorial/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/Users/x/Desktop/babel-fish/python-sample-vscode-django-tutorial/manage.py", line 22, in <module>
main()
ImportError: cannot import name '__pyarmor__' from 'hexlet_python_package.libruntime' (unknown location)
tree : hexlet_python_package
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-311.pyc
│ └── user.cpython-311.pyc
├── scripts
│ ├── __init__.py
│ └── hexlet_python_package.py
└── user.py
tree: dist/hexlet_python_package
├── __init__.py
├── __pycache__
│ └── __init__.cpython-311.pyc
├── libruntime
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-311.pyc
│ └── pyarmor_runtime.so
├── pyarmor_runtime_000000
│ ├── __init__.py
│ └── pyarmor_runtime.so
├── scripts
│ ├── __init__.py
│ └── hexlet_python_package.py
└── user.py
Can anyone who has been through this help me? Thank you very much
Import and use a obfuscated library