Replies: 3 comments 1 reply
-
Replacing
|
Beta Was this translation helpful? Give feedback.
-
Pyarmor provides many features and rich options could solve all of your problems, please check the documentation to learn the features and how to use these options. This is a good example to explain how to use private settings and plugin. In order to patch
and use post-build plugin to modify |
Beta Was this translation helpful? Give feedback.
-
@fO-000 thank you for share example in well format, I borrow it to document how-to guide for building wheel. This guide requires pyarmor 8.2 |
Beta Was this translation helpful? Give feedback.
-
Environment:
VMware guest Linux x 6.1.0-kali7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2kali1 (2023-04-18) x86_64 GNU/Linux
The
test-project
hierarchy is as follows:$ tree test-project test-project ├── MANIFEST.in ├── pyproject.toml ├── setup.cfg └── src └── parent ├── child │ └── __init__.py └── __init__.py 4 directories, 5 files
The content of each file is as follows:
MANIFEST.in
recursive-include dist/parent/pyarmor_runtime_00xxxx *.so
pyproject.toml
[build-system] requires = [ "setuptools>=66.1.1", "wheel" ] build-backend = "setuptools.build_meta"
setup.cfg
src/parent/__init__.py
andsrc/parent/child/__init__.py
are the same:The output of
pyarmor gen --recursive -i src/parent
after successful execution is the following directory:$ tree dist dist └── parent ├── child │ ├── __init__.py │ └── __pycache__ │ └── __init__.cpython-311.pyc ├── __init__.py └── pyarmor_runtime_00xxxx ├── __init__.py └── pyarmor_runtime.so
Next, executing
python -m build --skip-dependency-check --no-isolation
to build the wheel package raises the following error:The reason for the error can be seen as "AttributeError: parent.child has no attribute VERSION".
If we change
version = attr: parent.child.VERSION
toversion = attr: parent.VERSION
insetup.cfg
, the problem can be solved. But I need to put theVERSION
inparent.child
. So how to solve this problem, please?Beta Was this translation helpful? Give feedback.
All reactions