Python bindings for Polyscope. https://polyscope.run/py
This library is a python wrapper and deployment system. The core library lives at https://github.com/nmwsharp/polyscope. See documentation at https://polyscope.run/py.
To contribute, check out the instructions here.
With uv, add polyscope to your project:
uv add polyscopeWith conda, install from PyPI using pip inside your environment:
python -m pip install polyscopepolyscope-py should work out-of-the-box on any combination of Python 3.9-3.14 and Linux/macOS/Windows. Your graphics hardware must support OpenGL >= 3.3 core profile (which is >15 years old; all remotely recent machines do, but funky VMs might not).
Development uses uv to manage Python and its packages. You also need CMake and a C++ compiler.
uv sync
uv run cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
uv run cmake --build build --parallel 12Running CMake through uv run makes it build against the Python in .venv/. A build/ directory configured with a different Python (such as a conda environment) keeps using that one, so delete it before configuring again.
Run the tests, which import polyscope from src/ and build/:
uv run test/polyscope_test.py -v --backend=openGL_mockTo run your own scripts against the local build, add both directories to PYTHONPATH. The paths src and build are relative, so run this from the repo root:
PYTHONPATH=src:build uv run path/to/script.pyLint, format, and type check:
uv run ruff check .
uv run ruff format --check .
uv run ty check .This repo is configured with CI on github actions.
- By default, all commits to the main branch build & run tests. Use
[ci skip]to skip this. - Tagging a commit with
[ci build]causes it to also build all precompiled wheels on a matrix of platforms to ensure the build scripts succeed. - Tagging a commit with
[ci publish]causes it to build all precompiled wheels on a matrix of platforms AND upload them to pypi index
-
Commit the desired version to the
masterbranch. Use the[ci build]string in the commit message to trigger builds, which should take about an hour. -
Watch the github actions builds to ensure all wheels build successfully. The resulting binaries will be saved as artifacts if you want try test with them.
-
While you're waiting, update the docs, including the changelog.
-
Update the version string in
pyproject.tomlto the new version number, and runuv lockto record it inuv.lock. When you commit, include the string[ci publish], which will kick of a publish job to build wheels again AND upload them to PyPI. -
If something goes wrong with the build & publish, you can manually retry by pushing any new commit with "[ci publish]" in the message.
-
Create a github release. Tag the release commit with a tag like
v1.2.3, matching the version inpyproject.toml -
Update the conda builds by committing to the feedstock repository. This generally just requires bumping the version number and updating the hash in
meta.yml. Sincemeta.ymlis configured to pull source from PyPi, you can't do this until after the source build has been uploaded from the github action.