This is a python binding for WebARKitLib library. It is based on the WebARKitLib library and provides a python interface to the library. For now you can install the package only with testPyPi: pip install -i https://test.pypi.org/simple/ artoolkitnft
To build the bindings locally and test them without publishing to TestPyPI:
- Python 3.8+ with
pip - A C/C++ toolchain (MSVC Build Tools on Windows,
build-essentialon Linux) cmakeavailable onPATH(used bysetup.pyto build the bundled zlib)- The git submodules initialised:
git submodule update --init
- On Windows:
vcpkgwithlibjpeg-turboandpthreadsinstalled (see thebuild-windowsjob in.github/workflows/build-python.ymlfor the exact commands). - On Linux:
sudo apt-get install -y libjpeg9
From the python-bindings/ directory:
pip install --upgrade pip setuptools wheel pybind11 numpy pillow pytest
python setup.py bdist_wheel
pip install --force-reinstall dist/artoolkitnft-*.whlOn Windows PowerShell the last step needs an explicit Get-ChildItem because
PowerShell does not expand globs the way bash does:
pip install --force-reinstall (Get-ChildItem dist\artoolkitnft-*.whl | Select-Object -First 1).FullName--force-reinstall is important — without it, pip sees the version has
not changed and skips reinstalling, so your C++ changes never land.
python example.py- Do not use
python -m buildhere: it creates an isolated build environment that does not inheritcmake(orvcpkg) from your shell. Use the legacypython setup.py bdist_wheelinstead, which keeps your currentPATH. - Working inside a virtualenv (
python -m venv .venv) is recommended so you do not pollute the system / Anaconda site-packages.
To publish the package to TestPyPI on a Linux system, follow these steps:
-
Install the required tools: Ensure you have
setuptools,wheel, andtwineinstalled. You can install them using pip:pip install --upgrade setuptools wheel twine
-
Build the wheel: Navigate to the directory containing your
setup.pyfile and run the following command to build the wheel:python setup.py sdist bdist_wheel --plat-name manylinux2014_x86_64
-
Check the wheel file: Verify that the wheel file has the correct platform tag. You can use the
wheeltool to inspect the wheel file:pip install wheel wheel unpack dist/artoolkitnft-0.0.12-cp38-cp38-manylinux2014_x86_64.whl
-
Upload the wheel to TestPyPI: Use
twineto upload the wheel to TestPyPI. You will need your TestPyPI credentials for this step.twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Here is a summary of the commands you need to run:
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel --plat-name manylinux2014_x86_64
pip install wheel
wheel unpack dist/artoolkitnft-0.0.12-cp38-cp38-manylinux2014_x86_64.whl
twine upload --repository-url https://test.pypi.org/legacy/ dist/*Make sure you replace dist/artoolkitnft-0.0.12-cp38-cp38-manylinux2014_x86_64.whl with the actual path to your wheel file if it's different.