Module setup¶
Setup from PyPi¶
pip install tonpy
Supported OS:
MacOS
Linux
Windows
Supported Python versions:
Python 3.9
Python 3.10
Python 3.11
Supported arch:
aarch64 (include Mac M1)
x86_64
For each OS
/ Python
/ arch
it’s separated .whl
distribution in pypi
Also you can compile lib from sources for your os or for local development.
Development setup (pre-built)¶
Find you
OS
/Python
/arch
in releasesDownload
so
ordll
from release and put it intosrc/tonpy/libs/
folder
Development setup (compile from sources)¶
If you want to setup tonpy
package for local development (including C++ code) you need to:
- Download Disintar TON monorepo fork:
git clone https://github.com/disintar/ton
- Compile
python_ton
target withcmake
: cd ton && mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Debug -DTON_USE_PYTHON=1 \ -DPYTHON_INCLUDE_DIRECTORIES=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \ -DPYTHON_LIBRARY=$(python3 -c "import distutils.sysconfig as sysconfig; print(sysconfig.get_config_var('LIBDIR'))") \ -DPYTHON_EXECUTABLE=$(which python3) cmake --build . --target python_ton
Optionally add path to openssl
-DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3
After compilation
so
/dll
file will be inbuild/tvm_python
folder. Example name:python_ton.cpython-39-darwin.so
- Compile
- Link compiled shared object to
src/tonpy/libs/
oftonpy
project: ln -s PATH_TO_LIB src/tonpy/libs/
- Link compiled shared object to