diff --git a/.github/RELEASING.md b/.github/RELEASING.md new file mode 100644 index 0000000..dbdb35b --- /dev/null +++ b/.github/RELEASING.md @@ -0,0 +1,23 @@ +# CI and releases + +The build workflow checks pushes and pull requests. It builds a universal wheel from the source +archive, checks Ruff and documentation, and tests the installed wheel on Apple Silicon and Intel +with Python 3.10–3.14 and free-threaded 3.13t/3.14t, both with and without optional dependencies. +Python 3.14 also installs and tests the source archive on both architectures. Metal tests skip +when a runner has no Metal device; a passing job with those skips does not validate GPU transfers. + +To publish, run **Publish release** manually on the default branch and select PyPI, GitHub Releases, +or both. With neither selected, it only builds and validates. All validation jobs must pass before +publication. The version in `pyproject.toml` determines the release tag (`v0.2.0` for this version). +Use a new version for each release; existing releases and packages are not overwritten. + +Before the first PyPI publication, configure a GitHub trusted publisher on PyPI for owner `cansik`, +repository `syphon-python`, workflow `publish.yml`, and environment `pypi`. Create that GitHub +environment and configure any desired reviewer protection. Publication uses OIDC and needs no +PyPI API token. See the [PyPI trusted publishing guide](https://docs.pypi.org/trusted-publishers/adding-a-publisher/). + +For documentation hosting, select **GitHub Actions** as the repository's Pages source. The +**Publish documentation** workflow runs manually or on pushed `v*` tags. Tags created by the +release workflow's `GITHUB_TOKEN` do not trigger another workflow, so run documentation publication +manually after those releases. + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afcadb3..7bbb571 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,68 +1,96 @@ -name: Build +name: Build and test on: + push: + branches: ['**'] + pull_request: workflow_dispatch: - inputs: - publishReleases: - description: 'Publish to Releases' - required: false - default: 'true' + workflow_call: + outputs: + version: + description: Package version from pyproject.toml + value: ${{ jobs.build.outputs.version }} + +permissions: + contents: read jobs: build: - strategy: - fail-fast: false - matrix: - os: [ 'macos-latest' ] - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] - - runs-on: ${{ matrix.os }} - - name: ${{ github.event.inputs.tag }} python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: macos-15 + timeout-minutes: 30 + outputs: + version: ${{ steps.metadata.outputs.version }} steps: - # Checks-out your repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - python-version: ${{ matrix.python-version }} - - - name: Switch to Workspace - run: | - echo ${{ github.workspace }} - cd ${{ github.workspace }} - - - name: Get Library Version - id: get_version - run: | - pip install setuptools - - lib_version=$(python setup.py --version) - echo "Library Version: $lib_version" - - echo ::set-output name=version::"$lib_version" - echo ::set-output name=v_version::"v$lib_version" - - - name: Preqrequisites + submodules: recursive + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + id: python + with: + python-version: '3.14' + - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + with: + version: '0.11.29' + - name: Ensure the Xcode Metal compiler is available + run: xcrun metal --version || xcodebuild -downloadComponent MetalToolchain + - name: Install development dependencies + env: + UV_PYTHON: ${{ steps.python.outputs.python-path }} + run: uv sync --locked --group docs --extra numpy --extra opengl + - name: Check formatting and lint run: | - git submodule update --init --recursive - - # run build command - - name: Build + uv run --no-sync ruff check . + uv run --no-sync ruff format --check . + - name: Build source archive and universal wheel from it + run: uv build + - name: Validate distributions + run: uv run --no-sync pytest tests/test_distributions.py --dist-dir dist + - name: Build documentation + run: uv run --no-sync python scripts/generate_doc.py + - name: Read package version + id: metadata run: | - python -m pip install -r dev-requirements.txt - python setup.py build - python setup.py bdist_wheel --plat-name=macosx_10_9_universal2 - ls dist + .venv/bin/python -c 'import tomllib; print("version=" + tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])' >> "$GITHUB_OUTPUT" + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: python-dist + path: | + dist/*.whl + dist/*.tar.gz + if-no-files-found: error - # upload dist - - name: Upload binaries to release - if: ${{ github.event.inputs.publishReleases == 'true' }} - uses: svenstaro/upload-release-action@v2 + test: + needs: build + name: Python ${{ matrix.python }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: [macos-15, macos-15-intel] + python: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.13t', '3.14t'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + id: python + with: + python-version: ${{ matrix.python }} + - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + with: + version: '0.11.29' + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: dist/*.whl - tag: ${{ steps.get_version.outputs.v_version }} - release_name: "Version ${{ steps.get_version.outputs.version }}" - body: "Prebuilt wheel packages version ${{ steps.get_version.outputs.version }}." - overwrite: true - file_glob: true \ No newline at end of file + name: python-dist + path: dist + - name: Ensure the Xcode Metal compiler is available for source builds + if: matrix.python == '3.14' + run: xcrun metal --version || xcodebuild -downloadComponent MetalToolchain + - name: Test installed wheel with and without extras + env: + TEST_PYTHON: ${{ steps.python.outputs.python-path }} + TEST_VARIANT: ${{ endsWith(matrix.python, 't') && 'free-threaded' || 'standard' }} + TEST_SOURCE: ${{ matrix.python == '3.14' && 'true' || 'false' }} + run: bash scripts/ci_test.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9fa9402..bafdfeb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,48 +1,49 @@ -name: Publish Docs +name: Publish documentation -# build the documentation whenever there are new commits on main on: workflow_dispatch: push: - # Alternative: only build for tags. - tags: - - '*' + tags: ['v*'] -# security: restrict permissions for CI jobs. permissions: contents: read +concurrency: + group: github-pages + cancel-in-progress: false + jobs: - # Build the documentation and upload the static HTML files as an artifact. build: - runs-on: 'macos-latest' + runs-on: macos-15 + timeout-minutes: 30 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - python-version: '3.10' - - - name: Preqrequisites - run: | - git submodule update --init --recursive - - # install relevant files - - run: pip install -r dev-requirements.txt - - run: pip install -r requirements.txt - - run: python setup.py build - - # build documentation into docs/. - - run: python setup.py doc - - - uses: actions/upload-pages-artifact@v2 + submodules: recursive + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + id: python + with: + python-version: '3.14' + - uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + with: + version: '0.11.29' + - name: Ensure the Xcode Metal compiler is available + run: xcrun metal --version || xcodebuild -downloadComponent MetalToolchain + - name: Install documentation dependencies + env: + UV_PYTHON: ${{ steps.python.outputs.python-path }} + run: uv sync --locked --no-dev --group docs --extra numpy + - name: Generate documentation + run: uv run --no-sync python scripts/generate_doc.py + - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: - path: docs/ + path: docs - # Deploy the artifact to GitHub pages. - # This is a separate job so that only actions/deploy-pages has the necessary permissions. deploy: needs: build runs-on: ubuntu-latest + timeout-minutes: 10 permissions: pages: write id-token: write @@ -51,4 +52,4 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1bed48e..c9f7e62 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,42 +1,76 @@ -name: Publish Python Package to PyPI +name: Publish release on: workflow_dispatch: inputs: - tag: - description: 'Version Tag' - required: false - default: 'v0.1.0' + publish_pypi: + description: Publish to PyPI (requires the pypi trusted publisher) + type: boolean + default: false + publish_release: + description: Create a GitHub release and upload distributions + type: boolean + default: false +permissions: + contents: read jobs: - deploy: + guard: runs-on: ubuntu-latest - environment: production - + timeout-minutes: 5 steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' + - name: Require the default branch for publishing + if: inputs.publish_pypi || inputs.publish_release + env: + SELECTED_REF: ${{ github.ref }} + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + run: test "$SELECTED_REF" = "refs/heads/$DEFAULT_BRANCH" - - name: "Download binaries from ${{ github.event.inputs.tag }}" - uses: robinraju/release-downloader@v1.3 - with: - repository: ${{ github.repository }} - tag: ${{ github.event.inputs.tag }} - fileName: "*" - out-file-path: "dist" - token: ${{ github.token }} + validate: + needs: guard + uses: ./.github/workflows/build.yml - - name: Test - run: | - ls dist + pypi: + if: inputs.publish_pypi + needs: validate + runs-on: ubuntu-latest + timeout-minutes: 10 + environment: + name: pypi + url: https://pypi.org/project/syphon-python/ + permissions: + contents: read + id-token: write + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: python-dist + path: dist + - name: Publish tested distributions using OIDC + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 - - name: Publish package - # if: ${{ false }} - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + release: + if: inputs.publish_release + needs: validate + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: python-dist + path: dist + - name: Create versioned release with tested distributions + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + RELEASE_VERSION: ${{ needs.validate.outputs.version }} + RELEASE_COMMIT: ${{ github.sha }} + run: | + existing_tag=$(gh api "repos/$GH_REPO/git/matching-refs/tags/v$RELEASE_VERSION" \ + --jq ".[] | select(.ref == \"refs/tags/v$RELEASE_VERSION\") | .ref") + test -z "$existing_tag" || { echo "Release tag already exists: $existing_tag"; exit 1; } + gh release create "v$RELEASE_VERSION" dist/*.whl dist/*.tar.gz \ + --target "$RELEASE_COMMIT" --title "Version $RELEASE_VERSION" --generate-notes diff --git a/.gitignore b/.gitignore index 5fb679f..1b382ac 100644 --- a/.gitignore +++ b/.gitignore @@ -159,4 +159,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ .DS_Store -docs/**/* \ No newline at end of file +.ruff_cache/ +docs/**/* diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..6324d40 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.14 diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..89d0261 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,19 @@ +cff-version: 1.2.0 +message: "If you use this software, please cite it using these metadata." +type: software +title: "syphon-python" +version: "0.2.0" +authors: + - family-names: "Bruggisser" + given-names: "Florian" + orcid: "https://orcid.org/0009-0003-0645-6746" +abstract: "Python wrapper for the Syphon GPU texture sharing framework, supporting Metal and OpenGL on macOS." +license: "MIT" +url: "https://github.com/cansik/syphon-python" +repository-code: "https://github.com/cansik/syphon-python" +keywords: + - python + - syphon + - metal + - opengl + - texture sharing diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 1535cb4..f3897e5 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -35,7 +35,7 @@ server = syphon.SyphonOpenGLServer("Demo") To publish a texture, the method `syphon.server.BaseSyphonServer.publish_frame_texture()` can be used. We assume that the corresponding texture has already been created and is available in the `texture` variable. To see how to create and fill a MTLTexture or glTexture, please have a look at the [examples](https://github.com/cansik/syphon-python/tree/main/examples). ```python -texture = ... # MTLTexture or glTexture +texture = ... # MTLTexture or glTexture server.publish_frame_texture(texture) ``` @@ -66,6 +66,8 @@ server = syphon.SyphonMetalServer("Demo", device=mtl_device, command_queue=mtl_c ``` ### OpenGL Server +Install `syphon-python[opengl]` to enable OpenGL support. Metal usage does not require this extra. + On initialisation, the `syphon.server.SyphonOpenGLServer` tries to find the current [cglContextObj](https://developer.apple.com/documentation/appkit/nsopenglcontext/1436158-cglcontextobj) using the current [NSOpenGLContext](https://developer.apple.com/documentation/appkit/nsopenglcontext). It is possible to override the automatic lookup by passing a valid `cglContextObj` as a parameter to the `syphon.server.SyphonOpenGLServer`. ```python @@ -128,7 +130,7 @@ To get textures, it is possible to first check if the server has provided a new ```python if client.has_new_frame: - texture = client.new_frame_image # either MTLTexture or glTexture + texture = client.new_frame_image # either MTLTexture or glTexture ``` To stop the client and disconnect from the server, the `syphon.client.BaseSyphonClient.stop()` method can be used. @@ -149,6 +151,8 @@ client = syphon.SyphonMetalClient(server_info, device=mtl_device) ``` ### OpenGL Client +Install `syphon-python[opengl]` to enable OpenGL support. + As with the [opengl server](#opengl-server), it is possible to override the automatic lookup by passing a valid `cglContextObj` as a parameter to the `syphon.client.SyphonOpenGLClient`. ```python @@ -184,7 +188,7 @@ To write `bytes` to an [MTLTexture](https://developer.apple.com/documentation/me from syphon.utils.raw import copy_bytes_to_mtl_texture data = ... # bytes() based buffer -texture = ... # MLTTexture object +texture = ... # MLTTexture object copy_bytes_to_mtl_texture(data, texture) ``` @@ -194,15 +198,15 @@ To read `bytes` from an [MTLTexture](https://developer.apple.com/documentation/m ```python from syphon.utils.raw import copy_mtl_texture_to_bytes -texture = ... # MLTTexture object +texture = ... # MLTTexture object -data = copy_mtl_texture_to_bytes(texture) # returns bytes +data = copy_mtl_texture_to_bytes(texture) # returns bytes ``` ### Numpy If you are working with [Numpy](https://numpy.org/) arrays, the `syphon.utils.numpy` package contains helper methods for reading and writing numpy images to and from [MTLTexture](https://developer.apple.com/documentation/metal/mtltexture). -It is important to note that the `numpy` package is not installed by default, it must be installed using `pip install numpy`. +It is important to note that the `numpy` package is not installed by default, it must be installed using `pip install 'syphon-python[numpy]'`. To write a numpy image to a MTLTexture, the `syphon.utils.numpy.copy_image_to_mtl_texture()` method can be used. @@ -210,7 +214,7 @@ To write a numpy image to a MTLTexture, the `syphon.utils.numpy.copy_image_to_mt import numpy as np from syphon.utils.numpy import copy_image_to_mtl_texture -texture = ... # MLTTexture object +texture = ... # MLTTexture object # create RGBA image texture_data = np.zeros((512, 512, 4), dtype=np.uint8) @@ -225,9 +229,9 @@ To read a numpy image from a MTLTexture, the `syphon.utils.numpy.copy_mtl_textur import numpy as np from syphon.utils.numpy import copy_mtl_texture_to_image -texture = ... # MLTTexture object +texture = ... # MLTTexture object -texture_data = copy_mtl_texture_to_image(texture) # returns numpy array +texture_data = copy_mtl_texture_to_image(texture) # returns numpy array ``` ## Python Binding @@ -275,3 +279,130 @@ class SimpleServerScreen(Screen): texture_pointer = get_mtl_texture(texture) self.syphon_server.publish_frame_texture(texture_pointer, is_flipped=True) ``` + + +## Frame Notifications + +When receiving frames, an application can check `has_new_frame` in its rendering loop. If the application does not already have such a loop, a callback can be used to notify it when a frame arrives. Both Metal and OpenGL clients accept a `new_frame_handler` which receives the client as its argument. + +The following example uses a Python event to signal the application that a new frame is available. + +```python +import threading + +available = threading.Event() + +with syphon.SyphonMetalClient(description, new_frame_handler=lambda client: available.set()) as client: + # wait for a notification, then retrieve the latest texture + if available.wait(timeout=5): + available.clear() + texture = client.new_frame_image +``` + +Syphon calls the handler on a background thread. Keep the handler short and perform UI or OpenGL work on the application thread. A client must also be stopped outside this callback to avoid blocking Syphon's own notification thread. + +For applications using asyncio, `callback_loop=asyncio.get_running_loop()` can be passed to deliver the handler on that event loop instead. The handler is still a regular Python function; it can use `asyncio.create_task()` to start asynchronous work. + +### Waiting with Asyncio + +If an application already uses asyncio, `wait_for_frame()` allows it to wait for an image while other tasks continue running. The method waits for availability; the image is then retrieved separately through `new_frame_image`. + +```python +async def receive_frame(description): + with syphon.SyphonMetalClient(description) as client: + # wait up to five seconds for a frame + await client.wait_for_frame(timeout=5) + texture = client.new_frame_image + return texture +``` + +A timeout raises `asyncio.TimeoutError`, and a disconnected server raises `ConnectionError`. Syphon provides the latest frame, so a slow receiver may skip intermediate frames. Waiting does not create a queue of images. + +For complete examples, see [MetalCallbackExample](https://github.com/cansik/syphon-python/blob/main/examples/MetalCallbackExample.py) and [MetalAsyncExample](https://github.com/cansik/syphon-python/blob/main/examples/MetalAsyncExample.py). The asyncio example also shows how to process Cocoa events for server discovery without a UI. + +## Private Servers + +By default, Syphon servers appear in the shared directory so that other applications can find them. If an output is only intended for a specific client, `is_private=True` can be used to hide it from discovery. The client then connects using the server's description directly. + +```python +with syphon.SyphonMetalServer("Internal", is_private=True) as server: + # connect directly without searching the shared directory + with syphon.SyphonMetalClient(server.server_description, server.device) as client: + ... +``` + +This works for both Metal and OpenGL servers. A private server is hidden, but is not protected by authentication. When passing its description to another process, preserve the complete `server_description.raw` dictionary. It can be converted back using `SyphonServerDescription.from_native(raw)`. + +### Changing the Server Name + +An application may want to rename an output when its content changes, for example when switching from a camera feed to a preview. Assigning `server.name` updates the running server and its name in discovery. + +```python +server.name = "Camera Preview" +``` + +### Accessing the Server Output + +To preview a server's output in the same application, `server.new_frame_image` can be used without creating an additional client. It returns a Metal texture or an OpenGL image, depending on the server. + +```python +# retrieve the current output after publishing a frame +image = server.new_frame_image +if image is not None: + ... # display or inspect the image +``` + +The result may be `None` before the first frame is published. Keep the image alive while using it and release Python references when finished; PyObjC handles native memory management. The image represents the current output rather than a saved copy of an earlier frame. + +See [PrivateMetalExample](https://github.com/cansik/syphon-python/blob/main/examples/PrivateMetalExample.py) for a complete example of private connections, renaming, and output access. + +## Direct OpenGL Rendering + +If an application already renders with OpenGL, it can draw directly into Syphon's framebuffer instead of creating a separate texture to publish. `bind_to_draw_frame()` selects that framebuffer, and `unbind_and_publish()` publishes the result after drawing. + +The following example assumes an OpenGL context is already current. + +```python +with syphon.SyphonOpenGLServer("Direct output", depth_buffer_resolution=24) as server: + if server.bind_to_draw_frame((640, 480)): + try: + ... # draw the scene using OpenGL + finally: + # publish the frame and restore the framebuffer binding + server.unbind_and_publish() +``` + +For scenes that need smoother edges or depth and stencil buffers, the server accepts `antialias_sample_count`, `depth_buffer_resolution`, and `stencil_buffer_resolution`. These options are disabled by default; the driver chooses a supported configuration. Supported parameter values are listed in `syphon.server.SyphonOpenGLServer`. + +Only unbind after a successful bind, and do both on the same thread. The OpenGL context must remain alive and available exclusively to that thread during drawing. Unbind before stopping the server. + +See [OpenGLDirectRenderingExample](https://github.com/cansik/syphon-python/blob/main/examples/OpenGLDirectRenderingExample.py) for a complete example which creates its own context. + +## Resource Cleanup + +Clients and servers hold native resources while they are running. A `with` statement is a convenient way to release them when leaving a block, including when an exception occurs. + +```python +with syphon.SyphonMetalServer("Demo") as server: + ... # create and publish textures + +# the server has now been stopped +``` + +The same pattern works for clients. Calling `stop()` explicitly is also supported, and calling it more than once is harmless. + +### Removing Directory Observers + +An application may only need discovery notifications while a server-selection view is open. `add_observer()` returns a token which can be used to remove that subscription when it is no longer needed. + +```python +with syphon.SyphonServerDirectory() as directory: + # listen for newly available servers + token = directory.add_observer(syphon.SyphonServerNotification.Announce, print) + directory.update_run_loop() + + # stop receiving this notification + directory.remove_observer(token) +``` + +Leaving the `with` block removes any remaining observers registered through that directory wrapper. Alternatively, call `directory.close()` explicitly. This does not stop Syphon's shared directory or remove another wrapper's observers. diff --git a/README.md b/README.md index 26a412a..3d4ca02 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,12 @@ [](https://pypi.org/project/syphon-python/) Python wrapper for the Syphon GPU texture sharing framework. This library was created to support both the Metal backend -and the deprecated OpenGL backend. It requires **macOS 11 or above**. +and the deprecated OpenGL backend. It requires **macOS 12 or above** and supports **Python 3.10–3.14**, +including the free-threaded **3.13t and 3.14t** builds. The implementation is based on [PyObjC](https://github.com/ronaldoussoren/pyobjc) to wrap the [Syphon framework](https://github.com/Syphon/Syphon-Framework) directly from Python. This approach eliminates -native wrapper and allows Python developers to extend the library as needed. +the native wrapper layer and allows Python developers to extend the library as needed. ## State of Development @@ -18,22 +19,32 @@ native wrapper and allows Python developers to extend the library as needed. - [x] Metal Client - [x] OpenGL Server - [x] OpenGL Client -- [ ] Syphon Client On Frame Callback +- [x] Syphon Client On Frame Callback +- [x] Async Frame Waiting +- [x] Context Managers +- [x] Private Servers and Server Renaming +- [x] Direct OpenGL Rendering ## Usage -To install `syphon-python` it is recommended to use a prebuilt binary from PyPi: +To install `syphon-python` it is recommended to use a prebuilt binary from PyPI: ```bash pip install syphon-python ``` -To run all the examples, please also install [Numpy](https://numpy.org/) and [OpenCV](https://opencv.org/): +Since version 0.2.0, PyOpenGL is optional. To use the OpenGL backend, install it with: ```bash -pip install numpy opencv-python +pip install 'syphon-python[opengl]' ``` -The following code snippet is a basic example showing how to share `numpy` images as `MTLTexture` with a `SyphonMetalServer`. There are more examples in [examples](/examples). +To work with NumPy images, as shown in the following example, also install the NumPy dependency: + +```bash +pip install 'syphon-python[numpy]' +``` + +The following code snippet is a basic example showing how to share `numpy` images as `MTLTexture` with a `SyphonMetalServer`. There are more examples in [examples](https://github.com/cansik/syphon-python/tree/main/examples). ```python import time @@ -44,68 +55,145 @@ import syphon from syphon.utils.numpy import copy_image_to_mtl_texture from syphon.utils.raw import create_mtl_texture -# create server and texture -server = syphon.SyphonMetalServer("Demo") -texture = create_mtl_texture(server.device, 512, 512) - -# create texture data -texture_data = np.zeros((512, 512, 4), dtype=np.uint8) -texture_data[:, :, 0] = 255 # fill red -texture_data[:, :, 3] = 255 # fill alpha - -while True: - # copy texture data to texture and publish frame - copy_image_to_mtl_texture(texture_data, texture) - server.publish_frame_texture(texture) - time.sleep(1) - -server.stop() +# create the server and stop it automatically when leaving the block +with syphon.SyphonMetalServer("Demo") as server, syphon.SyphonServerDirectory() as directory: + directory.run_loop_interval = 0.001 + + # create a texture on the server's Metal device + texture = create_mtl_texture(server.device, 512, 512) + + # create an opaque red RGBA image + texture_data = np.zeros((512, 512, 4), dtype=np.uint8) + texture_data[:, :, 0] = 255 # fill red + texture_data[:, :, 3] = 255 # fill alpha + + try: + while True: + # copy the image onto the texture and publish it + copy_image_to_mtl_texture(texture_data, texture) + server.publish_frame_texture(texture) + + # process discovery requests without opening a window + directory.update_run_loop() + time.sleep(1 / 60) + except KeyboardInterrupt: + pass ``` +For applications without a UI, `directory.update_run_loop()` processes Cocoa events on the main thread +so that other applications can discover the server. Calling it regularly keeps the server discoverable. + ## Development -To develop or manually install the library, use the following commands to set up the local repository. + +To develop or manually build the library, use [uv](https://docs.astral.sh/uv/) and Python 3.14 to set up +the local repository. Building the Syphon framework requires full Xcode with its Metal toolchain; +Command Line Tools alone are not sufficient. Installing a prebuilt wheel does not require Xcode. ### Installation ```bash -# clone the repository and it's submodules +# clone the repository and its submodules git clone --recurse-submodules https://github.com/cansik/syphon-python.git +cd syphon-python + +# install the library and development dependencies +uv sync --locked +``` -# install dependencies -pip install -r dev-requirements.txt -pip install -r requirements.txt +This builds the framework and installs the library in editable mode, so Python changes are immediately +available. For an existing checkout, run `git submodule update --init --recursive` first. -# for some examples the following dependencies are needed -pip install numpy -pip install opencv-python +To install the additional dependencies used by the examples: + +```bash +uv sync --locked --group examples + +# run a Metal example +uv run --group examples python -m examples.MetalServerExampleMini + +# run an OpenGL example with the optional dependency +uv run --group examples --extra opengl python -m examples.OpenGLServerExample ``` ### Build -Build the Syphon framework on your machine: +Create a source archive and a wheel package in `dist/`: + +```bash +uv build +``` + +The wheel includes the Syphon framework for both Apple Silicon and Intel. The source archive includes +the framework sources, so it can also be built without cloning the repository: + +```bash +python -m pip install ./dist/syphon_python-0.2.0.tar.gz +``` + +If you change the native framework sources during development, rebuild the editable installation with: + +```bash +uv sync --locked --reinstall-package syphon-python +``` + +The build uses the selected Xcode installation or finds it at `/Applications/Xcode.app` automatically. +If the Metal toolchain is missing, install it in **Xcode > Settings > Components**. For Xcode installed +in a custom location, specify its path when building: ```bash -python setup.py build +DEVELOPER_DIR=/path/to/Xcode.app/Contents/Developer uv build ``` -### Distribute +### Tests -Create a wheel package (also runs `build` automatically) +Run the tests locally with pytest: ```bash -python setup.py bdist_wheel +uv run pytest + +# also test the optional NumPy and OpenGL support +uv run --extra numpy --extra opengl pytest +``` + +After running `uv build`, use `uv run pytest --dist-dir dist` to check the generated packages as well. +Rendering tests require a Metal device or an OpenGL context; use `-m 'not metal and not opengl'` to skip them. + +To test with a different Python version, for example a free-threaded build: + +```bash +uv run --python 3.14t --extra numpy --extra opengl pytest +``` + +### Formatting + +The project uses Ruff to check and format Python code: + +```bash +# check the code and formatting +uv run ruff check . +uv run ruff format --check . + +# apply formatting +uv run ruff format . ``` ### Generate Documentation ```bash -# create documentation into "./docs -python setup.py doc +# generate documentation into docs/ +uv run --group docs --extra numpy python scripts/generate_doc.py -# launch pdoc webserver -python setup.py doc --launch +# launch the local documentation server +uv run --group docs --extra numpy python scripts/generate_doc.py --serve ``` +For release and CI instructions, see the [maintainer guide](https://github.com/cansik/syphon-python/blob/main/.github/RELEASING.md). + +## Citation + +If you use syphon-python in your research, please cite it using +[CITATION.cff](https://github.com/cansik/syphon-python/blob/main/CITATION.cff). + ## About -MIT License - Copyright (c) 2024 Florian Bruggisser +MIT License - Copyright (c) 2026 Florian Bruggisser diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..6f9ece9 --- /dev/null +++ b/conftest.py @@ -0,0 +1,40 @@ +"""Shared checks for installed-wheel and free-threaded test runs.""" + +import sys +import sysconfig +from pathlib import Path + +import pytest + + +def pytest_addoption(parser): + parser.addoption("--dist-dir", help="Validate the wheel and source archive in this directory") + parser.addoption( + "--python-variant", choices=("standard", "free-threaded"), help="Require the intended Python build variant" + ) + + +@pytest.fixture +def dist_dir(request): + directory = request.config.getoption("--dist-dir") + if directory is None: + pytest.skip("Pass --dist-dir dist after uv build to validate distribution artifacts") + return Path(directory).resolve() + + +def pytest_sessionstart(session): + expected = session.config.getoption("--python-variant") + actual = "free-threaded" if sysconfig.get_config_var("Py_GIL_DISABLED") else "standard" + if expected and expected != actual: + pytest.exit(f"Expected {expected} Python, but selected {actual} Python", returncode=1) + if sysconfig.get_config_var("Py_GIL_DISABLED") and sys._is_gil_enabled(): + pytest.exit("The free-threaded interpreter must run with its GIL disabled", returncode=1) + + +def pytest_sessionfinish(session, exitstatus): + # Check again after importing and exercising optional native dependencies. + if sysconfig.get_config_var("Py_GIL_DISABLED") and sys._is_gil_enabled(): + session.exitstatus = pytest.ExitCode.TESTS_FAILED + reporter = session.config.pluginmanager.get_plugin("terminalreporter") + if reporter: + reporter.write_sep("!", "A dependency enabled the GIL during the free-threaded test run", red=True) diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 3650502..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -wheel -pdoc~=14.1.0 -opencv-python -numpy \ No newline at end of file diff --git a/doc/theme/module.html.jinja2 b/doc/theme/module.html.jinja2 index 93ea63a..2ced38a 100644 --- a/doc/theme/module.html.jinja2 +++ b/doc/theme/module.html.jinja2 @@ -6,10 +6,3 @@ {% if logo_link %}{% endif %} {% endblock %} - - -{% defaultmacro docstring(var) %} - {% if var.docstring %} -
` tags.
- """
-
- def linkify_repl(m: re.Match):
- text = m.group(0)
- plain_text = text.replace(
- '.', "."
- )
- identifier = removesuffix(plain_text, "()")
- mod: pdoc.doc.Module = context["module"]
- # Check if this is a relative reference?
- if identifier.startswith("."):
- taken_from_mod = mod
- if namespace and (ns := mod.get(namespace)):
- # Imported from somewhere else, so the relative reference should be from the original module.
- taken_from_mod = context["all_modules"].get(ns.taken_from[0], mod)
- if taken_from_mod.is_package:
- # If we are in __init__.py, we want `.foo` to refer to a child module.
- parent_module = taken_from_mod.modulename
- else:
- # If we are in a leaf module, we want `.foo` to refer to the adjacent module.
- parent_module = taken_from_mod.modulename.rpartition(".")[0]
- while identifier.startswith(".."):
- identifier = identifier[1:]
- parent_module = parent_module.rpartition(".")[0]
- identifier = parent_module + identifier
- else:
- # Check if this is a local reference within this module?
- for qualname in qualname_candidates(identifier, namespace):
- doc = mod.get(qualname)
- if doc and context["is_public"](doc).strip():
- return f'{plain_text}'
- module = ""
- qualname = ""
- try:
- # Check if the object we are interested in is imported and re-exposed in the current namespace.
- for module, qualname in possible_sources(
- context["all_modules"], identifier
- ):
- doc = mod.get(qualname)
- if (
- doc
- and doc.taken_from == (module, qualname)
- and context["is_public"](doc).strip()
- ):
- if plain_text.endswith("()"):
- plain_text = f"{doc.qualname}()"
- else:
- plain_text = doc.qualname
- return f'{plain_text}'
- except ValueError:
- # possible_sources did not find a parent module.
- return text
- else:
- # It's not, but we now know the parent module. Does the target exist?
- doc = context["all_modules"][module]
- if qualname:
- assert isinstance(doc, pdoc.doc.Module)
- doc = doc.get(qualname)
- target_exists_and_public = (
- doc is not None and context["is_public"](doc).strip()
- )
- if target_exists_and_public:
- assert doc is not None # mypy
- if qualname:
- qualname = f"#{qualname}"
- if plain_text.endswith("()"):
- plain_text = f"{doc.name}()"
- else:
- plain_text = doc.name
- return f'{plain_text}'
- else:
- return text
-
- return Markup(
- re.sub(
- r"""
- # Part 1: foo.bar or foo.bar() (without backticks)
- (?\.)
- (?!\d)[a-zA-Z0-9_]+
- )+
- (?:\(\)|\b(?!\(\))) # we either end on () or on a word boundary.
- (?!) # not an existing link
- (?![/#]) # heuristic: not part of a URL
-
- | # Part 2: `foo` or `foo()`. `foo.bar` is already covered with part 1.
- (?<=)
- (?!\d)[a-zA-Z0-9_]+
- (?:\(\))?
- (?=(?!))
- """,
- linkify_repl,
- code,
- flags=re.VERBOSE,
- )
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("-o", "--output", type=Path, default=Path("docs"), help="HTML output directory (default: docs)")
+ parser.add_argument(
+ "--serve", action="store_true", help="Launch the local documentation server instead of writing HTML"
)
-
-
-def generate_doc(package_name: str,
- package_version: str,
- package_url: Optional[str],
- required_packages: List[str],
- output_path: Union[str, os.PathLike],
- package_paths: List[Union[str, os.PathLike]],
- extra_asset_path: Union[str, os.PathLike] = "doc",
- launch: bool = False):
- output_path = Path(output_path)
- extra_asset_path = Path(extra_asset_path)
-
- # clean doc dir
- if output_path.exists():
- shutil.rmtree(output_path)
- os.makedirs(output_path, exist_ok=True)
-
- # configure pdoc
- pdoc.render.configure(
- footer_text=f"{package_name} v{package_version}",
- logo_link=package_url,
- template_directory=extra_asset_path.joinpath("theme")
- )
-
- # add additional filters
- def remove_identifier(value: Markup):
- regex = r"()(.*\.)([A-Z].*)()"
- subst = "\\1\\3\\4"
- result = re.sub(regex, subst, value, 0, re.MULTILINE)
- return Markup(result)
-
- pdoc.render.env.filters["remove_identifier"] = remove_identifier
- pdoc.render.env.filters["linkify"] = custom_linkify
-
- if launch:
- host = "localhost"
- port = 8052
-
- try:
- try:
- httpd = pdoc.web.DocServer((host, port or 8080), package_paths)
- except OSError:
- # Couldn't bind, let's try again with a random port.
- httpd = pdoc.web.DocServer((host, port or 0), package_paths)
- except OSError as e:
- print(
- f"Cannot start web server on {host}:{port}: {e}"
- )
- sys.exit(1)
-
- with httpd:
- url = f"http://{host}:{httpd.server_port}"
- print(f"pdoc server ready at {url}")
- pdoc.web.open_browser(url)
- try:
- httpd.serve_forever()
- except KeyboardInterrupt:
- httpd.server_close()
- return
-
- # generate pdoc
- pdoc.pdoc(*package_paths, output_directory=output_path)
-
- # copy doc content
- shutil.copytree(extra_asset_path, output_path.joinpath(extra_asset_path.name))
+ args = parser.parse_args()
+ root = Path(__file__).resolve().parents[1]
+ command = [
+ sys.executable,
+ "-m",
+ "pdoc",
+ "syphon",
+ "--footer-text",
+ f"syphon-python v{version('syphon-python')}",
+ "--logo-link",
+ "https://github.com/cansik/syphon-python",
+ "--template-directory",
+ str(root / "doc/theme"),
+ ]
+ if not args.serve:
+ command.extend(["--output-directory", str(args.output.resolve())])
+ try:
+ return subprocess.call(command, cwd=root)
+ except KeyboardInterrupt:
+ return 130
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 7bc45bd..0000000
--- a/setup.py
+++ /dev/null
@@ -1,146 +0,0 @@
-import distutils
-import os
-import shutil
-import subprocess
-from distutils.command.install import install
-from pathlib import Path
-from typing import Union, Optional, List
-
-from setuptools import Extension
-from setuptools import find_packages, setup
-from setuptools.command.build_ext import build_ext
-
-NAME = "syphon-python"
-PACKAGE_NAME = "syphon"
-PACKAGE_VERSION = "0.1.1"
-PACKAGE_URL = "https://github.com/cansik/syphon-python"
-PACKAGE_DOC_MODULES = ["syphon"]
-
-LIBS_PATH = Path(PACKAGE_NAME, "libs")
-
-required_packages = find_packages(exclude=["examples", "playground", "scripts"])
-
-with open("requirements.txt") as f:
- required = [line for line in f.read().splitlines() if not line.startswith("-")]
-
-
-class XcodeExtension(Extension):
- def __init__(self,
- name: str,
- project_path: Union[str, os.PathLike],
- output_path: Union[str, os.PathLike],
- target_name: Optional[str] = None,
- configuration: str = "Release"):
- Extension.__init__(self, name, sources=[])
-
- self.name = name
- self.project_path = Path(project_path)
- self.project_root = self.project_path.parent
- self.output_path = Path(output_path)
- self.output_framework_path = (self.project_root
- .joinpath("build")
- .joinpath(configuration)
- .joinpath(f"{target_name}.framework"))
- self.target_name = self.name if target_name is None else target_name
- self.configuration = configuration
-
-
-class XcodeBuild(build_ext):
- def run(self):
- try:
- _ = subprocess.check_output(["xcodebuild", "-version"])
- except OSError:
- extension_list = ", ".join(e.name for e in self.extensions)
- raise RuntimeError(f"xcodebuild must be installed to build the following extensions: {extension_list}")
-
- for ext in self.extensions:
- self.build_extension(ext)
-
- def build_extension(self, ext: XcodeExtension):
- print(f"building extension {ext.target_name} in {ext.project_root}...")
-
- if not ext.project_path.exists():
- raise FileNotFoundError(f"There is not project at '{ext.project_path}'. "
- f"Did you initialize the git submodules?")
-
- command = [
- "xcodebuild",
- "-project", f"{ext.project_path.name}",
- "-target", f"{ext.target_name}",
- "-configuration", f"{ext.configuration}"
- ]
-
- subprocess.check_call(command, cwd=ext.project_root)
-
- # copy resulting framework into output folder
- os.makedirs(ext.output_path, exist_ok=True)
- result_name = ext.output_path.joinpath(ext.output_framework_path.name)
- shutil.rmtree(result_name, ignore_errors=True)
- shutil.copytree(str(ext.output_framework_path), result_name)
-
-
-class GenerateDoc(distutils.cmd.Command):
- description = "generate pdoc documentation"
-
- user_options = install.user_options + [
- ("output=", None, "Output path for the documentation."),
- ("launch", None, "Launch webserver to display documentation.")
- ]
-
- def initialize_options(self):
- install.initialize_options(self)
- self.output: str = "docs"
- self.launch: bool = False
-
- def finalize_options(self):
- pass
-
- def run(self) -> None:
- from scripts.generate_doc import generate_doc
- generate_doc(PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_URL, required_packages,
- Path(self.output), PACKAGE_DOC_MODULES, launch=bool(self.launch))
-
-
-def find_package_data(data_path: Union[str, os.PathLike], exclude_hidden: bool = True) -> List[str]:
- data_path = Path(data_path)
- files = list(data_path.rglob("*"))
-
- if exclude_hidden:
- files = [f for f in files if not f.name.startswith(".")]
-
- paths = [str(f.absolute()) for f in files if f.is_file()]
- return paths
-
-
-package_data = {PACKAGE_NAME: find_package_data(LIBS_PATH)}
-
-# read readme
-current_dir = Path(__file__).parent
-long_description = (current_dir / "README.md").read_text()
-
-setup(
- name=NAME,
- version=PACKAGE_VERSION,
- packages=required_packages,
- package_data=package_data,
- include_package_data=True,
- url=PACKAGE_URL,
- license="MIT License",
- author="Florian Bruggisser",
- author_email="github@broox.ch",
- description="Python wrapper for the GPU texture sharing framework Syphon.",
- long_description=long_description,
- long_description_content_type="text/markdown",
- install_requires=required,
- ext_modules=[
- XcodeExtension("Syphon-Framework",
- project_path="vendor/Syphon/Syphon.xcodeproj",
- output_path=LIBS_PATH,
- target_name="Syphon")
- ],
- cmdclass={
- "build_ext": XcodeBuild,
- "doc": GenerateDoc,
- },
- zip_safe=False,
-)
diff --git a/syphon/__init__.py b/syphon/__init__.py
index 08f3067..7b00363 100644
--- a/syphon/__init__.py
+++ b/syphon/__init__.py
@@ -25,6 +25,18 @@ def _load_lib_bundle(bundle_name: str, scan_classes: bool = False):
# initialize syphon bundle
_load_lib_bundle("Syphon")
-from syphon.server import BaseSyphonServer, SyphonMetalServer, SyphonOpenGLServer
-from syphon.server_directory import SyphonServerDirectory, SyphonServerNotification, SyphonServerDescription
-from syphon.client import BaseSyphonClient, SyphonMetalClient, SyphonOpenGLClient
\ No newline at end of file
+from syphon.client import (
+ BaseSyphonClient as BaseSyphonClient,
+ SyphonMetalClient as SyphonMetalClient,
+ SyphonOpenGLClient as SyphonOpenGLClient,
+)
+from syphon.server import (
+ BaseSyphonServer as BaseSyphonServer,
+ SyphonMetalServer as SyphonMetalServer,
+ SyphonOpenGLServer as SyphonOpenGLServer,
+)
+from syphon.server_directory import (
+ SyphonServerDescription as SyphonServerDescription,
+ SyphonServerDirectory as SyphonServerDirectory,
+ SyphonServerNotification as SyphonServerNotification,
+)
diff --git a/syphon/_native.py b/syphon/_native.py
new file mode 100644
index 0000000..4f76240
--- /dev/null
+++ b/syphon/_native.py
@@ -0,0 +1,59 @@
+"""Metadata and exported constants for the bundled Objective-C framework."""
+
+from pathlib import Path
+
+import objc
+from Foundation import NSBundle
+
+# NSOpenGLContext exposes an opaque pointer, not an Objective-C object. Register
+# its wrapper so callbacks/constructors do not create untyped PyObjCPointers.
+_CGLContextObj = objc.createOpaquePointerType("CGLContextObj", b"^{_CGLContextObject=}", "Opaque CGL context")
+
+_bundle = NSBundle.bundleWithPath_(str(Path(__file__).parent / "libs/Syphon.framework"))
+_options = {}
+objc.loadBundleVariables(
+ _bundle,
+ _options,
+ [
+ (name, b"@")
+ for name in (
+ "SyphonServerOptionIsPrivate",
+ "SyphonServerOptionAntialiasSampleCount",
+ "SyphonServerOptionDepthBufferResolution",
+ "SyphonServerOptionStencilBufferResolution",
+ )
+ ],
+ skip_undefined=False,
+)
+
+
+def cgl_context(pointer):
+ """Accept CGL pointers obtained before this module registered the opaque type."""
+ if isinstance(pointer, objc.ObjCPointer) and pointer.typestr.startswith(b"^{_CGLContextObject"):
+ return _CGLContextObj(c_void_p=pointer.pointerAsInteger)
+ return pointer
+
+
+def server_options(is_private=False, **options):
+ """Translate supported option names using the framework's actual NSString values."""
+ return {_options["SyphonServerOptionIsPrivate"]: bool(is_private), **{_options[k]: v for k, v in options.items()}}
+
+
+for _class, _selector in (
+ (b"SyphonMetalClient", b"initWithServerDescription:device:options:newFrameHandler:"),
+ (b"SyphonOpenGLClient", b"initWithServerDescription:context:options:newFrameHandler:"),
+):
+ objc.registerMetaDataForSelector(
+ _class,
+ _selector,
+ {
+ "arguments": {
+ 5: {
+ "callable": {
+ "retval": {"type": b"v"},
+ "arguments": {0: {"type": b"^v"}, 1: {"type": b"@"}},
+ }
+ }
+ }
+ },
+ )
diff --git a/syphon/client.py b/syphon/client.py
index 8c294f0..d55dfaa 100644
--- a/syphon/client.py
+++ b/syphon/client.py
@@ -1,204 +1,296 @@
-from abc import ABC, abstractmethod
-from typing import Optional, Any
+"""Syphon clients with native notifications and asyncio frame availability."""
+
+import asyncio
+import inspect
+import logging
+import math
+import threading
+import weakref
+from abc import ABC
+from typing import Any, Callable, Optional
import Metal
import objc
+from syphon import _native
from syphon.server_directory import SyphonServerDescription
from syphon.utils import opengl
+_logger = logging.getLogger(__name__)
+_native_callback = threading.local()
+_callback_condition = threading.Condition()
+_active_native_callbacks = {}
+
class BaseSyphonClient(ABC):
- """
- Abstract base class for Syphon clients.
+ """Common client API. Notifications signal availability, not a queue of every frame.
- Attributes:
- - description (SyphonServerDescription): The description of the Syphon server.
+ Handlers receive this Python client. Unless ``callback_loop`` is supplied, they run
+ on Syphon's background thread and must be short, synchronous, and avoid UI/OpenGL
+ work. Use ``stop()`` or a context manager for deterministic cleanup.
"""
- def __init__(self, description: SyphonServerDescription):
- """
- Initialize a BaseSyphonClient.
-
- Parameters:
- - description (SyphonServerDescription): The description of the Syphon server.
- """
- # todo: implement new frame handler callback support
+ def __init__(self, description, *, new_frame_handler=None, callback_loop=None):
+ if new_frame_handler is not None and (
+ not callable(new_frame_handler) or inspect.iscoroutinefunction(new_frame_handler)
+ ):
+ raise TypeError("new_frame_handler must be a synchronous callable")
+ if callback_loop is not None and callback_loop.is_closed():
+ raise ValueError("callback_loop must not be closed")
self._description = description
+ self._queue_key = getattr(description, "uuid", None)
+ self._state_lock = threading.Lock()
+ self._stopped = False
+ self._ready = False
+ self._handler = new_frame_handler
+ self._callback_loop = callback_loop
+ self._callback_scheduled = False
+ self._waiters = set()
+ self.context = None
+ reference = weakref.ref(self)
+ queue_key = self._queue_key
+
+ def native_handler(_native_client):
+ with _callback_condition:
+ _active_native_callbacks[queue_key] = _active_native_callbacks.get(queue_key, 0) + 1
+ previous = getattr(_native_callback, "active", False)
+ _native_callback.active = True
+ try:
+ client = reference()
+ if client is not None:
+ client._receive_frame()
+ except BaseException:
+ # Python exceptions must never unwind through an Objective-C block.
+ _logger.exception("Syphon frame notification failed")
+ finally:
+ _native_callback.active = previous
+ with _callback_condition:
+ _active_native_callbacks[queue_key] -= 1
+ if not _active_native_callbacks[queue_key]:
+ del _active_native_callbacks[queue_key]
+ _callback_condition.notify_all()
+
+ self._native_handler = native_handler
+
+ def _finish_initialization(self, context):
+ with self._state_lock:
+ self.context = context
+ self._ready = context is not None
+ self._stopped = context is None
+ if context is None:
+ raise RuntimeError("Syphon could not create the client")
@property
- @abstractmethod
def is_valid(self) -> bool:
- """
- Check if the Syphon client is valid.
-
- Returns:
- - bool: True if the client is valid, False otherwise.
- """
- pass
+ """Whether this client has a working connection and has not been stopped."""
+ with self._state_lock:
+ context = None if self._stopped else self.context
+ return context is not None and bool(context.isValid())
@property
- @abstractmethod
def has_new_frame(self) -> bool:
- """
- Check if the Syphon client has a new frame.
-
- Returns:
- - bool: True if there is a new frame, False otherwise.
- """
- pass
-
- @abstractmethod
- def stop(self):
- """
- Stop the Syphon client.
- """
- pass
-
-
-class SyphonMetalClient(BaseSyphonClient):
- """
- Syphon client for Metal-based rendering.
-
- Attributes:
- - description (SyphonServerDescription): The description of the Syphon server.
- - device (Any): The Metal device.
- - context (Any): The Syphon-Metal context.
- """
-
- def __init__(self, description: SyphonServerDescription, device: Optional[Any] = None):
- """
- Initialize a SyphonMetalClient.
-
- Parameters:
- - description (SyphonServerDescription): The description of the Syphon server.
- - device (Any, optional): The Metal device. If None, the default system device will be used.
- """
- super().__init__(description)
-
- self.device = device
-
- # setup device
- if self.device is None:
- self.device = Metal.MTLCreateSystemDefaultDevice()
-
- # setup syphon-metal context
- SyphonMetalClientObjC = objc.lookUpClass("SyphonMetalClient")
-
- self.context = (
- SyphonMetalClientObjC
- .alloc()
- .initWithServerDescription_device_options_newFrameHandler_(
- description.raw,
- self.device,
- None,
- None)
- )
+ """Whether a frame is available since the last ``new_frame_image`` access."""
+ with self._state_lock:
+ context = None if self._stopped else self.context
+ return context is not None and bool(context.hasNewFrame())
@property
- def is_valid(self) -> bool:
- """
- Check if the SyphonMetalClient is valid.
-
- Returns:
- - bool: True if the client is valid, False otherwise.
- """
- return self.context.isValid()
-
- @property
- def has_new_frame(self) -> bool:
- """
- Check if the SyphonMetalClient has a new frame.
+ def new_frame_image(self) -> Any:
+ """Fetch the latest native texture/image, or None. This consumes the new-frame flag.
- Returns:
- - bool: True if there is a new frame, False otherwise.
+ Keep the returned object alive during use; PyObjC manages its native ownership.
+ OpenGL access must happen with the appropriate context on the application's thread.
"""
- return self.context.hasNewFrame()
+ with self._state_lock:
+ context = None if self._stopped else self.context
+ return None if context is None else context.newFrameImage()
@property
- def new_frame_image(self) -> Any:
- """
- Get the new frame image.
-
- Returns:
- - Any: The new frame image.
+ def server_description(self) -> SyphonServerDescription:
+ """The native server description, including updates observed by Syphon."""
+ with self._state_lock:
+ if self._stopped or self.context is None:
+ return self._description
+ context = self.context
+ return SyphonServerDescription.from_native(context.serverDescription())
+
+ @staticmethod
+ def _resolve_waiter(future, error=None):
+ if not future.done():
+ if error is None:
+ future.set_result(None)
+ else:
+ future.set_exception(error)
+
+ def _notify_waiters(self, waiters, error=None):
+ for loop, future in waiters:
+ try:
+ loop.call_soon_threadsafe(self._resolve_waiter, future, error)
+ except RuntimeError:
+ # The application's event loop has already closed.
+ pass
+
+ def _receive_frame(self):
+ with self._state_lock:
+ if self._stopped or not self._ready:
+ return
+ waiters = tuple(self._waiters)
+ self._waiters.clear()
+ handler = self._handler
+ loop = self._callback_loop
+ schedule = handler is not None and (loop is None or not self._callback_scheduled)
+ if schedule and loop is not None:
+ self._callback_scheduled = True
+ self._notify_waiters(waiters)
+ if schedule:
+ if loop is None:
+ self._deliver_callback()
+ else:
+ try:
+ loop.call_soon_threadsafe(self._deliver_callback)
+ except RuntimeError:
+ with self._state_lock:
+ self._callback_scheduled = False
+ _logger.warning("Cannot deliver Syphon callback: callback_loop is closed")
+
+ def _deliver_callback(self):
+ with self._state_lock:
+ self._callback_scheduled = False
+ handler = None if self._stopped else self._handler
+ loop = self._callback_loop
+ if handler is None:
+ return
+ try:
+ result = handler(self)
+ if inspect.isawaitable(result):
+ if inspect.iscoroutine(result):
+ result.close()
+ raise TypeError("Frame handlers must be synchronous; schedule coroutine work on an asyncio loop")
+ except BaseException as error:
+ if loop is None:
+ _logger.exception("Syphon frame handler failed")
+ else:
+ loop.call_exception_handler(
+ {"message": "Syphon frame handler failed", "exception": error, "client": self}
+ )
+
+ async def wait_for_frame(self, timeout: Optional[float] = None) -> None:
+ """Wait for availability without fetching a frame; supports concurrent waiters.
+
+ Raises asyncio.TimeoutError on timeout, ConnectionError on disconnect, and
+ RuntimeError on stop. Cancellation only removes the cancelling waiter's registration.
+ Notifications may coalesce, and another consumer may fetch the frame first.
"""
- return self.context.newFrameImage()
+ if timeout is not None and (not math.isfinite(timeout) or timeout < 0):
+ raise ValueError("timeout must be a finite nonnegative number or None")
+ loop = asyncio.get_running_loop()
+ future = loop.create_future()
+ waiter = (loop, future)
+ deadline = None if timeout is None else loop.time() + timeout
+ with self._state_lock:
+ if self._stopped:
+ raise RuntimeError("Syphon client is stopped")
+ # Register before checking the native flag to avoid lost wakeups.
+ self._waiters.add(waiter)
+ try:
+ while True:
+ with self._state_lock:
+ if self._stopped:
+ raise RuntimeError("Syphon client is stopped")
+ if not self.is_valid:
+ raise ConnectionError("Syphon server disconnected")
+ if self.has_new_frame:
+ return
+ if future.done():
+ return future.result()
+ remaining = None if deadline is None else deadline - loop.time()
+ if remaining is not None and remaining <= 0:
+ raise asyncio.TimeoutError()
+ # Syphon has no disconnect block; check validity only during active waits.
+ await asyncio.wait({future}, timeout=0.1 if remaining is None else min(0.1, remaining))
+ finally:
+ with self._state_lock:
+ self._waiters.discard(waiter)
+ if future.done() and not future.cancelled():
+ future.exception() # Retrieve shutdown errors even if another check raised first.
+ else:
+ future.cancel()
def stop(self):
- """
- Stop the SyphonMetalClient.
- """
- self.context.stop()
+ """Stop once and wake pending waits. Never call from a native frame callback."""
+ if getattr(_native_callback, "active", False):
+ raise RuntimeError(
+ "Cannot stop a client from a native frame callback; use the application thread or asyncio"
+ )
+ with self._state_lock:
+ if self._stopped:
+ return
+ self._stopped = True
+ self._handler = None
+ waiters = tuple(self._waiters)
+ self._waiters.clear()
+ context = self.context
+ self._notify_waiters(waiters, RuntimeError("Syphon client is stopped"))
+ # Native stop holds its own lock while synchronously draining the frame queue.
+ # An in-flight callback (including a peer's callback on that queue) might be
+ # reading this client's native properties. Drain Python callbacks first to
+ # avoid a native lock/queue inversion. New callbacks see the stopped flag.
+ with _callback_condition:
+ _callback_condition.wait_for(lambda: _active_native_callbacks.get(self._queue_key, 0) == 0)
+ # Never hold a Python state lock across native shutdown.
+ if context is not None:
+ context.stop()
+
+ def __enter__(self):
+ with self._state_lock:
+ if self._stopped:
+ raise RuntimeError("Syphon client is stopped")
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.stop()
-class SyphonOpenGLClient(BaseSyphonClient):
- """
- Syphon client for OpenGL-based rendering.
-
- Attributes:
- - description (SyphonServerDescription): The description of the Syphon server.
- - cgl_context_obj (Any): The CGL context object.
- - context (Any): The Syphon-OpenGL context.
- """
-
- def __init__(self, description: SyphonServerDescription, cgl_context_obj: Optional[Any] = None):
- """
- Initialize a SyphonOpenGLClient.
+class SyphonMetalClient(BaseSyphonClient):
+ """Receive Metal textures; optional callbacks follow ``BaseSyphonClient`` threading rules."""
+
+ def __init__(
+ self,
+ description: SyphonServerDescription,
+ device: Optional[Any] = None,
+ *,
+ new_frame_handler: Optional[Callable[[BaseSyphonClient], None]] = None,
+ callback_loop: Optional[asyncio.AbstractEventLoop] = None,
+ ):
+ super().__init__(description, new_frame_handler=new_frame_handler, callback_loop=callback_loop)
+ self.device = device if device is not None else Metal.MTLCreateSystemDefaultDevice()
+ if self.device is None:
+ raise RuntimeError("No Metal device is available")
+ native = objc.lookUpClass("SyphonMetalClient")
+ self._finish_initialization(
+ native.alloc().initWithServerDescription_device_options_newFrameHandler_(
+ description.raw, self.device, None, self._native_handler
+ )
+ )
- Parameters:
- - description (SyphonServerDescription): The description of the Syphon server.
- - cgl_context_obj (Any, optional): The CGL context object. If None, the current context will be used.
- """
- super().__init__(description)
- # store CGL context object
+class SyphonOpenGLClient(BaseSyphonClient):
+ """Receive OpenGL images. The caller must ensure exclusive access to the CGL context."""
+
+ def __init__(
+ self,
+ description: SyphonServerDescription,
+ cgl_context_obj: Optional[Any] = None,
+ *,
+ new_frame_handler: Optional[Callable[[BaseSyphonClient], None]] = None,
+ callback_loop: Optional[asyncio.AbstractEventLoop] = None,
+ ):
+ super().__init__(description, new_frame_handler=new_frame_handler, callback_loop=callback_loop)
+ opengl._require_pyopengl()
self.cgl_context_obj = opengl.get_current_cgl_context_obj() if cgl_context_obj is None else cgl_context_obj
-
- # create syphon gl client
- SyphonOpenGLClientObjC = objc.lookUpClass("SyphonOpenGLClient")
- self.context = (
- SyphonOpenGLClientObjC
- .alloc()
- .initWithServerDescription_context_options_newFrameHandler_(
- description.raw,
- self.cgl_context_obj,
- None,
- None)
+ native = objc.lookUpClass("SyphonOpenGLClient")
+ self._finish_initialization(
+ native.alloc().initWithServerDescription_context_options_newFrameHandler_(
+ description.raw, _native.cgl_context(self.cgl_context_obj), None, self._native_handler
+ )
)
-
- @property
- def is_valid(self) -> bool:
- """
- Check if the SyphonOpenGLClient is valid.
-
- Returns:
- - bool: True if the client is valid, False otherwise.
- """
- return self.context.isValid()
-
- @property
- def has_new_frame(self) -> bool:
- """
- Check if the SyphonOpenGLClient has a new frame.
-
- Returns:
- - bool: True if there is a new frame, False otherwise.
- """
- return self.context.hasNewFrame()
-
- @property
- def new_frame_image(self) -> Any:
- """
- Get the new frame image.
-
- Returns:
- - Any: The new frame image.
- """
- return self.context.newFrameImage()
-
- def stop(self):
- """
- Stop the SyphonOpenGLClient.
- """
- self.context.stop()
diff --git a/syphon/server.py b/syphon/server.py
index e78cbe2..7e8a345 100644
--- a/syphon/server.py
+++ b/syphon/server.py
@@ -1,12 +1,14 @@
+import threading
from abc import ABC, abstractmethod
-from typing import Tuple, Optional, Any
+from typing import Any, Optional, Tuple
import Cocoa
import Metal
import objc
-from OpenGL.GL import *
-from syphon.types import Texture, Region, Size
+from syphon._native import cgl_context, server_options
+from syphon.server_directory import SyphonServerDescription
+from syphon.types import Region, Size, Texture
from syphon.utils import opengl
@@ -25,14 +27,54 @@ def __init__(self, name: str):
Parameters:
- name (str): The name of the Syphon server.
"""
- self.name = name
+ self._name = name
+ self._lifecycle_lock = threading.RLock()
+ self._stopped = False
+ self._bound_thread = None
+ self.context = None
+
+ def _finish_initialization(self, context):
+ if context is None:
+ self._stopped = True
+ raise RuntimeError("Syphon could not create the server")
+ self.context = context
+
+ @property
+ def name(self) -> str:
+ """The live native name; assignment updates discovery in other applications."""
+ return self._name if self.context is None else self.context.name()
+
+ @name.setter
+ def name(self, value: str):
+ with self._lifecycle_lock:
+ if self._stopped:
+ raise RuntimeError("Syphon server is stopped")
+ self.context.setName_(value)
+
+ @property
+ def server_description(self) -> SyphonServerDescription:
+ """Complete native connection metadata, also usable for private servers."""
+ return SyphonServerDescription.from_native(self.context.serverDescription())
+
+ @property
+ def new_frame_image(self) -> Any:
+ """Current server output, or None; keep it alive while in use. PyObjC owns releases."""
+ with self._lifecycle_lock:
+ return None if self._stopped else self.context.newFrameImage()
+
+ def __enter__(self):
+ with self._lifecycle_lock:
+ if self._stopped:
+ raise RuntimeError("Syphon server is stopped")
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.stop()
@abstractmethod
- def publish_frame_texture(self,
- texture: Texture,
- region: Optional[Region] = None,
- size: Optional[Size] = None,
- is_flipped: bool = False):
+ def publish_frame_texture(
+ self, texture: Texture, region: Optional[Region] = None, size: Optional[Size] = None, is_flipped: bool = False
+ ):
"""
Publish a frame with the given texture.
@@ -51,12 +93,17 @@ def publish(self):
"""
pass
- @abstractmethod
def stop(self):
- """
- Stop the Syphon server.
- """
- pass
+ """Stop once. An OpenGL framebuffer must be unbound first."""
+ with self._lifecycle_lock:
+ if self._stopped:
+ return
+ if self._bound_thread is not None:
+ raise RuntimeError("Unbind and publish the OpenGL framebuffer before stopping")
+ self._stopped = True
+ context = self.context
+ if context is not None:
+ context.stop()
@property
@abstractmethod
@@ -82,10 +129,9 @@ def _get_texture_size(self, texture: Texture) -> Size:
"""
pass
- def _prepare_region_and_size(self,
- texture: Texture,
- region: Optional[Region] = None,
- size: Optional[Size] = None) -> Tuple[Region, Size]:
+ def _prepare_region_and_size(
+ self, texture: Texture, region: Optional[Region] = None, size: Optional[Size] = None
+ ) -> Tuple[Region, Size]:
"""
Prepare the region and size for publishing.
@@ -114,10 +160,9 @@ class SyphonMetalServer(BaseSyphonServer):
- context (Any): The Syphon-Metal context.
"""
- def __init__(self,
- name: str,
- device: Optional[Any] = None,
- command_queue: Optional[Any] = None):
+ def __init__(
+ self, name: str, device: Optional[Any] = None, command_queue: Optional[Any] = None, *, is_private: bool = False
+ ):
"""
Initialize a SyphonMetalServer.
@@ -125,6 +170,7 @@ def __init__(self,
- name (str): The name of the Syphon server.
- device (Any, optional): The Metal device. If None, the default system device will be used.
- command_queue (Any, optional): The Metal command queue. If None, a new command queue will be created.
+ - is_private (bool): Hide the server from discovery; connect using server_description instead.
"""
super().__init__(name)
@@ -135,21 +181,31 @@ def __init__(self,
if self.device is None:
self.device = Metal.MTLCreateSystemDefaultDevice()
+ if self.device is None:
+ raise RuntimeError("No Metal device is available")
+
# setup command queue
if self.command_queue is None:
self.command_queue = self.device.newCommandQueue()
+ if self.command_queue is None:
+ raise RuntimeError("Could not create a Metal command queue")
+
# setup syphon-metal context
SyphonMetalServerObjC = objc.lookUpClass("SyphonMetalServer")
- self.context = SyphonMetalServerObjC.alloc().initWithName_device_options_(name, self.device, None)
-
- def publish_frame_texture(self,
- texture: Texture,
- region: Optional[Region] = None,
- size: Optional[Size] = None,
- is_flipped: bool = False,
- command_buffer: Optional[Any] = None,
- auto_commit: bool = True):
+ self._finish_initialization(
+ SyphonMetalServerObjC.alloc().initWithName_device_options_(name, self.device, server_options(is_private))
+ )
+
+ def publish_frame_texture(
+ self,
+ texture: Texture,
+ region: Optional[Region] = None,
+ size: Optional[Size] = None,
+ is_flipped: bool = False,
+ command_buffer: Optional[Any] = None,
+ auto_commit: bool = True,
+ ):
"""
Publish a frame with the given Metal texture.
@@ -170,10 +226,9 @@ def publish_frame_texture(self,
command_buffer = self.command_queue.commandBuffer()
# publish actual texture
- self.context.publishFrameTexture_onCommandBuffer_imageRegion_flipped_(texture,
- command_buffer,
- ns_region,
- is_flipped)
+ self.context.publishFrameTexture_onCommandBuffer_imageRegion_flipped_(
+ texture, command_buffer, ns_region, is_flipped
+ )
# commit command buffer
if auto_commit:
command_buffer.commitAndWaitUntilSubmitted()
@@ -184,12 +239,6 @@ def publish(self):
"""
self.context.publish()
- def stop(self):
- """
- Stop the SyphonMetalServer.
- """
- self.context.stop()
-
@property
def has_clients(self) -> bool:
"""
@@ -223,47 +272,114 @@ class SyphonOpenGLServer(BaseSyphonServer):
- context (Any): The Syphon-OpenGL context.
"""
- def __init__(self, name: str, cgl_context_obj: Optional[Any] = None):
+ def __init__(
+ self,
+ name: str,
+ cgl_context_obj: Optional[Any] = None,
+ *,
+ is_private: bool = False,
+ antialias_sample_count: int = 0,
+ depth_buffer_resolution: int = 0,
+ stencil_buffer_resolution: int = 0,
+ ):
"""
Initialize a SyphonOpenGLServer.
Parameters:
- name (str): The name of the Syphon server.
- cgl_context_obj (Any, optional): The CGL context object. If None, the current context will be used.
+ - is_private (bool): Hide the server from discovery; this is not access control.
+ - antialias_sample_count (int): Requested multisample count, or zero to disable it.
+ - depth_buffer_resolution (int): Requested depth bits: 0, 16, 24, or 32.
+ - stencil_buffer_resolution (int): Requested stencil bits: 0, 1, 4, 8, or 16.
+
+ Framebuffer options apply to bind_to_draw_frame/unbind_and_publish. The native
+ driver may choose the nearest supported buffer configuration.
"""
super().__init__(name)
+ opengl._require_pyopengl()
+
+ for label, value, allowed in (
+ ("antialias_sample_count", antialias_sample_count, None),
+ ("depth_buffer_resolution", depth_buffer_resolution, (0, 16, 24, 32)),
+ ("stencil_buffer_resolution", stencil_buffer_resolution, (0, 1, 4, 8, 16)),
+ ):
+ if isinstance(value, bool) or not isinstance(value, int) or value < 0 or (allowed and value not in allowed):
+ raise ValueError(f"Invalid {label}: {value}")
+
# store CGL context object
self.cgl_context_obj = opengl.get_current_cgl_context_obj() if cgl_context_obj is None else cgl_context_obj
# create syphon gl server
SyphonOpenGLServerObjC = objc.lookUpClass("SyphonOpenGLServer")
- self.context = SyphonOpenGLServerObjC.alloc().initWithName_context_options_(name, self.cgl_context_obj, None)
-
- def publish_frame_texture(self,
- texture: GLint,
- region: Optional[Region] = None,
- size: Optional[Size] = None,
- is_flipped: bool = False,
- target: GLenum = GL_TEXTURE_2D):
+ self._finish_initialization(
+ SyphonOpenGLServerObjC.alloc().initWithName_context_options_(
+ name,
+ cgl_context(self.cgl_context_obj),
+ server_options(
+ is_private,
+ SyphonServerOptionAntialiasSampleCount=antialias_sample_count,
+ SyphonServerOptionDepthBufferResolution=depth_buffer_resolution,
+ SyphonServerOptionStencilBufferResolution=stencil_buffer_resolution,
+ ),
+ )
+ )
+
+ def bind_to_draw_frame(self, size: Size) -> bool:
+ """Bind Syphon's framebuffer. Pair a successful bind with unbind_and_publish().
+
+ Drawing, unbinding, and native context access require exclusive use of the CGL
+ context by the calling thread. A failed bind must not be followed by unbinding.
+ """
+ if len(size) != 2 or any(isinstance(v, bool) or not isinstance(v, int) or v <= 0 for v in size):
+ raise ValueError("Frame size must contain two positive integers")
+ with self._lifecycle_lock:
+ if self._stopped:
+ raise RuntimeError("Syphon server is stopped")
+ if self._bound_thread is not None:
+ raise RuntimeError("Syphon framebuffer is already bound")
+ success = bool(self.context.bindToDrawFrameOfSize_(Cocoa.NSSize(*size)))
+ if success:
+ self._bound_thread = threading.current_thread()
+ return success
+
+ def unbind_and_publish(self):
+ """Publish and unbind on the same thread that successfully bound the framebuffer."""
+ with self._lifecycle_lock:
+ if self._bound_thread is None:
+ raise RuntimeError("No Syphon framebuffer is bound")
+ if self._bound_thread is not threading.current_thread():
+ raise RuntimeError("Unbind on the thread that bound the Syphon framebuffer")
+ self.context.unbindAndPublish()
+ self._bound_thread = None
+
+ def publish_frame_texture(
+ self,
+ texture: int,
+ region: Optional[Region] = None,
+ size: Optional[Size] = None,
+ is_flipped: bool = False,
+ target: int = opengl.GL_TEXTURE_2D,
+ ):
"""
Publish a frame with the given OpenGL texture.
Parameters:
- - texture (GLint): The OpenGL texture to publish.
+ - texture (int): The OpenGL texture identifier to publish.
- region (Region, optional): The region of the texture to publish. Defaults to None.
- size (Size, optional): The size of the texture. Defaults to None.
- is_flipped (bool, optional): If True, the frame is flipped. Defaults to False.
- - target (GLenum, optional): The OpenGL texture target. Defaults to GL_TEXTURE_2D.
+ - target (int, optional): The OpenGL texture target. Defaults to GL_TEXTURE_2D.
"""
# create ns-region
region, size = self._prepare_region_and_size(texture, region, size)
ns_region = Cocoa.NSRect((region[0], region[1]), (region[2], region[3]))
ns_size = Cocoa.NSSize(size[0], size[1])
- self.context.publishFrameTexture_textureTarget_imageRegion_textureDimensions_flipped_(texture, target,
- ns_region,
- ns_size, is_flipped)
+ self.context.publishFrameTexture_textureTarget_imageRegion_textureDimensions_flipped_(
+ texture, target, ns_region, ns_size, is_flipped
+ )
def publish(self):
"""
@@ -271,12 +387,6 @@ def publish(self):
"""
self.context.publish()
- def stop(self):
- """
- Stop the SyphonOpenGLServer.
- """
- self.context.stop()
-
@property
def has_clients(self) -> bool:
"""
@@ -297,14 +407,15 @@ def _get_texture_size(self, texture: Texture) -> Size:
Returns:
- Size: The size of the texture.
"""
- glBindTexture(GL_TEXTURE_2D, texture)
+ gl = opengl._require_pyopengl()
+ gl.glBindTexture(gl.GL_TEXTURE_2D, texture)
- width = GLint()
- height = GLint()
+ width = gl.GLint()
+ height = gl.GLint()
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, width)
- glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, height)
+ gl.glGetTexLevelParameteriv(gl.GL_TEXTURE_2D, 0, gl.GL_TEXTURE_WIDTH, width)
+ gl.glGetTexLevelParameteriv(gl.GL_TEXTURE_2D, 0, gl.GL_TEXTURE_HEIGHT, height)
- glBindTexture(GL_TEXTURE_2D, 0)
+ gl.glBindTexture(gl.GL_TEXTURE_2D, 0)
return int(width.value), int(height.value)
diff --git a/syphon/server_directory.py b/syphon/server_directory.py
index 64a2f8a..423c55d 100644
--- a/syphon/server_directory.py
+++ b/syphon/server_directory.py
@@ -1,9 +1,10 @@
+import threading
from dataclasses import dataclass
from enum import Enum
-from typing import Callable, Any, List, Optional
+from typing import Any, Callable, List, Optional
import objc
-from Cocoa import NSRunLoop, NSDefaultRunLoopMode, NSDate, NSImage
+from Cocoa import NSDate, NSDefaultRunLoopMode, NSImage, NSRunLoop
class SyphonServerNotification(Enum):
@@ -15,6 +16,7 @@ class SyphonServerNotification(Enum):
- Update: An existing SyphonServer instance has changed its description.
- Retire: A SyphonServer instance will no longer be available.
"""
+
Announce = "SyphonServerAnnounceNotification"
Update = "SyphonServerUpdateNotification"
Retire = "SyphonServerRetireNotification"
@@ -32,12 +34,24 @@ class SyphonServerDescription:
- icon (NSImage): The icon image of the Syphon server.
- raw (Any): The raw server information.
"""
+
uuid: str
name: str
app_name: str
- icon: NSImage
+ icon: Optional[NSImage]
raw: Any
+ @classmethod
+ def from_native(cls, raw):
+ """Wrap a complete native description without requiring optional display metadata."""
+ return cls(
+ uuid=str(raw.get("SyphonServerDescriptionUUIDKey") or ""),
+ name=str(raw.get("SyphonServerDescriptionNameKey") or ""),
+ app_name=str(raw.get("SyphonServerDescriptionAppNameKey") or ""),
+ icon=raw.get("SyphonServerDescriptionIconKey"),
+ raw=raw,
+ )
+
class SyphonServerDirectory:
"""
@@ -55,6 +69,9 @@ def __init__(self):
self._notification_center = objc.lookUpClass("NSNotificationCenter").defaultCenter()
self.run_loop_interval: float = 1.0
+ self._observer_lock = threading.RLock()
+ self._observers = []
+ self._closed = False
def add_observer(self, notification: SyphonServerNotification, handler: Callable[[Any], None]):
"""
@@ -63,13 +80,46 @@ def add_observer(self, notification: SyphonServerNotification, handler: Callable
Parameters:
- notification (SyphonServerNotification): The notification to observe.
- handler (Callable[[Any], None]): The handler function to be called when the notification is received.
+
+ Returns the native observer token. Pass it to remove_observer(), or close this
+ directory to remove all tokens it owns. Callback threading follows NSNotificationCenter.
"""
- self._notification_center.addObserverForName_object_queue_usingBlock_(
- notification.value,
- None,
- None,
- handler
- )
+ with self._observer_lock:
+ if self._closed:
+ raise RuntimeError("Syphon server directory is closed")
+ token = self._notification_center.addObserverForName_object_queue_usingBlock_(
+ notification.value, None, None, handler
+ )
+ self._observers.append(token)
+ return token
+
+ def remove_observer(self, token):
+ """Remove a token returned by this directory; unknown/removed tokens are ignored."""
+ with self._observer_lock:
+ for index, owned in enumerate(self._observers):
+ if owned is token:
+ self._observers.pop(index)
+ break
+ else:
+ return
+ self._notification_center.removeObserver_(token)
+
+ def close(self):
+ """Remove this wrapper's observers once, without stopping the shared native directory."""
+ with self._observer_lock:
+ self._closed = True
+ tokens, self._observers = self._observers, []
+ for token in tokens:
+ self._notification_center.removeObserver_(token)
+
+ def __enter__(self):
+ with self._observer_lock:
+ if self._closed:
+ raise RuntimeError("Syphon server directory is closed")
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.close()
@property
def servers(self) -> List[SyphonServerDescription]:
@@ -83,29 +133,19 @@ def servers(self) -> List[SyphonServerDescription]:
directory = self._syphonServerDirectoryObjC.sharedDirectory()
servers = directory.servers()
- return [
- SyphonServerDescription(
- str(s["SyphonServerDescriptionUUIDKey"]),
- str(s["SyphonServerDescriptionNameKey"]),
- str(s["SyphonServerDescriptionAppNameKey"]),
- s["SyphonServerDescriptionIconKey"],
- s
- )
- for s in servers
- ]
+ return [SyphonServerDescription.from_native(raw) for raw in servers]
def update_run_loop(self):
"""
Update the run loop to process events.
"""
NSRunLoop.currentRunLoop().runMode_beforeDate_(
- NSDefaultRunLoopMode,
- NSDate.dateWithTimeIntervalSinceNow_(self.run_loop_interval)
+ NSDefaultRunLoopMode, NSDate.dateWithTimeIntervalSinceNow_(self.run_loop_interval)
)
- def servers_matching_name(self,
- name: Optional[str] = None,
- app_name: Optional[str] = None) -> List[SyphonServerDescription]:
+ def servers_matching_name(
+ self, name: Optional[str] = None, app_name: Optional[str] = None
+ ) -> List[SyphonServerDescription]:
"""
Get a list of Syphon servers that match the specified name or application name.
diff --git a/syphon/utils/numpy.py b/syphon/utils/numpy.py
index e95a065..b1e8a60 100644
--- a/syphon/utils/numpy.py
+++ b/syphon/utils/numpy.py
@@ -2,7 +2,7 @@
import numpy as np
-from syphon.utils.raw import copy_mtl_texture_to_bytes, copy_bytes_to_mtl_texture
+from syphon.utils.raw import copy_bytes_to_mtl_texture, copy_mtl_texture_to_bytes
def copy_image_to_mtl_texture(image: np.ndarray, texture: Any):
@@ -32,7 +32,7 @@ def copy_mtl_texture_to_image(texture: Any) -> np.ndarray:
Returns:
- np.ndarray: The resulting image as a NumPy array of shape (height, width, 4).
-
+
Note:
- todo: Add support for buffer re-use.
"""
diff --git a/syphon/utils/opengl.py b/syphon/utils/opengl.py
index cf69ca1..9b61ed6 100644
--- a/syphon/utils/opengl.py
+++ b/syphon/utils/opengl.py
@@ -1,8 +1,23 @@
+from importlib import import_module
from typing import Any
import AppKit
-from syphon.utils.exceptions import NSOpenGLContextNotFoundException, CGLContextNotFoundException
+from syphon.utils.exceptions import CGLContextNotFoundException, NSOpenGLContextNotFoundException
+
+# Keep the public texture-target default available without importing PyOpenGL.
+GL_TEXTURE_2D = 0x0DE1
+
+
+def _require_pyopengl():
+ try:
+ return import_module("OpenGL.GL")
+ except ModuleNotFoundError as exc:
+ if exc.name not in {"OpenGL", "OpenGL.GL"}:
+ raise
+ raise ImportError(
+ "OpenGL support requires PyOpenGL. Install it with: pip install 'syphon-python[opengl]'"
+ ) from exc
def get_current_cgl_context_obj() -> Any:
diff --git a/syphon/utils/raw.py b/syphon/utils/raw.py
index 244a0a7..d2a17bf 100644
--- a/syphon/utils/raw.py
+++ b/syphon/utils/raw.py
@@ -4,10 +4,7 @@
import Metal
-def create_mtl_texture(device: Any,
- width: int,
- height: int,
- pixel_format: int = Metal.MTLPixelFormatRGBA8Unorm) -> Any:
+def create_mtl_texture(device: Any, width: int, height: int, pixel_format: int = Metal.MTLPixelFormatRGBA8Unorm) -> Any:
"""
Create a Metal texture with the specified parameters.
@@ -42,7 +39,7 @@ def copy_bytes_to_mtl_texture(data: bytes, texture: Any):
region,
0, # mipmapLevel
data,
- bytes_per_row
+ bytes_per_row,
)
@@ -61,8 +58,10 @@ def copy_mtl_texture_to_bytes(texture: Any, buffer: Optional[Any] = None) -> byt
- Exception: If the pixel format of the texture is not MTLPixelFormatBGRA8Unorm or MTLPixelFormatRGBA8Unorm.
- Exception: If the provided buffer is not big enough.
"""
- if (texture.pixelFormat() != Metal.MTLPixelFormatBGRA8Unorm
- and texture.pixelFormat() != Metal.MTLPixelFormatRGBA8Unorm):
+ if (
+ texture.pixelFormat() != Metal.MTLPixelFormatBGRA8Unorm
+ and texture.pixelFormat() != Metal.MTLPixelFormatRGBA8Unorm
+ ):
raise Exception("Not correct pixel format (expected MTLPixelFormatBGRA8Unorm or MTLPixelFormatRGBA8Unorm)")
bytes_per_row = texture.width() * 4
@@ -77,12 +76,9 @@ def copy_mtl_texture_to_bytes(texture: Any, buffer: Optional[Any] = None) -> byt
if len(buffer) != bytes_per_image:
raise Exception(f"Buffer is not big enough (expected: {bytes_per_image}, actual: {len(buffer)})")
- texture.getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_slice_(buffer,
- bytes_per_row,
- bytes_per_image,
- region,
- mipmap_level,
- slice_number)
+ texture.getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_slice_(
+ buffer, bytes_per_row, bytes_per_image, region, mipmap_level, slice_number
+ )
raw_bytes = bytes(buffer.raw)
return raw_bytes
diff --git a/tests/test_build.py b/tests/test_build.py
new file mode 100644
index 0000000..03d0321
--- /dev/null
+++ b/tests/test_build.py
@@ -0,0 +1,121 @@
+"""Regression checks for native wheel compatibility and build diagnostics."""
+
+import importlib.util
+from pathlib import Path
+
+import pytest
+
+spec = importlib.util.spec_from_file_location("hatch_build", Path(__file__).resolve().parents[1] / "hatch_build.py")
+build = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(build)
+
+
+@pytest.fixture
+def framework(tmp_path):
+ bundle = tmp_path / "Syphon.framework"
+ (bundle / "Resources").mkdir(parents=True)
+ (bundle / "Syphon").touch()
+ (bundle / "Resources" / "Info.plist").touch()
+ return bundle
+
+
+def mock_binary_tools(
+ monkeypatch, architectures="arm64 x86_64", minimum="12.0", dependency="@rpath/Syphon.framework/Syphon"
+):
+ def output(command, **kwargs):
+ if command[0] == "lipo":
+ return architectures
+ if "-l" in command:
+ return (
+ f"Load command 0\n cmd LC_BUILD_VERSION\n minos {minimum}\n sdk 27.0\n"
+ " tool LD\n version 27037.1\n"
+ "Load command 1\n cmd LC_SOURCE_VERSION\n version 27037.1\n"
+ )
+ return f"Syphon:\n\t{dependency} (compatibility version 1.0.0, current version 1.0.0)\n"
+
+ monkeypatch.setattr(build.subprocess, "check_output", output)
+
+
+def test_universal_framework(framework, monkeypatch):
+ mock_binary_tools(monkeypatch)
+ build.validate_framework(framework)
+
+
+@pytest.mark.parametrize(
+ "options, message",
+ [
+ ({"architectures": "arm64"}, "Expected universal2"),
+ ({"minimum": "14.0"}, "deployment target"),
+ ({"dependency": "/Users/builder/Syphon.framework/Syphon"}, "non-portable"),
+ ],
+)
+def test_reject_incompatible_framework(framework, monkeypatch, options, message):
+ mock_binary_tools(monkeypatch, **options)
+ with pytest.raises(RuntimeError, match=message):
+ build.validate_framework(framework)
+
+
+def test_missing_framework(tmp_path):
+ with pytest.raises(RuntimeError, match="did not produce"):
+ build.validate_framework(tmp_path)
+
+
+def test_missing_submodule(tmp_path, monkeypatch):
+ monkeypatch.setattr(build.sys, "platform", "darwin")
+ with pytest.raises(RuntimeError, match="git submodule update"):
+ build.build_framework(tmp_path)
+
+
+def test_unsupported_platform(tmp_path, monkeypatch):
+ monkeypatch.setattr(build.sys, "platform", "linux")
+ with pytest.raises(RuntimeError, match="requires macOS"):
+ build.build_framework(tmp_path)
+
+
+def test_missing_metal_toolchain(tmp_path, monkeypatch):
+ monkeypatch.setattr(build.sys, "platform", "darwin")
+ monkeypatch.setattr(build, "xcode_environment", lambda: {"DEVELOPER_DIR": "/custom/Xcode"})
+ project = tmp_path / "vendor" / "Syphon" / "Syphon.xcodeproj"
+ project.mkdir(parents=True)
+ (project / "project.pbxproj").touch()
+
+ def run(command, **kwargs):
+ if command[0] == "xcrun":
+ raise build.subprocess.CalledProcessError(1, command)
+
+ monkeypatch.setattr(build.subprocess, "run", run)
+ with pytest.raises(RuntimeError, match="downloadComponent MetalToolchain"):
+ build.build_framework(tmp_path)
+
+
+def test_explicit_xcode_is_respected(monkeypatch):
+ monkeypatch.setenv("DEVELOPER_DIR", "/custom/Xcode.app/Contents/Developer")
+ monkeypatch.setattr(
+ build.subprocess, "check_output", lambda *a, **kw: pytest.fail("Must respect explicit selection")
+ )
+ assert build.xcode_environment()["DEVELOPER_DIR"] == "/custom/Xcode.app/Contents/Developer"
+
+
+@pytest.mark.parametrize("selected_xcode", [True, False])
+def test_xcode_selection(tmp_path, monkeypatch, selected_xcode):
+ monkeypatch.delenv("DEVELOPER_DIR", raising=False)
+ selected = tmp_path / "selected"
+ fallback = tmp_path / "Xcode.app/Contents/Developer"
+ (fallback / "usr/bin").mkdir(parents=True)
+ (fallback / "usr/bin/xcodebuild").touch()
+ if selected_xcode:
+ (selected / "usr/bin").mkdir(parents=True)
+ (selected / "usr/bin/xcodebuild").touch()
+ monkeypatch.setattr(build, "DEFAULT_XCODE", fallback)
+ monkeypatch.setattr(build.subprocess, "check_output", lambda *a, **kw: str(selected))
+ expected = selected if selected_xcode else fallback
+ assert build.xcode_environment()["DEVELOPER_DIR"] == str(expected)
+ assert "DEVELOPER_DIR" not in build.os.environ
+
+
+def test_xcode_not_installed(tmp_path, monkeypatch):
+ monkeypatch.delenv("DEVELOPER_DIR", raising=False)
+ monkeypatch.setattr(build, "DEFAULT_XCODE", tmp_path / "missing")
+ monkeypatch.setattr(build.subprocess, "check_output", lambda *a, **kw: str(tmp_path / "CommandLineTools"))
+ with pytest.raises(RuntimeError, match="Install Xcode"):
+ build.xcode_environment()
diff --git a/tests/test_client_events.py b/tests/test_client_events.py
new file mode 100644
index 0000000..f62b0e0
--- /dev/null
+++ b/tests/test_client_events.py
@@ -0,0 +1,279 @@
+"""Threading, lifecycle and asyncio behavior without a native peer."""
+
+import asyncio
+import gc
+import threading
+import weakref
+from unittest.mock import Mock
+
+import pytest
+
+from syphon.client import BaseSyphonClient, SyphonMetalClient, SyphonOpenGLClient
+from syphon.server_directory import SyphonServerDescription
+
+
+def make_client(handler=None, loop=None):
+ client = BaseSyphonClient(None, new_frame_handler=handler, callback_loop=loop)
+ native = Mock()
+ native.isValid.return_value = True
+ native.hasNewFrame.return_value = False
+ client._finish_initialization(native)
+ return client
+
+
+def test_callback_receives_wrapper_and_ignores_initialization_and_stop():
+ handler = Mock()
+ client = BaseSyphonClient(None, new_frame_handler=handler)
+ client._native_handler(None)
+ handler.assert_not_called()
+ client._finish_initialization(Mock())
+ client._native_handler(client.context)
+ handler.assert_called_once_with(client)
+ client.stop()
+ client._native_handler(None)
+ assert handler.call_count == 1
+ client.stop()
+ client.context.stop.assert_called_once()
+
+
+def test_native_callback_cannot_stop_any_client(caplog):
+ peer = make_client()
+ client = make_client(lambda _: peer.stop())
+ client._native_handler(None)
+ assert "Cannot stop a client from a native frame callback" in caplog.text
+ peer.context.stop.assert_not_called()
+ assert peer.is_valid
+ peer.stop()
+
+
+def test_callback_exceptions_never_escape_native_block(caplog):
+ client = make_client(Mock(side_effect=KeyboardInterrupt))
+ client._native_handler(None)
+ assert "Syphon frame handler failed" in caplog.text
+
+
+def test_native_block_does_not_retain_wrapper():
+ client = make_client()
+ callback = client._native_handler
+ reference = weakref.ref(client)
+ del client
+ gc.collect()
+ assert reference() is None
+ callback(None)
+
+
+def test_reject_coroutine_handler_and_close_accidental_coroutine(caplog):
+ async def handler(client):
+ pass
+
+ with pytest.raises(TypeError, match="synchronous"):
+ make_client(handler)
+ client = make_client(lambda c: handler(c))
+ client._native_handler(None)
+ assert "must be synchronous" in caplog.text
+
+
+def test_loop_dispatch_coalescing_exception_reporting_and_stop():
+ async def scenario():
+ loop = asyncio.get_running_loop()
+ errors = []
+ loop.set_exception_handler(lambda _, context: errors.append(context))
+ threads = []
+ client = make_client(lambda _: threads.append(threading.get_ident()), loop)
+ thread = threading.Thread(target=lambda: [client._native_handler(None) for _ in range(10)])
+ thread.start()
+ thread.join()
+ assert threads == []
+ await asyncio.sleep(0)
+ assert threads == [threading.get_ident()]
+ client._handler = Mock(side_effect=ValueError("handler failed"))
+ client._native_handler(None)
+ await asyncio.sleep(0)
+ assert isinstance(errors[0]["exception"], ValueError)
+ client._handler = Mock()
+ handler = client._handler
+ client._native_handler(None)
+ client.stop()
+ await asyncio.sleep(0)
+ handler.assert_not_called()
+
+ asyncio.run(scenario())
+
+
+def test_stop_from_loop_callback_is_safe():
+ async def scenario():
+ client = make_client(lambda c: c.stop(), asyncio.get_running_loop())
+ client._native_handler(None)
+ await asyncio.sleep(0)
+ client.context.stop.assert_called_once()
+
+ asyncio.run(scenario())
+
+
+def test_closed_callback_loop(caplog):
+ loop = asyncio.new_event_loop()
+ client = make_client(Mock(), loop)
+ loop.close()
+ client._native_handler(None)
+ assert "callback_loop is closed" in caplog.text
+ with pytest.raises(ValueError, match="closed"):
+ make_client(loop=loop)
+
+
+def test_stop_does_not_hold_lock_while_native_waits_for_callback():
+ client = make_client()
+
+ def stop():
+ thread = threading.Thread(target=lambda: client._native_handler(None))
+ thread.start()
+ thread.join(1)
+ assert not thread.is_alive()
+
+ client.context.stop.side_effect = stop
+ client.stop()
+
+
+def test_context_manager_stops_after_exception():
+ client = make_client()
+ with pytest.raises(ValueError):
+ with client as entered:
+ assert entered is client
+ raise ValueError()
+ assert not client.is_valid
+ assert not client.has_new_frame
+ assert client.new_frame_image is None
+ with pytest.raises(RuntimeError):
+ client.__enter__()
+
+
+def test_async_waiters_notification_does_not_fetch_image():
+ async def scenario():
+ client = make_client()
+ tasks = [asyncio.create_task(client.wait_for_frame(1)) for _ in range(3)]
+ await asyncio.sleep(0)
+ thread = threading.Thread(target=lambda: client._native_handler(None))
+ thread.start()
+ thread.join()
+ assert await asyncio.gather(*tasks) == [None] * 3
+ client.context.newFrameImage.assert_not_called()
+ assert not client._waiters
+
+ asyncio.run(scenario())
+
+
+def test_async_unread_frame_timeout_cancellation_disconnect_and_stop():
+ async def scenario():
+ client = make_client()
+ client.context.hasNewFrame.return_value = True
+ assert await client.wait_for_frame(0) is None
+ client.context.hasNewFrame.return_value = False
+ with pytest.raises(asyncio.TimeoutError):
+ await client.wait_for_frame(0.01)
+ with pytest.raises(ValueError):
+ await client.wait_for_frame(float("nan"))
+ first = asyncio.create_task(client.wait_for_frame())
+ second = asyncio.create_task(client.wait_for_frame())
+ await asyncio.sleep(0)
+ first.cancel()
+ with pytest.raises(asyncio.CancelledError):
+ await first
+ assert len(client._waiters) == 1
+ client.context.isValid.return_value = False
+ with pytest.raises(ConnectionError):
+ await asyncio.wait_for(second, 1)
+ client.context.isValid.return_value = True
+ last = asyncio.create_task(client.wait_for_frame())
+ await asyncio.sleep(0)
+ client.stop()
+ with pytest.raises(RuntimeError, match="stopped"):
+ await last
+ with pytest.raises(RuntimeError, match="stopped"):
+ await client.wait_for_frame()
+ assert not client._waiters
+
+ asyncio.run(scenario())
+
+
+def test_frame_arriving_during_registration_is_not_lost():
+ async def scenario():
+ client = make_client()
+
+ def check():
+ client._native_handler(None)
+ return False
+
+ client.context.hasNewFrame.side_effect = check
+ assert await client.wait_for_frame(1) is None
+
+ asyncio.run(scenario())
+
+
+@pytest.mark.parametrize(
+ "client_type,selector",
+ [
+ (SyphonMetalClient, "initWithServerDescription_device_options_newFrameHandler_"),
+ (SyphonOpenGLClient, "initWithServerDescription_context_options_newFrameHandler_"),
+ ],
+)
+def test_constructor_forwards_retained_block_and_checks_nil(monkeypatch, client_type, selector):
+ import syphon.client as module
+
+ monkeypatch.setattr(module.opengl, "_require_pyopengl", Mock())
+ native_type = Mock()
+ monkeypatch.setattr(module.objc, "lookUpClass", lambda name: native_type)
+ description = SyphonServerDescription.from_native({"custom": "kept"})
+ factory = getattr(native_type.alloc.return_value, selector)
+ client = client_type(description, object())
+ args = factory.call_args.args
+ assert args[0] is description.raw
+ assert args[-1] is client._native_handler
+ client.stop()
+ factory.return_value = None
+ with pytest.raises(RuntimeError, match="create the client"):
+ client_type(description, object())
+
+
+def test_stop_drains_peer_callbacks_before_native_shutdown():
+ client = make_client()
+ entered = threading.Event()
+ release = threading.Event()
+ marked_stopped = threading.Event()
+ errors = []
+
+ def callback(_):
+ entered.set()
+ if not release.wait(2):
+ errors.append("Callback was not released")
+ # A peer on the same native queue may inspect the stopping client.
+ assert not client.is_valid
+
+ peer = make_client(callback)
+ worker = threading.Thread(target=lambda: peer._native_handler(None))
+ worker.start()
+ assert entered.wait(1)
+ client._notify_waiters = lambda *args: marked_stopped.set()
+ stopper = threading.Thread(target=client.stop)
+ stopper.start()
+ try:
+ assert marked_stopped.wait(1)
+ client.context.stop.assert_not_called()
+ finally:
+ release.set()
+ worker.join(2)
+ stopper.join(2)
+ assert not worker.is_alive() and not stopper.is_alive()
+ assert not errors
+ client.context.stop.assert_called_once()
+
+
+def test_burst_notifications_schedule_each_waiter_once():
+ async def scenario():
+ client = make_client()
+ task = asyncio.create_task(client.wait_for_frame(1))
+ await asyncio.sleep(0)
+ for _ in range(100):
+ client._native_handler(None)
+ assert not client._waiters
+ assert await task is None
+
+ asyncio.run(scenario())
diff --git a/tests/test_distributions.py b/tests/test_distributions.py
new file mode 100644
index 0000000..e1603ca
--- /dev/null
+++ b/tests/test_distributions.py
@@ -0,0 +1,60 @@
+"""Validate built artifacts with pytest --dist-dir dist after uv build."""
+
+import email.parser
+import subprocess
+import tarfile
+import zipfile
+
+from packaging.requirements import Requirement
+from packaging.utils import parse_wheel_filename
+
+
+def test_source_archive_is_self_contained(dist_dir):
+ archives = list(dist_dir.glob("syphon_python-*.tar.gz"))
+ assert len(archives) == 1, "Expected one source archive; clean dist/ before building a new version"
+ with tarfile.open(archives[0]) as archive:
+ names = {name.split("/", 1)[1] for name in archive.getnames() if "/" in name}
+ required = {
+ "pyproject.toml",
+ "conftest.py",
+ "hatch_build.py",
+ "README.md",
+ "LICENSE",
+ "syphon/__init__.py",
+ "vendor/Syphon/License.txt",
+ "vendor/Syphon/Syphon.xcodeproj/project.pbxproj",
+ "vendor/Syphon/SyphonMetalShaders.metal",
+ "vendor/Syphon/SyphonMetalServer.m",
+ }
+ assert required <= names, required - names
+ assert not any(
+ ".git" in name.split("/") or "build" in name.split("/") or ".framework/" in name for name in names
+ )
+
+
+def test_wheel_metadata_and_bundled_framework(dist_dir, tmp_path):
+ wheels = list(dist_dir.glob("syphon_python-*.whl"))
+ assert len(wheels) == 1, "Expected one universal wheel; clean dist/ before building a new version"
+ name, version, _, tags = parse_wheel_filename(wheels[0].name)
+ assert name == "syphon-python"
+ assert {str(tag) for tag in tags} == {"py3-none-macosx_12_0_universal2"}
+ with zipfile.ZipFile(wheels[0]) as wheel:
+ names = set(wheel.namelist())
+ wheel_metadata = email.parser.BytesParser().parsebytes(
+ wheel.read(next(n for n in names if n.endswith("/WHEEL")))
+ )
+ assert wheel_metadata["Root-Is-Purelib"] == "false"
+ assert wheel_metadata.get_all("Tag") == ["py3-none-macosx_12_0_universal2"]
+ metadata = email.parser.BytesParser().parsebytes(wheel.read(next(n for n in names if n.endswith("/METADATA"))))
+ assert metadata["Version"] == str(version)
+ assert metadata["Requires-Python"] == ">=3.10"
+ requirements = [Requirement(value) for value in metadata.get_all("Requires-Dist")]
+ pyopengl = next(r for r in requirements if r.name.lower() == "pyopengl")
+ assert not pyopengl.marker.evaluate({"extra": ""})
+ assert pyopengl.marker.evaluate({"extra": "opengl"})
+ prefix = "syphon/libs/Syphon.framework/"
+ for resource in ("Syphon", "Resources/Info.plist", "Resources/default.metallib", "Resources/License.txt"):
+ assert wheel.read(prefix + resource), resource
+ binary = tmp_path / "Syphon"
+ binary.write_bytes(wheel.read(prefix + "Syphon"))
+ assert set(subprocess.check_output(["lipo", "-archs", str(binary)], text=True).split()) == {"arm64", "x86_64"}
diff --git a/tests/test_example_discovery.py b/tests/test_example_discovery.py
new file mode 100644
index 0000000..8f617a8
--- /dev/null
+++ b/tests/test_example_discovery.py
@@ -0,0 +1,115 @@
+"""Headless examples must answer discovery requests from clients started later."""
+
+import runpy
+import signal
+import subprocess
+import sys
+import textwrap
+import time
+from pathlib import Path
+from types import SimpleNamespace
+from unittest.mock import Mock
+
+import pytest
+
+ROOT = Path(__file__).resolve().parents[1]
+
+
+@pytest.mark.metal
+@pytest.mark.parametrize("example", ["MetalServerExample.py", "MetalServerExampleMini.py"])
+def test_late_client_discovers_running_metal_example(example, tmp_path):
+ import Metal
+
+ if Metal.MTLCreateSystemDefaultDevice() is None:
+ pytest.skip("A Metal device is required")
+ if example.endswith("Mini.py"):
+ pytest.importorskip("numpy")
+ ready = tmp_path / "server-uuid"
+ publisher = textwrap.dedent("""
+ import runpy
+ import sys
+ from pathlib import Path
+ import syphon
+
+ class ObservedServer(syphon.SyphonMetalServer):
+ announced = False
+
+ def publish_frame_texture(self, *args, **kwargs):
+ super().publish_frame_texture(*args, **kwargs)
+ if not self.announced:
+ self.announced = True
+ Path(sys.argv[2]).write_text(self.server_description.uuid)
+
+ syphon.SyphonMetalServer = ObservedServer
+ runpy.run_path(sys.argv[1], run_name="__main__")
+ """)
+ receiver = textwrap.dedent("""
+ import sys
+ import time
+ import syphon
+
+ with syphon.SyphonServerDirectory() as directory:
+ directory.run_loop_interval = 0.01
+ deadline = time.monotonic() + 5
+ description = None
+ while time.monotonic() < deadline:
+ description = next((s for s in directory.servers if s.uuid == sys.argv[1]), None)
+ if description is not None:
+ break
+ assert description is not None, "Late client could not discover the example server"
+ with syphon.SyphonMetalClient(description) as client:
+ deadline = time.monotonic() + 5
+ while time.monotonic() < deadline:
+ directory.update_run_loop()
+ if client.has_new_frame:
+ image = client.new_frame_image
+ if image is not None:
+ assert image.width() > 0 and image.height() > 0
+ break
+ else:
+ raise AssertionError("Discovered server delivered no Metal texture")
+ """)
+ with (tmp_path / "publisher.log").open("w+") as output:
+ process = subprocess.Popen(
+ [sys.executable, "-c", publisher, str(ROOT / "examples" / example), str(ready)],
+ stdout=output,
+ stderr=output,
+ )
+ try:
+ deadline = time.monotonic() + 10
+ while not ready.exists() and process.poll() is None and time.monotonic() < deadline:
+ time.sleep(0.01)
+ assert ready.exists(), "Example did not begin publishing"
+ # Import Syphon only now, in a fresh process: its initial announcement has passed.
+ result = subprocess.run(
+ [sys.executable, "-c", receiver, ready.read_text()],
+ capture_output=True,
+ text=True,
+ timeout=15,
+ )
+ assert result.returncode == 0, result.stdout + result.stderr
+ finally:
+ if process.poll() is None:
+ process.send_signal(signal.SIGINT)
+ try:
+ process.wait(timeout=5)
+ except subprocess.TimeoutExpired:
+ process.kill()
+ process.wait()
+ output.seek(0)
+ assert process.returncode == 0, output.read()
+
+
+@pytest.mark.parametrize("found", [True, False])
+def test_client_waits_for_discovery_and_times_out(monkeypatch, found):
+ # Discovery itself does not require OpenCV; avoid pulling GUI dependencies into unit tests.
+ monkeypatch.setitem(sys.modules, "cv2", Mock())
+ monkeypatch.setitem(sys.modules, "syphon.utils.numpy", SimpleNamespace(copy_mtl_texture_to_image=Mock()))
+ wait = runpy.run_path(str(ROOT / "examples/MetalClientExample.py"))["wait_for_server"]
+ server = object()
+ results = iter([[], [server] if found else []])
+ directory = type("Directory", (), {"servers": property(lambda _: next(results))})()
+ clock = SimpleNamespace(monotonic=Mock(side_effect=[0, 0.1, 5]), sleep=Mock())
+ wait.__globals__["time"] = clock
+ assert wait(directory) is (server if found else None)
+ clock.sleep.assert_called_once_with(0.01)
diff --git a/tests/test_metal_integration.py b/tests/test_metal_integration.py
new file mode 100644
index 0000000..2ee87b4
--- /dev/null
+++ b/tests/test_metal_integration.py
@@ -0,0 +1,227 @@
+"""Exercise the bundled framework on a real Metal device."""
+
+import time
+
+import pytest
+
+pytestmark = pytest.mark.metal
+
+
+@pytest.fixture
+def server():
+ import Metal
+ import objc
+
+ import syphon
+
+ with objc.autorelease_pool():
+ device = Metal.MTLCreateSystemDefaultDevice()
+ if device is None:
+ pytest.skip("A Metal device is required for native integration tests")
+ server = syphon.SyphonMetalServer("Syphon integration test", device=device)
+ assert server.context is not None
+ try:
+ yield server
+ finally:
+ server.stop()
+
+
+def test_server_copies_mutable_name(server):
+ from Cocoa import NSMutableString
+
+ name = NSMutableString.stringWithString_("Original name")
+ server.context.setName_(name)
+ name.appendString_(" changed by caller")
+ assert str(server.context.name()) == "Original name"
+
+
+def test_metal_frames_continue_after_client_stops(server):
+ import Metal
+
+ import syphon
+ from syphon.utils.raw import copy_bytes_to_mtl_texture, copy_mtl_texture_to_bytes, create_mtl_texture
+
+ raw = server.context.serverDescription()
+ description = syphon.SyphonServerDescription(
+ uuid=str(raw["SyphonServerDescriptionUUIDKey"]),
+ name=str(raw["SyphonServerDescriptionNameKey"]),
+ app_name=str(raw["SyphonServerDescriptionAppNameKey"]),
+ icon=None,
+ raw=raw,
+ )
+ clients = []
+ directory = syphon.SyphonServerDirectory()
+ directory.run_loop_interval = 0.01
+ texture = create_mtl_texture(server.device, 16, 16)
+
+ def receive(client, rgba):
+ pixels = bytes(rgba) * 256
+ copy_bytes_to_mtl_texture(pixels, texture)
+ assert copy_mtl_texture_to_bytes(texture) == pixels
+ deadline = time.monotonic() + 5
+ while time.monotonic() < deadline:
+ server.publish_frame_texture(texture)
+ directory.update_run_loop()
+ if client.has_new_frame:
+ frame = client.new_frame_image
+ if frame is not None:
+ assert (frame.width(), frame.height()) == (16, 16)
+ assert frame.pixelFormat() == Metal.MTLPixelFormatBGRA8Unorm
+ expected = bytes((rgba[2], rgba[1], rgba[0], rgba[3])) * 256
+ if copy_mtl_texture_to_bytes(frame) == expected:
+ return
+ time.sleep(0.01)
+ pytest.fail("Timed out receiving the expected Metal frame")
+
+ try:
+ for _ in range(2):
+ client = syphon.SyphonMetalClient(description, device=server.device)
+ clients.append(client)
+ assert client.is_valid
+ for client in clients:
+ receive(client, (17, 53, 199, 255))
+ clients.pop(0).stop()
+ receive(clients[0], (101, 203, 37, 255))
+ finally:
+ for client in clients:
+ client.stop()
+
+
+def test_private_server_callbacks_output_and_lifecycle():
+ import threading
+
+ import Metal
+
+ import syphon
+ from syphon.utils.raw import create_mtl_texture
+
+ device = Metal.MTLCreateSystemDefaultDevice()
+ if device is None:
+ pytest.skip("A Metal device is required")
+ main_thread = threading.get_ident()
+ notifications = []
+ errors = []
+ received = threading.Event()
+
+ def on_frame(client):
+ try:
+ notifications.append((client, threading.get_ident()))
+ with pytest.raises(RuntimeError, match="native frame callback"):
+ client.stop()
+ except BaseException as error:
+ errors.append(error)
+ finally:
+ received.set()
+
+ with syphon.SyphonServerDirectory() as directory:
+ directory.run_loop_interval = 0.001
+ with syphon.SyphonMetalServer("Private integration", device=device, is_private=True) as server:
+ server.name = "Private renamed"
+ assert server.name == "Private renamed"
+ assert server.server_description.name == "Private renamed"
+ texture = create_mtl_texture(device, 8, 8)
+ with syphon.SyphonMetalClient(server.server_description, device, new_frame_handler=on_frame) as client:
+ deadline = time.monotonic() + 5
+ while not received.is_set() and time.monotonic() < deadline:
+ server.publish_frame_texture(texture)
+ directory.update_run_loop()
+ time.sleep(0.01)
+ assert received.is_set(), "Native callback did not arrive"
+ assert not errors
+ assert notifications[0][0] is client
+ assert notifications[0][1] != main_thread
+ assert client.is_valid
+ output = server.new_frame_image
+ assert output is not None and (output.width(), output.height()) == (8, 8)
+ assert all(entry.uuid != server.server_description.uuid for entry in directory.servers)
+ count = len(notifications)
+ for _ in range(3):
+ server.publish_frame_texture(texture)
+ directory.update_run_loop()
+ assert len(notifications) == count
+ client.stop()
+ server.stop()
+
+
+def test_public_rename_and_observer_removal(server):
+ import syphon
+
+ changes = []
+ with syphon.SyphonServerDirectory() as directory:
+ directory.run_loop_interval = 0.01
+ token = directory.add_observer(syphon.SyphonServerNotification.Update, lambda note: changes.append(note))
+ deadline = time.monotonic() + 5
+ while time.monotonic() < deadline:
+ if any(entry.uuid == server.server_description.uuid for entry in directory.servers):
+ break
+ else:
+ pytest.fail("Server did not appear in discovery")
+ server.name = "Live renamed server"
+ deadline = time.monotonic() + 5
+ while time.monotonic() < deadline:
+ if any(
+ entry.uuid == server.server_description.uuid and entry.name == server.name
+ for entry in directory.servers
+ ):
+ break
+ else:
+ pytest.fail("Renamed server did not update discovery")
+ assert changes
+ directory.remove_observer(token)
+ count = len(changes)
+ server.name = "Renamed again"
+ for _ in range(10):
+ directory.update_run_loop()
+ assert len(changes) == count
+
+
+def test_async_native_frames_and_disconnect(server):
+ import asyncio
+ import threading
+
+ import syphon
+ from syphon.utils.raw import create_mtl_texture
+
+ async def scenario():
+ loop = asyncio.get_running_loop()
+ callbacks = []
+ directory = syphon.SyphonServerDirectory()
+ directory.run_loop_interval = 0.001
+ texture = create_mtl_texture(server.device, 8, 8)
+ client = syphon.SyphonMetalClient(
+ server.server_description,
+ server.device,
+ new_frame_handler=lambda _: callbacks.append(threading.get_ident()),
+ callback_loop=loop,
+ )
+ publish = True
+
+ async def produce_and_pump():
+ while True:
+ if publish:
+ server.publish_frame_texture(texture)
+ directory.update_run_loop()
+ await asyncio.sleep(0.01)
+
+ producer = asyncio.create_task(produce_and_pump())
+ try:
+ await client.wait_for_frame(timeout=5)
+ assert client.has_new_frame
+ assert client.new_frame_image is not None
+ await asyncio.sleep(0.03)
+ assert callbacks and set(callbacks) == {threading.get_ident()}
+ publish = False
+ server.stop()
+ deadline = loop.time() + 5
+ while client.is_valid and loop.time() < deadline:
+ await asyncio.sleep(0.01)
+ with pytest.raises(ConnectionError):
+ await client.wait_for_frame(timeout=1)
+ finally:
+ producer.cancel()
+ with pytest.raises(asyncio.CancelledError):
+ await producer
+ client.stop()
+ directory.close()
+
+ asyncio.run(scenario())
diff --git a/tests/test_opengl_integration.py b/tests/test_opengl_integration.py
new file mode 100644
index 0000000..4e544f5
--- /dev/null
+++ b/tests/test_opengl_integration.py
@@ -0,0 +1,145 @@
+"""Exercise the native direct-rendering API with an offscreen OpenGL context."""
+
+import threading
+import time
+
+import pytest
+
+pytestmark = pytest.mark.opengl
+
+
+@pytest.mark.parametrize("sample_count", [0, 4])
+def test_direct_framebuffer_rendering(sample_count):
+ GL = pytest.importorskip("OpenGL.GL")
+ import AppKit
+ import objc
+
+ import syphon
+
+ with objc.autorelease_pool():
+ pixel_format = AppKit.NSOpenGLPixelFormat.alloc().initWithAttributes_(
+ [
+ AppKit.NSOpenGLPFAOpenGLProfile,
+ AppKit.NSOpenGLProfileVersion3_2Core,
+ AppKit.NSOpenGLPFAColorSize,
+ 24,
+ AppKit.NSOpenGLPFAAlphaSize,
+ 8,
+ AppKit.NSOpenGLPFAAccelerated,
+ 0,
+ ]
+ )
+ if pixel_format is None:
+ pytest.skip("No usable OpenGL pixel format")
+ context = AppKit.NSOpenGLContext.alloc().initWithFormat_shareContext_(pixel_format, None)
+ if context is None:
+ pytest.skip("No usable OpenGL context")
+ previous = AppKit.NSOpenGLContext.currentContext()
+ context.makeCurrentContext()
+ try:
+ with syphon.SyphonOpenGLServer(
+ "Direct render test",
+ is_private=True,
+ antialias_sample_count=sample_count,
+ depth_buffer_resolution=24,
+ stencil_buffer_resolution=8,
+ ) as server:
+ received = threading.Event()
+ with syphon.SyphonOpenGLClient(
+ server.server_description, new_frame_handler=lambda _: received.set()
+ ) as client:
+ deadline = time.monotonic() + 5
+ while not received.is_set() and time.monotonic() < deadline:
+ assert server.bind_to_draw_frame((8, 8))
+ try:
+ GL.glViewport(0, 0, 8, 8)
+ GL.glClearColor(1, 0, 0, 1)
+ GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT)
+ if sample_count == 0:
+ pixels = GL.glReadPixels(0, 0, 8, 8, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE)
+ assert bytes(pixels) == bytes((255, 0, 0, 255)) * 64
+ finally:
+ server.unbind_and_publish()
+ received.wait(0.01)
+ assert received.is_set(), "OpenGL client received no frame notification"
+ frame = client.new_frame_image
+ assert frame is not None and tuple(frame.textureSize()) == (8, 8)
+ del frame
+ image = server.new_frame_image
+ assert image is not None
+ assert tuple(image.textureSize()) == (8, 8)
+ assert image.textureName() != 0
+ GL.glBindTexture(GL.GL_TEXTURE_RECTANGLE, image.textureName())
+ # Read IOSurface-backed textures through an FBO: the macOS driver
+ # can return incomplete rows through glGetTexImage.
+ framebuffer = GL.glGenFramebuffers(1)
+ previous_framebuffer = GL.glGetIntegerv(GL.GL_READ_FRAMEBUFFER_BINDING)
+ try:
+ GL.glBindFramebuffer(GL.GL_READ_FRAMEBUFFER, framebuffer)
+ GL.glFramebufferTexture2D(
+ GL.GL_READ_FRAMEBUFFER,
+ GL.GL_COLOR_ATTACHMENT0,
+ GL.GL_TEXTURE_RECTANGLE,
+ image.textureName(),
+ 0,
+ )
+ GL.glReadBuffer(GL.GL_COLOR_ATTACHMENT0)
+ assert GL.glCheckFramebufferStatus(GL.GL_READ_FRAMEBUFFER) == GL.GL_FRAMEBUFFER_COMPLETE
+ pixels = GL.glReadPixels(0, 0, 8, 8, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE)
+ assert bytes(pixels) == bytes((255, 0, 0, 255)) * 64
+ finally:
+ GL.glBindFramebuffer(GL.GL_READ_FRAMEBUFFER, previous_framebuffer)
+ GL.glDeleteFramebuffers(1, [framebuffer])
+ GL.glBindTexture(GL.GL_TEXTURE_RECTANGLE, 0)
+ # Drop the image while the owning context remains current.
+ del image
+ finally:
+ if previous is not None:
+ previous.makeCurrentContext()
+ else:
+ AppKit.NSOpenGLContext.clearCurrentContext()
+
+
+def test_context_pointer_created_before_importing_syphon():
+ import subprocess
+ import sys
+ import textwrap
+
+ pytest.importorskip("OpenGL.GL")
+ result = subprocess.run(
+ [
+ sys.executable,
+ "-c",
+ textwrap.dedent("""
+ import AppKit
+ import objc
+ import warnings
+
+ fmt = AppKit.NSOpenGLPixelFormat.alloc().initWithAttributes_([AppKit.NSOpenGLPFAColorSize, 24, 0])
+ if fmt is None:
+ raise SystemExit(77)
+ ctx = AppKit.NSOpenGLContext.alloc().initWithFormat_shareContext_(fmt, None)
+ if ctx is None:
+ raise SystemExit(77)
+ ctx.makeCurrentContext()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", objc.ObjCPointerWarning)
+ pointer = ctx.CGLContextObj()
+ import syphon
+ try:
+ with syphon.SyphonOpenGLServer("Legacy CGL pointer", pointer, is_private=True) as server:
+ with syphon.SyphonOpenGLClient(server.server_description, pointer) as client:
+ assert client.is_valid
+ assert client.cgl_context_obj is pointer
+ assert server.cgl_context_obj is pointer
+ finally:
+ AppKit.NSOpenGLContext.clearCurrentContext()
+ """),
+ ],
+ capture_output=True,
+ text=True,
+ timeout=15,
+ )
+ if result.returncode == 77:
+ pytest.skip("No usable OpenGL context")
+ assert result.returncode == 0, result.stdout + result.stderr
diff --git a/tests/test_optional_opengl.py b/tests/test_optional_opengl.py
new file mode 100644
index 0000000..adec1c3
--- /dev/null
+++ b/tests/test_optional_opengl.py
@@ -0,0 +1,110 @@
+"""Keep the public API importable without loading the optional PyOpenGL package."""
+
+import importlib.metadata
+import inspect
+import subprocess
+import sys
+import textwrap
+from types import SimpleNamespace
+from unittest.mock import Mock
+
+import pytest
+from packaging.requirements import Requirement
+
+
+def test_import_and_errors_without_opengl():
+ subprocess.run(
+ [
+ sys.executable,
+ "-c",
+ textwrap.dedent("""\
+ import importlib.abc
+ import sys
+ import typing
+ from types import SimpleNamespace
+
+ attempts = []
+ class NoOpenGL(importlib.abc.MetaPathFinder):
+ def find_spec(self, fullname, path=None, target=None):
+ if fullname == "OpenGL" or fullname.startswith("OpenGL."):
+ attempts.append(fullname)
+ raise ModuleNotFoundError("PyOpenGL unavailable", name="OpenGL")
+
+ sys.meta_path.insert(0, NoOpenGL())
+ import syphon
+ from syphon.client import SyphonMetalClient, SyphonOpenGLClient
+ from syphon.server import SyphonMetalServer, SyphonOpenGLServer
+ from syphon.utils import raw
+
+ assert syphon.SyphonMetalServer is SyphonMetalServer
+ assert syphon.SyphonMetalClient is SyphonMetalClient
+ assert syphon.SyphonOpenGLServer is SyphonOpenGLServer
+ assert syphon.SyphonOpenGLClient is SyphonOpenGLClient
+ typing.get_type_hints(SyphonOpenGLServer.publish_frame_texture)
+ assert not attempts, attempts
+ assert not any(n == "OpenGL" or n.startswith("OpenGL.") for n in sys.modules)
+
+ for construct in (
+ lambda: SyphonOpenGLServer("test"),
+ lambda: SyphonOpenGLServer("test", cgl_context_obj=object()),
+ lambda: SyphonOpenGLClient(SimpleNamespace(raw={})),
+ lambda: SyphonOpenGLClient(SimpleNamespace(raw={}), cgl_context_obj=object()),
+ ):
+ try:
+ construct()
+ except ImportError as exc:
+ assert "pip install 'syphon-python[opengl]'" in str(exc)
+ else:
+ raise AssertionError("Expected a helpful missing-extra error")
+ """),
+ ],
+ check=True,
+ capture_output=True,
+ text=True,
+ timeout=30,
+ )
+
+
+def test_opengl_is_only_an_extra():
+ requirements = [Requirement(value) for value in importlib.metadata.requires("syphon-python")]
+ opengl = [requirement for requirement in requirements if requirement.name.lower() == "pyopengl"]
+ assert len(opengl) == 1
+ assert opengl[0].marker is not None
+ assert not opengl[0].marker.evaluate({"extra": ""})
+ assert opengl[0].marker.evaluate({"extra": "opengl"})
+
+
+def test_unrelated_import_errors_are_preserved(monkeypatch):
+ from syphon.utils import opengl
+
+ error = ModuleNotFoundError("An internal dependency is missing", name="internal_dependency")
+ monkeypatch.setattr(opengl, "import_module", Mock(side_effect=error))
+ with pytest.raises(ModuleNotFoundError) as caught:
+ opengl._require_pyopengl()
+ assert caught.value is error
+
+
+def test_opengl_publish_preserves_default_and_explicit_targets():
+ from syphon.server import SyphonOpenGLServer
+
+ publish = SyphonOpenGLServer.publish_frame_texture
+ assert inspect.signature(publish).parameters["target"].default == 0x0DE1 # GL_TEXTURE_2D
+ context = Mock()
+ server = SimpleNamespace(context=context, _prepare_region_and_size=lambda *args: ((0, 0, 8, 4), (8, 4)))
+ publish(server, 7)
+ call = context.publishFrameTexture_textureTarget_imageRegion_textureDimensions_flipped_.call_args
+ assert call.args[0:2] == (7, 0x0DE1)
+ assert call.args[-1] is False
+ publish(server, 9, target=0x84F5, is_flipped=True) # GL_TEXTURE_RECTANGLE
+ call = context.publishFrameTexture_textureTarget_imageRegion_textureDimensions_flipped_.call_args
+ assert call.args[0:2] == (9, 0x84F5)
+ assert call.args[-1] is True
+
+
+def test_extra_loads_real_pyopengl():
+ pytest.importorskip("OpenGL")
+ from syphon.utils import opengl
+
+ gl = opengl._require_pyopengl()
+ assert int(gl.GL_TEXTURE_2D) == opengl.GL_TEXTURE_2D
+ assert callable(gl.glBindTexture)
diff --git a/tests/test_runtime.py b/tests/test_runtime.py
new file mode 100644
index 0000000..8c27c3e
--- /dev/null
+++ b/tests/test_runtime.py
@@ -0,0 +1,33 @@
+"""Load the installed native framework on every supported Python runtime."""
+
+import importlib.metadata
+import sys
+import sysconfig
+from pathlib import Path
+
+import objc
+import pytest
+
+import syphon
+
+
+@pytest.mark.parametrize(
+ "name",
+ ["SyphonMetalServer", "SyphonMetalClient", "SyphonOpenGLServer", "SyphonOpenGLClient", "SyphonServerDirectory"],
+)
+def test_native_classes_are_available(name):
+ assert getattr(syphon, name) is not None
+ assert objc.lookUpClass(name) is not None
+
+
+def test_framework_resources_are_installed():
+ framework = Path(syphon.__file__).parent / "libs/Syphon.framework"
+ for relative in ("Syphon", "Resources/Info.plist", "Resources/default.metallib", "Resources/License.txt"):
+ assert (framework / relative).is_file(), relative
+ assert importlib.metadata.version("syphon-python")
+
+
+def test_free_threaded_runtime_does_not_enable_gil():
+ if not sysconfig.get_config_var("Py_GIL_DISABLED"):
+ pytest.skip("This is a regular CPython interpreter")
+ assert not sys._is_gil_enabled()
diff --git a/tests/test_server_features.py b/tests/test_server_features.py
new file mode 100644
index 0000000..c3ed2fe
--- /dev/null
+++ b/tests/test_server_features.py
@@ -0,0 +1,155 @@
+"""Native option forwarding, live properties, framebuffer pairing and observer ownership."""
+
+import threading
+from unittest.mock import Mock
+
+import pytest
+
+from syphon._native import server_options
+from syphon.server import BaseSyphonServer, SyphonMetalServer, SyphonOpenGLServer
+from syphon.server_directory import SyphonServerDescription, SyphonServerDirectory, SyphonServerNotification
+
+
+@pytest.fixture
+def server():
+ server = SyphonMetalServer.__new__(SyphonMetalServer)
+ BaseSyphonServer.__init__(server, "Initial")
+ server._finish_initialization(Mock())
+ return server
+
+
+def test_live_name_description_and_image(server):
+ server.context.name.return_value = "Native name"
+ assert server.name == "Native name"
+ server.name = "Renamed"
+ server.context.setName_.assert_called_once_with("Renamed")
+ raw = {"SyphonServerDescriptionUUIDKey": "id", "private-key": 42}
+ server.context.serverDescription.return_value = raw
+ assert server.server_description == SyphonServerDescription("id", "", "", None, raw)
+ assert server.server_description.raw is raw
+ assert server.new_frame_image is server.context.newFrameImage.return_value
+ server.stop()
+ assert server.new_frame_image is None
+ with pytest.raises(RuntimeError):
+ server.name = "Stopped"
+
+
+def test_server_context_cleanup_and_initialization_failure(server):
+ with pytest.raises(ValueError):
+ with server as entered:
+ assert entered is server
+ raise ValueError()
+ server.stop()
+ server.context.stop.assert_called_once()
+ with pytest.raises(RuntimeError):
+ server.__enter__()
+ with pytest.raises(RuntimeError, match="create the server"):
+ server._finish_initialization(None)
+
+
+@pytest.mark.parametrize("kind", ["metal", "opengl"])
+def test_server_constructor_options(monkeypatch, kind):
+ import syphon.server as module
+
+ native = Mock()
+ monkeypatch.setattr(module.objc, "lookUpClass", lambda name: native)
+ monkeypatch.setattr(module.opengl, "_require_pyopengl", Mock())
+ if kind == "metal":
+ device, queue = Mock(), Mock()
+ server = SyphonMetalServer("Private", device, queue, is_private=True)
+ native.alloc.return_value.initWithName_device_options_.assert_called_once_with(
+ "Private", device, server_options(True)
+ )
+ else:
+ context = object()
+ server = SyphonOpenGLServer(
+ "Private",
+ context,
+ is_private=True,
+ antialias_sample_count=4,
+ depth_buffer_resolution=24,
+ stencil_buffer_resolution=8,
+ )
+ native.alloc.return_value.initWithName_context_options_.assert_called_once_with(
+ "Private",
+ context,
+ server_options(
+ True,
+ SyphonServerOptionAntialiasSampleCount=4,
+ SyphonServerOptionDepthBufferResolution=24,
+ SyphonServerOptionStencilBufferResolution=8,
+ ),
+ )
+ server.stop()
+
+
+@pytest.mark.parametrize(
+ "options",
+ [
+ {"antialias_sample_count": -1},
+ {"antialias_sample_count": True},
+ {"depth_buffer_resolution": 8},
+ {"stencil_buffer_resolution": 24},
+ ],
+)
+def test_invalid_opengl_options(monkeypatch, options):
+ import syphon.server as module
+
+ monkeypatch.setattr(module.opengl, "_require_pyopengl", Mock())
+ with pytest.raises(ValueError):
+ SyphonOpenGLServer("Invalid", object(), **options)
+
+
+def test_framebuffer_pairing_and_thread_ownership():
+ server = SyphonOpenGLServer.__new__(SyphonOpenGLServer)
+ BaseSyphonServer.__init__(server, "GL")
+ server._finish_initialization(Mock())
+ with pytest.raises(RuntimeError, match="No Syphon"):
+ server.unbind_and_publish()
+ server.context.bindToDrawFrameOfSize_.return_value = False
+ assert not server.bind_to_draw_frame((32, 16))
+ with pytest.raises(RuntimeError):
+ server.unbind_and_publish()
+ server.context.bindToDrawFrameOfSize_.return_value = True
+ assert server.bind_to_draw_frame((32, 16))
+ with pytest.raises(RuntimeError, match="already bound"):
+ server.bind_to_draw_frame((32, 16))
+ with pytest.raises(RuntimeError, match="Unbind"):
+ server.stop()
+ errors = []
+
+ def unbind():
+ try:
+ server.unbind_and_publish()
+ except RuntimeError as error:
+ errors.append(error)
+
+ thread = threading.Thread(target=unbind)
+ thread.start()
+ thread.join()
+ assert len(errors) == 1
+ server.context.unbindAndPublish.assert_not_called()
+ server.unbind_and_publish()
+ server.context.unbindAndPublish.assert_called_once()
+ server.stop()
+ with pytest.raises(RuntimeError, match="stopped"):
+ server.bind_to_draw_frame((32, 16))
+
+
+def test_directory_owns_only_its_tokens_and_close_is_idempotent():
+ directory = SyphonServerDirectory()
+ directory._notification_center = Mock()
+ first, second = object(), object()
+ directory._notification_center.addObserverForName_object_queue_usingBlock_.side_effect = [first, second]
+ assert directory.add_observer(SyphonServerNotification.Announce, Mock()) is first
+ assert directory.add_observer(SyphonServerNotification.Retire, Mock()) is second
+ directory.remove_observer(object())
+ directory._notification_center.removeObserver_.assert_not_called()
+ directory.remove_observer(first)
+ directory.remove_observer(first)
+ with directory:
+ pass
+ directory.close()
+ assert [call.args[0] for call in directory._notification_center.removeObserver_.call_args_list] == [first, second]
+ with pytest.raises(RuntimeError, match="closed"):
+ directory.add_observer(SyphonServerNotification.Update, Mock())
diff --git a/tests/test_texture_data.py b/tests/test_texture_data.py
new file mode 100644
index 0000000..e44a8b6
--- /dev/null
+++ b/tests/test_texture_data.py
@@ -0,0 +1,85 @@
+"""Check pixel layout and validation independently of GPU availability."""
+
+import ctypes
+
+import Metal
+import pytest
+
+from syphon.utils.raw import copy_bytes_to_mtl_texture, copy_mtl_texture_to_bytes
+
+
+class MemoryTexture:
+ def __init__(self, width=3, height=2, pixel_format=Metal.MTLPixelFormatRGBA8Unorm):
+ self._width = width
+ self._height = height
+ self._format = pixel_format
+ self.data = bytes(range(width * height * 4))
+
+ def width(self):
+ return self._width
+
+ def height(self):
+ return self._height
+
+ def pixelFormat(self):
+ return self._format
+
+ def replaceRegion_mipmapLevel_withBytes_bytesPerRow_(self, region, level, data, row_size):
+ assert tuple(region.size) == (self._width, self._height, 1)
+ assert level == 0
+ assert row_size == self._width * 4
+ self.data = bytes(data)
+
+ def getBytes_bytesPerRow_bytesPerImage_fromRegion_mipmapLevel_slice_(
+ self, buffer, row_size, image_size, region, level, slice_number
+ ):
+ assert row_size == self._width * 4
+ assert image_size == row_size * self._height
+ assert tuple(region.size) == (self._width, self._height, 1)
+ assert (level, slice_number) == (0, 0)
+ ctypes.memmove(buffer, self.data, len(self.data))
+
+
+@pytest.mark.parametrize("pixel_format", [Metal.MTLPixelFormatRGBA8Unorm, Metal.MTLPixelFormatBGRA8Unorm])
+def test_raw_pixels_and_reusable_buffer(pixel_format):
+ texture = MemoryTexture(pixel_format=pixel_format)
+ data = bytes(reversed(range(24)))
+ copy_bytes_to_mtl_texture(data, texture)
+ assert copy_mtl_texture_to_bytes(texture) == data
+ buffer = ctypes.create_string_buffer(24)
+ assert copy_mtl_texture_to_bytes(texture, buffer) == data
+ assert buffer.raw == data
+
+
+def test_unsupported_pixel_format():
+ with pytest.raises(Exception, match="pixel format"):
+ copy_mtl_texture_to_bytes(MemoryTexture(pixel_format=Metal.MTLPixelFormatR8Unorm))
+
+
+@pytest.mark.parametrize("size", [0, 23, 25])
+def test_wrong_buffer_size(size):
+ with pytest.raises(Exception, match="expected: 24"):
+ copy_mtl_texture_to_bytes(MemoryTexture(), ctypes.create_string_buffer(size))
+
+
+def test_numpy_roundtrip_handles_noncontiguous_arrays():
+ np = pytest.importorskip("numpy")
+ from syphon.utils.numpy import copy_image_to_mtl_texture, copy_mtl_texture_to_image
+
+ image = np.arange(48, dtype=np.uint8).reshape(2, 6, 4)[:, ::2, :]
+ assert not image.flags.c_contiguous
+ texture = MemoryTexture()
+ copy_image_to_mtl_texture(image, texture)
+ result = copy_mtl_texture_to_image(texture)
+ assert result.shape == (2, 3, 4)
+ assert result.dtype == np.uint8
+ np.testing.assert_array_equal(result, image)
+
+
+@pytest.mark.parametrize("shape", [(2, 3), (2, 3, 3), (2, 3, 4, 1)])
+def test_numpy_rejects_invalid_image_shape(shape):
+ np = pytest.importorskip("numpy")
+ from syphon.utils.numpy import copy_image_to_mtl_texture
+
+ with pytest.raises(AssertionError, match="shape"):
+ copy_image_to_mtl_texture(np.zeros(shape, dtype=np.uint8), MemoryTexture())
diff --git a/tests/test_wrappers.py b/tests/test_wrappers.py
new file mode 100644
index 0000000..7ccf046
--- /dev/null
+++ b/tests/test_wrappers.py
@@ -0,0 +1,98 @@
+"""Check wrapper behavior without requiring a GPU or a running Syphon peer."""
+
+from types import SimpleNamespace
+from unittest.mock import Mock
+
+import pytest
+
+from syphon.server import SyphonMetalServer
+from syphon.server_directory import SyphonServerDescription, SyphonServerDirectory, SyphonServerNotification
+
+
+@pytest.mark.parametrize(
+ "region,size,expected",
+ [
+ (None, None, ((0, 0, 16, 8), (16, 8))),
+ (None, (7, 4), ((0, 0, 7, 4), (7, 4))),
+ ((1, 2, 3, 4), None, ((1, 2, 3, 4), (16, 8))),
+ ((1, 2, 3, 4), (7, 4), ((1, 2, 3, 4), (7, 4))),
+ ],
+)
+def test_region_and_size_defaults(region, size, expected):
+ server = SyphonMetalServer.__new__(SyphonMetalServer)
+ texture = SimpleNamespace(width=lambda: 16, height=lambda: 8)
+ assert server._prepare_region_and_size(texture, region, size) == expected
+
+
+@pytest.mark.parametrize("external_buffer,auto_commit", [(False, True), (True, True), (True, False)])
+def test_metal_command_buffer_ownership(external_buffer, auto_commit):
+ server = SyphonMetalServer.__new__(SyphonMetalServer)
+ server.context = Mock()
+ server.command_queue = Mock()
+ buffer = Mock() if external_buffer else None
+ texture = SimpleNamespace(width=lambda: 16, height=lambda: 8)
+ server.publish_frame_texture(
+ texture, region=(1, 2, 3, 4), is_flipped=True, command_buffer=buffer, auto_commit=auto_commit
+ )
+ if external_buffer:
+ server.command_queue.commandBuffer.assert_not_called()
+ else:
+ server.command_queue.commandBuffer.assert_called_once_with()
+ buffer = server.command_queue.commandBuffer.return_value
+ args = server.context.publishFrameTexture_onCommandBuffer_imageRegion_flipped_.call_args.args
+ assert args[0] is texture
+ assert args[1] is buffer
+ assert tuple(args[2].origin) == (1, 2)
+ assert tuple(args[2].size) == (3, 4)
+ assert args[3] is True
+ assert buffer.commitAndWaitUntilSubmitted.call_count == int(auto_commit)
+
+
+@pytest.fixture
+def descriptions():
+ return [
+ SyphonServerDescription("a", "Camera", "Studio", None, {}),
+ SyphonServerDescription("b", "Output", "Studio", None, {}),
+ SyphonServerDescription("c", "Camera", "Other", None, {}),
+ ]
+
+
+@pytest.mark.parametrize(
+ "name,app_name,ids",
+ [
+ (None, None, []),
+ ("Missing", None, []),
+ ("Camera", None, ["a", "c"]),
+ (None, "Studio", ["a", "b"]),
+ ("Camera", "Studio", ["a", "b", "c"]),
+ ],
+)
+def test_directory_filters_match_either_name_without_duplicates(descriptions, name, app_name, ids):
+ directory = SimpleNamespace(servers=descriptions)
+ matches = SyphonServerDirectory.servers_matching_name(directory, name, app_name)
+ assert [description.uuid for description in matches] == ids
+
+
+def test_directory_converts_native_descriptions():
+ raw = {
+ "SyphonServerDescriptionUUIDKey": "uuid",
+ "SyphonServerDescriptionNameKey": "Camera",
+ "SyphonServerDescriptionAppNameKey": "Studio",
+ "SyphonServerDescriptionIconKey": None,
+ }
+ directory = SyphonServerDirectory.__new__(SyphonServerDirectory)
+ directory.update_run_loop = Mock()
+ directory._syphonServerDirectoryObjC = Mock()
+ directory._syphonServerDirectoryObjC.sharedDirectory.return_value.servers.return_value = [raw]
+ assert directory.servers == [SyphonServerDescription("uuid", "Camera", "Studio", None, raw)]
+ directory.update_run_loop.assert_called_once_with()
+
+
+def test_directory_registers_notification_handler():
+ directory = SyphonServerDirectory()
+ directory._notification_center = Mock()
+ handler = Mock()
+ directory.add_observer(SyphonServerNotification.Announce, handler)
+ directory._notification_center.addObserverForName_object_queue_usingBlock_.assert_called_once_with(
+ "SyphonServerAnnounceNotification", None, None, handler
+ )
diff --git a/uv.lock b/uv.lock
new file mode 100644
index 0000000..7fb4227
--- /dev/null
+++ b/uv.lock
@@ -0,0 +1,484 @@
+version = 1
+revision = 3
+requires-python = ">=3.10"
+resolution-markers = [
+ "python_full_version >= '3.12' and sys_platform == 'darwin'",
+ "python_full_version == '3.11.*' and sys_platform == 'darwin'",
+ "python_full_version < '3.11' and sys_platform == 'darwin'",
+]
+supported-markers = [
+ "sys_platform == 'darwin'",
+]
+
+[[package]]
+name = "exceptiongroup"
+version = "1.3.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "typing-extensions" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" },
+]
+
+[[package]]
+name = "glfw"
+version = "2.10.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/0f/62/096058bcb4b4fb28f7ecd28fb048f07969d90b243c417af5f6d09d45a0c2/glfw-2.10.2.tar.gz", hash = "sha256:5d2cf97c66bc42a6b583be0e307eae5a3945438322e2ed0c5e4f14dc251d693d", size = 36307, upload-time = "2026-07-21T14:42:36.732Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/c4/80/5e575ec14f54dc0a644e7215985b9ee7c5044fcc3594d6b83dfdeb04ccd4/glfw-2.10.2-py2.py3-none-macosx_10_6_intel.whl", hash = "sha256:a04d25bb535a3a29e173ea1abd658e161681b5d3816e00bc51c122f74cd7fa3a", size = 110295, upload-time = "2026-07-21T14:42:25.625Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/2e/22216db429690aa51fa87d2e2b5e6b610c5a37b9df7768da2927f52f8704/glfw-2.10.2-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:c000b8a5e5fb4374b2c18d12347255ccb92001b9bcf80ef74c56072acbb98fe3", size = 107146, upload-time = "2026-07-21T14:42:26.854Z" },
+]
+
+[[package]]
+name = "hatchling"
+version = "1.32.4"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "packaging" },
+ { name = "pathspec" },
+ { name = "pluggy" },
+ { name = "tomli", marker = "python_full_version < '3.11'" },
+ { name = "tomlkit" },
+ { name = "trove-classifiers" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/f6/97/b5312f01a8c6daf729a9d272dd442e0c546dbcc630495788786c4b567ed0/hatchling-1.32.4.tar.gz", hash = "sha256:c4468f73144c054d2aab4ef0f0378c43b9878bf07f8ffd6b79690e970d375f07", size = 58065, upload-time = "2026-09-20T22:48:45.398Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/5f/80/91f51f439c05d4ec4623c22928ce16a938d6d793bf709477830823497859/hatchling-1.32.4-py3-none-any.whl", hash = "sha256:08ecf7548fb48205e7f213d70c71e67b8271b7242093dc3f1da578b42c734a2c", size = 78748, upload-time = "2026-09-20T22:48:44.19Z" },
+]
+
+[[package]]
+name = "iniconfig"
+version = "2.3.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
+]
+
+[[package]]
+name = "jinja2"
+version = "3.1.6"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "markupsafe" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
+]
+
+[[package]]
+name = "markdown2"
+version = "2.5.5"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/e4/ae/07d4a5fcaa5509221287d289323d75ac8eda5a5a4ac9de2accf7bbcc2b88/markdown2-2.5.5.tar.gz", hash = "sha256:001547e68f6e7fcf0f1cb83f7e82f48aa7d48b2c6a321f0cd20a853a8a2d1664", size = 157249, upload-time = "2026-03-02T20:46:53.411Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/43/af/4b3891eb0a49d6cfd5cbf3e9bf514c943afc2b0f13e2c57cc57cd88ecc21/markdown2-2.5.5-py3-none-any.whl", hash = "sha256:be798587e09d1f52d2e4d96a649c4b82a778c75f9929aad52a2c95747fa26941", size = 56250, upload-time = "2026-03-02T20:46:52.032Z" },
+]
+
+[[package]]
+name = "markupsafe"
+version = "3.0.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/e8/4b/3541d44f3937ba468b75da9eebcae497dcf67adb65caa16760b0a6807ebb/markupsafe-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559", size = 11631, upload-time = "2025-09-27T18:36:05.558Z" },
+ { url = "https://files.pythonhosted.org/packages/98/1b/fbd8eed11021cabd9226c37342fa6ca4e8a98d8188a8d9b66740494960e4/markupsafe-3.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419", size = 12057, upload-time = "2025-09-27T18:36:07.165Z" },
+ { url = "https://files.pythonhosted.org/packages/08/db/fefacb2136439fc8dd20e797950e749aa1f4997ed584c62cfb8ef7c2be0e/markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad", size = 11631, upload-time = "2025-09-27T18:36:18.185Z" },
+ { url = "https://files.pythonhosted.org/packages/e1/2e/5898933336b61975ce9dc04decbc0a7f2fee78c30353c5efba7f2d6ff27a/markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a", size = 12058, upload-time = "2025-09-27T18:36:19.444Z" },
+ { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" },
+ { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" },
+ { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" },
+ { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" },
+ { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" },
+]
+
+[[package]]
+name = "numpy"
+version = "2.2.6"
+source = { registry = "https://pypi.org/simple" }
+resolution-markers = [
+ "python_full_version < '3.11' and sys_platform == 'darwin'",
+]
+sdist = { url = "https://files.pythonhosted.org/packages/76/21/7d2a95e4bba9dc13d043ee156a356c0a8f0c6309dff6b21b4d71a073b8a8/numpy-2.2.6.tar.gz", hash = "sha256:e29554e2bef54a90aa5cc07da6ce955accb83f21ab5de01a62c8478897b264fd", size = 20276440, upload-time = "2025-05-17T22:38:04.611Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/9a/3e/ed6db5be21ce87955c0cbd3009f2803f59fa08df21b5df06862e2d8e2bdd/numpy-2.2.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b412caa66f72040e6d268491a59f2c43bf03eb6c96dd8f0307829feb7fa2b6fb", size = 21165245, upload-time = "2025-05-17T21:27:58.555Z" },
+ { url = "https://files.pythonhosted.org/packages/22/c2/4b9221495b2a132cc9d2eb862e21d42a009f5a60e45fc44b00118c174bff/numpy-2.2.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e41fd67c52b86603a91c1a505ebaef50b3314de0213461c7a6e99c9a3beff90", size = 14360048, upload-time = "2025-05-17T21:28:21.406Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/77/dc2fcfc66943c6410e2bf598062f5959372735ffda175b39906d54f02349/numpy-2.2.6-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:37e990a01ae6ec7fe7fa1c26c55ecb672dd98b19c3d0e1d1f326fa13cb38d163", size = 5340542, upload-time = "2025-05-17T21:28:30.931Z" },
+ { url = "https://files.pythonhosted.org/packages/7a/4f/1cb5fdc353a5f5cc7feb692db9b8ec2c3d6405453f982435efc52561df58/numpy-2.2.6-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:5a6429d4be8ca66d889b7cf70f536a397dc45ba6faeb5f8c5427935d9592e9cf", size = 6878301, upload-time = "2025-05-17T21:28:41.613Z" },
+ { url = "https://files.pythonhosted.org/packages/da/a8/4f83e2aa666a9fbf56d6118faaaf5f1974d456b1823fda0a176eff722839/numpy-2.2.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f9f1adb22318e121c5c69a09142811a201ef17ab257a1e66ca3025065b7f53ae", size = 21176963, upload-time = "2025-05-17T21:31:19.36Z" },
+ { url = "https://files.pythonhosted.org/packages/b3/2b/64e1affc7972decb74c9e29e5649fac940514910960ba25cd9af4488b66c/numpy-2.2.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c820a93b0255bc360f53eca31a0e676fd1101f673dda8da93454a12e23fc5f7a", size = 14406743, upload-time = "2025-05-17T21:31:41.087Z" },
+ { url = "https://files.pythonhosted.org/packages/4a/9f/0121e375000b5e50ffdd8b25bf78d8e1a5aa4cca3f185d41265198c7b834/numpy-2.2.6-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:3d70692235e759f260c3d837193090014aebdf026dfd167834bcba43e30c2a42", size = 5352616, upload-time = "2025-05-17T21:31:50.072Z" },
+ { url = "https://files.pythonhosted.org/packages/31/0d/b48c405c91693635fbe2dcd7bc84a33a602add5f63286e024d3b6741411c/numpy-2.2.6-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:481b49095335f8eed42e39e8041327c05b0f6f4780488f61286ed3c01368d491", size = 6889579, upload-time = "2025-05-17T21:32:01.712Z" },
+ { url = "https://files.pythonhosted.org/packages/82/5d/c00588b6cf18e1da539b45d3598d3557084990dcc4331960c15ee776ee41/numpy-2.2.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:41c5a21f4a04fa86436124d388f6ed60a9343a6f767fced1a8a71c3fbca038ff", size = 20875348, upload-time = "2025-05-17T21:34:39.648Z" },
+ { url = "https://files.pythonhosted.org/packages/66/ee/560deadcdde6c2f90200450d5938f63a34b37e27ebff162810f716f6a230/numpy-2.2.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de749064336d37e340f640b05f24e9e3dd678c57318c7289d222a8a2f543e90c", size = 14119362, upload-time = "2025-05-17T21:35:01.241Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/65/4baa99f1c53b30adf0acd9a5519078871ddde8d2339dc5a7fde80d9d87da/numpy-2.2.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:894b3a42502226a1cac872f840030665f33326fc3dac8e57c607905773cdcde3", size = 5084103, upload-time = "2025-05-17T21:35:10.622Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/89/e5a34c071a0570cc40c9a54eb472d113eea6d002e9ae12bb3a8407fb912e/numpy-2.2.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:71594f7c51a18e728451bb50cc60a3ce4e6538822731b2933209a1f3614e9282", size = 6625382, upload-time = "2025-05-17T21:35:21.414Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/5c/6657823f4f594f72b5471f1db1ab12e26e890bb2e41897522d134d2a3e81/numpy-2.2.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0811bb762109d9708cca4d0b13c4f67146e3c3b7cf8d34018c722adb2d957c84", size = 20867828, upload-time = "2025-05-17T21:37:56.699Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/9e/14520dc3dadf3c803473bd07e9b2bd1b69bc583cb2497b47000fed2fa92f/numpy-2.2.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:287cc3162b6f01463ccd86be154f284d0893d2b3ed7292439ea97eafa8170e0b", size = 14143006, upload-time = "2025-05-17T21:38:18.291Z" },
+ { url = "https://files.pythonhosted.org/packages/4f/06/7e96c57d90bebdce9918412087fc22ca9851cceaf5567a45c1f404480e9e/numpy-2.2.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:f1372f041402e37e5e633e586f62aa53de2eac8d98cbfb822806ce4bbefcb74d", size = 5076765, upload-time = "2025-05-17T21:38:27.319Z" },
+ { url = "https://files.pythonhosted.org/packages/73/ed/63d920c23b4289fdac96ddbdd6132e9427790977d5457cd132f18e76eae0/numpy-2.2.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:55a4d33fa519660d69614a9fad433be87e5252f4b03850642f88993f7b2ca566", size = 6617736, upload-time = "2025-05-17T21:38:38.141Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/9e/4bf918b818e516322db999ac25d00c75788ddfd2d2ade4fa66f1f38097e1/numpy-2.2.6-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0bca768cd85ae743b2affdc762d617eddf3bcf8724435498a1e80132d04879e6", size = 20963467, upload-time = "2025-05-17T21:40:44Z" },
+ { url = "https://files.pythonhosted.org/packages/61/66/d2de6b291507517ff2e438e13ff7b1e2cdbdb7cb40b3ed475377aece69f9/numpy-2.2.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:fc0c5673685c508a142ca65209b4e79ed6740a4ed6b2267dbba90f34b0b3cfda", size = 14225144, upload-time = "2025-05-17T21:41:05.695Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/25/480387655407ead912e28ba3a820bc69af9adf13bcbe40b299d454ec011f/numpy-2.2.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5bd4fc3ac8926b3819797a7c0e2631eb889b4118a9898c84f585a54d475b7e40", size = 5200217, upload-time = "2025-05-17T21:41:15.903Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/4a/6e313b5108f53dcbf3aca0c0f3e9c92f4c10ce57a0a721851f9785872895/numpy-2.2.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:fee4236c876c4e8369388054d02d0e9bb84821feb1a64dd59e137e6511a551f8", size = 6712014, upload-time = "2025-05-17T21:41:27.321Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/3b/d94a75f4dbf1ef5d321523ecac21ef23a3cd2ac8b78ae2aac40873590229/numpy-2.2.6-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0b605b275d7bd0c640cad4e5d30fa701a8d59302e127e5f79138ad62762c3e3d", size = 21040391, upload-time = "2025-05-17T21:44:35.948Z" },
+ { url = "https://files.pythonhosted.org/packages/17/f4/09b2fa1b58f0fb4f7c7963a1649c64c4d315752240377ed74d9cd878f7b5/numpy-2.2.6-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:7befc596a7dc9da8a337f79802ee8adb30a552a94f792b9c9d18c840055907db", size = 6786754, upload-time = "2025-05-17T21:44:47.446Z" },
+]
+
+[[package]]
+name = "numpy"
+version = "2.4.6"
+source = { registry = "https://pypi.org/simple" }
+resolution-markers = [
+ "python_full_version == '3.11.*' and sys_platform == 'darwin'",
+]
+sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/b3/49/ec46835a70be8fa6446c495126ac84fdb28cb2558e1620ffb87a10c8b64c/numpy-2.4.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0280e0356c0829a18d9de1cb7eee50ec22ca639878d7240307ca0943d73cd2c4", size = 16969194, upload-time = "2026-05-18T23:33:13.503Z" },
+ { url = "https://files.pythonhosted.org/packages/0e/0d/f5957185c0ee2f3e12f78715aa9e3b353fd83633316c8532b38faa37e3f6/numpy-2.4.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:110f8b71aacb688ec69062bb7f6938a0f8acb01b7c1c4beb453c65b6d234584d", size = 14964111, upload-time = "2026-05-18T23:33:17.795Z" },
+ { url = "https://files.pythonhosted.org/packages/ad/40/40a40ee0ddf7ceb782c49af278894b686e586d65d8c1889c8b5da01a3d7d/numpy-2.4.6-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:4cfe66903cc32a9921a6733d96b19bb6abf310397581bbad89c228f5abaf0ee8", size = 5469159, upload-time = "2026-05-18T23:33:20.654Z" },
+ { url = "https://files.pythonhosted.org/packages/63/13/f9a8046535cb21deae82f8d03de9617e08882d274fad2539630761888228/numpy-2.4.6-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:8155154c7c691289fe18f510b5d4657c68c67989f293f0535a91360392ff6538", size = 6798936, upload-time = "2026-05-18T23:33:22.987Z" },
+ { url = "https://files.pythonhosted.org/packages/95/2a/3d7b5ac8aac24feaf9ad7ed58f45b0bbc06d37e4338ae84c9f2298b570f9/numpy-2.4.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:001fbb8e08d942dd57599e781f2472269ee7f2755fae407b4f67b2f0b17da3f1", size = 16689119, upload-time = "2026-05-18T23:33:54.065Z" },
+ { url = "https://files.pythonhosted.org/packages/ea/12/92c4c131527599e8288d6918e888d88726f84d805d784b771f32408aeaef/numpy-2.4.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ebfb099f8dcf083deef3ac1ca4c1503f387cf76296fcb3816b66f5ecb5f54fdb", size = 14699246, upload-time = "2026-05-18T23:33:57.621Z" },
+ { url = "https://files.pythonhosted.org/packages/ad/fe/c0a6b7b2ca128a8fb228575147073b660656734b8ebe4d76c8fd748dcc79/numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3213d622a0283a39a93d188f3cf72b26862df52fbb4ca3697f51705016523d41", size = 5204410, upload-time = "2026-05-18T23:34:00.302Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/d4/9770d14ba719432bb90a421bfd443872ed0f70f7264b64bec12ea363d5fd/numpy-2.4.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:357cc07a6d7b0b182ff02249616a03742827ebb1277546b5c7cd7f7620a45698", size = 6551240, upload-time = "2026-05-18T23:34:02.852Z" },
+ { url = "https://files.pythonhosted.org/packages/fb/82/bdab26d7438c6791ca31b7c024ca37c1eab8b726ba236129005cd4a06e45/numpy-2.4.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:511dbaf848decaaaf4b4ca48032619fb3138710c4bf7da7617765edad1ef96b0", size = 16684648, upload-time = "2026-05-18T23:34:29.41Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/30/a80189bcc7f5e4258b3fbc3968d909d1756f54d023299ecc39ad6fdb9ef8/numpy-2.4.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bf162abab1c1a736333192707cef898e735a5ca00f38f27eeedf44b39d9e85eb", size = 14693902, upload-time = "2026-05-18T23:34:33.013Z" },
+ { url = "https://files.pythonhosted.org/packages/97/12/70b5d0d7c15e1ebb8a6a84a8caa1d19e181d84fb58bb6d70aca29099dec1/numpy-2.4.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:043191bfa8eab18c776647b62723ac9dddece59743b13f49b2016094129c2b3f", size = 5198992, upload-time = "2026-05-18T23:34:36.132Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/8c/ebd2a8f8a83541f8d38cc5667e8c2b69cecfd30da6e45693e8158857d44b/numpy-2.4.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:6180d8b35af935aed8ece3a85e0a43f87393ae0ac87c8d2c8bd2c993f7270ef3", size = 6546944, upload-time = "2026-05-18T23:34:38.484Z" },
+ { url = "https://files.pythonhosted.org/packages/63/6d/cc5619247c8f4204e507f5883528372e4ac4bb189e579fb859a12e480b1f/numpy-2.4.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:112b06a867b235ef466ed3508ddf0238050df9c727cafb5301ac385b899189a1", size = 14821197, upload-time = "2026-05-18T23:35:05.468Z" },
+ { url = "https://files.pythonhosted.org/packages/00/58/f1c39161c87d9e9bed660f1ed4bafc0e403d5ec9650b6dd77aead07d489b/numpy-2.4.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:eaf7fa2de5c0be8ae6ff8e9bea2ccd725e980541244521d8d4b5f3354a27babe", size = 5326287, upload-time = "2026-05-18T23:35:08.693Z" },
+ { url = "https://files.pythonhosted.org/packages/af/57/3917ab0fd97f271a8694513581b8a36c655f111c446852c302f04ccdb6fc/numpy-2.4.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:7265a2f3d436e54ef9f2b52b5c937e6be778781bd97a590319d7348f1c1ca997", size = 6646763, upload-time = "2026-05-18T23:35:11.459Z" },
+ { url = "https://files.pythonhosted.org/packages/f8/91/3ab2044d05fd16d343c5ac2e69b127f1b2854040dd20b193257c78028bd3/numpy-2.4.6-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06ca2f61ec4385a07a6977c55ba998a4466c123642b4a32694d3128fce18c079", size = 16683458, upload-time = "2026-05-18T23:35:38.353Z" },
+ { url = "https://files.pythonhosted.org/packages/8e/62/764ce66fa4147ae6d73071a3abf804ffe606f174618697c571acdf26a7c9/numpy-2.4.6-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:38efbc8de75c7a0fc1ac190162d892787f3f47b57cc291231aafee36b80982b7", size = 14704559, upload-time = "2026-05-18T23:35:42.14Z" },
+ { url = "https://files.pythonhosted.org/packages/60/61/23f27c172f022e04025b7dc2367f4d63c1a398120607ec896228649a6f48/numpy-2.4.6-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:d581b735e177fdcdce6fed8e7e8880a3fb6ee4e3653a3ac6af01c6f4c03effc5", size = 5209716, upload-time = "2026-05-18T23:35:45.377Z" },
+ { url = "https://files.pythonhosted.org/packages/03/71/21cf70dc6ea3e3acb95fc53a265b2fc248b981f0194ceb5b475271b8809d/numpy-2.4.6-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:0a041d3d761dc3c35cc56ce0351506a02bcbc25f7b169f652435141a17db9096", size = 6543947, upload-time = "2026-05-18T23:35:47.926Z" },
+ { url = "https://files.pythonhosted.org/packages/30/34/ec28d1aa8115971537c01469ab2011ee96827930f0a124de1000cc2a7ed7/numpy-2.4.6-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ece3d2cfe132e7d51f44a832b303895e6f2d499c5e74dfbdb06ee246147a304a", size = 14823672, upload-time = "2026-05-18T23:36:16.473Z" },
+ { url = "https://files.pythonhosted.org/packages/16/bd/f6d1fede4e54e8042a7ff97bb495510f3c220f94bcd9e8b228e87c92cc0d/numpy-2.4.6-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:e3e5193ef5a3dc73bceee50f7fdc2c90dbb76c42df8d8fae3d1067a583df579e", size = 5328731, upload-time = "2026-05-18T23:36:19.767Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/f0/e105b9e2fd728a9910103884decd6951d9dd73896b914a98d9a231de02ee/numpy-2.4.6-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:17f9ade344e7d9b464a084d69bcf18fc691cb1db67c62ed80820bf4926d78f0e", size = 6649805, upload-time = "2026-05-18T23:36:22.266Z" },
+ { url = "https://files.pythonhosted.org/packages/de/12/b422cc84439adc0d00de605bf4a308890ae5c26f2c71fbd73e5d08fbb0dd/numpy-2.4.6-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:55cced7c52e981362f708ad635198e97a752dfba412cc03c23bbf3bd8d5cd662", size = 16847511, upload-time = "2026-05-18T23:36:50.673Z" },
+ { url = "https://files.pythonhosted.org/packages/44/53/f481bef68011740f8849418d82db07230e825013f31f4eef5ba5b805316a/numpy-2.4.6-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d6da64deb6b8ed903e7560180a92f2d804ee1ba5eeb849ac2748b8c1aba1f6d7", size = 14889064, upload-time = "2026-05-18T23:36:53.879Z" },
+ { url = "https://files.pythonhosted.org/packages/7f/57/42ed575c10ced8af951d426bc4e1f8aff16fd851db33f067036215a7f860/numpy-2.4.6-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:68a5124b13fa6cc2086764a20005d30bc0548146f7f5322f02fce212ca14317f", size = 5394157, upload-time = "2026-05-18T23:36:57.194Z" },
+ { url = "https://files.pythonhosted.org/packages/6a/ef/f66cc724fcc36c1e364c67f51ae9146090b8b584f27d58b97fdae3edd737/numpy-2.4.6-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:948424b06129ce883307e8cff868c31396d8dc7630a59c61d70d98dbe70f222c", size = 6708728, upload-time = "2026-05-18T23:36:59.575Z" },
+]
+
+[[package]]
+name = "numpy"
+version = "2.5.3"
+source = { registry = "https://pypi.org/simple" }
+resolution-markers = [
+ "python_full_version >= '3.12' and sys_platform == 'darwin'",
+]
+sdist = { url = "https://files.pythonhosted.org/packages/13/01/11703282db468b85f6f7b8c7f22d058de5970d5c7e60a3a8aaa313c3de36/numpy-2.5.3.tar.gz", hash = "sha256:df2d5874ff183595a4ba404edd04f6bd9b5505c1d7708573f6a6c17489a67563", size = 20791231, upload-time = "2026-09-06T16:27:47.073Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/d6/50/8fdbb16af64895706a45f06a4068e29db732ec180f3c1375f14123359138/numpy-2.5.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cb189f09db39283b26bfd061ec16189e14f71c6755207f72a0f7540867afe5b9", size = 16994982, upload-time = "2026-09-06T16:24:29.244Z" },
+ { url = "https://files.pythonhosted.org/packages/60/39/789131c1188c078dcb3a1692e72e1e050c68b88ffe72c9ccaac9bcd7a9cd/numpy-2.5.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f59a878c33d6b88122d80d239bb3b845d58708750b0cb06a09aebb9b18ec696c", size = 12009327, upload-time = "2026-09-06T16:24:32.491Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/59/a312e95696e5f601914dd8b6dd844692ba61670807417e24b68e337b5c70/numpy-2.5.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:a72f874bc9e10e4b8f80426fb49716d5141f64442a0c8418065093ec8017fbb0", size = 5445405, upload-time = "2026-09-06T16:24:35.071Z" },
+ { url = "https://files.pythonhosted.org/packages/30/d0/5623a1707ed4fe16e3909fe3cf5ee3da004ae677ad23d83bbf3adf1a6faf/numpy-2.5.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:fc36dc566135b5eceec4cf89758fcb719266a019ef07dae1754ae7c9f617ef3e", size = 6783213, upload-time = "2026-09-06T16:24:37.253Z" },
+ { url = "https://files.pythonhosted.org/packages/79/e5/8fb89cd46d14e35699d13bf943a5f5f441ecee8667120a1f6105ab89e349/numpy-2.5.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:66a78fe4556c60aceda5916f9eacd638b18e9e681016ec302dcb4682d6d4d034", size = 16991061, upload-time = "2026-09-06T16:25:00.411Z" },
+ { url = "https://files.pythonhosted.org/packages/2f/06/9dc9e48b5e5e941c8b10350c5ff2d721da42a20517d911d15544246775ff/numpy-2.5.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92f30e89b8ee0ecf363033576c422b2f58fed6a80bed0aa48dff6d14c654663e", size = 12003676, upload-time = "2026-09-06T16:25:03.475Z" },
+ { url = "https://files.pythonhosted.org/packages/ab/2a/98282aa5b8f58b1157d440bb6282eed47e3632a5de53a714fbab17e659fe/numpy-2.5.3-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:f9a2353b37a1a9e78fd82b27ad7e2a32a2d036604d18f02b05e3136c62ca3b09", size = 5439695, upload-time = "2026-09-06T16:25:05.978Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/f9/b6533d777be9d6ffd29dc1be0867e563e6e8cc9a220ff1b716adc317f060/numpy-2.5.3-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:ccbc4665079665c3cf3bab4db9f6b095370cd6437d66be549b6c2a1fd19e1958", size = 6779395, upload-time = "2026-09-06T16:25:08.599Z" },
+ { url = "https://files.pythonhosted.org/packages/70/78/cf416f15dc29375a229d9dfebf8db6e313f291580b39fa1a568b6052bb07/numpy-2.5.3-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:350ba9783ce969cf9f7ce6e6a9a58e1a6e2a19ca025b7ee448c4db727706212a", size = 16998686, upload-time = "2026-09-06T16:25:33.171Z" },
+ { url = "https://files.pythonhosted.org/packages/9e/59/abcc2d8def4fd60eec7d87f92d27c13448ffd9ab14339bcc63a0d7a2fdea/numpy-2.5.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:012e66aca395d795496446e52aeeb5866312a5d4d3f27da270e5a0b43f70dc5c", size = 12013862, upload-time = "2026-09-06T16:25:36.748Z" },
+ { url = "https://files.pythonhosted.org/packages/94/75/4640d2d6e4b64a049e48425a82728a41ef4adb61332d2cba68055774878b/numpy-2.5.3-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:adc1ada2662f8a5f960b8a10d9986897e7499ef07e06d4cfe7197f8cce923c07", size = 5449793, upload-time = "2026-09-06T16:25:39.476Z" },
+ { url = "https://files.pythonhosted.org/packages/96/cd/625b57ae33d4ca560f32cc0b47b4a5922146d9beb998ddf773900d440a73/numpy-2.5.3-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:54a115e5a73b8fc44f0cebef486365a1894b5c9760685d4558b72b7c3eb846e0", size = 6785176, upload-time = "2026-09-06T16:25:42.069Z" },
+ { url = "https://files.pythonhosted.org/packages/49/c4/af8bc08a7ef4e1529a7c0cf24969accce316b783999802089a581ec99272/numpy-2.5.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ac7bb1c52d445bd4f8f7f97fefe6abc3a084dc4d63df50d79b17fa2b78e89297", size = 12132668, upload-time = "2026-09-06T16:26:07.138Z" },
+ { url = "https://files.pythonhosted.org/packages/c5/ae/0f15eb56d4ec5e13c1f7ff04ff407f997d1acbadb45d3e1f2e2645a8f43c/numpy-2.5.3-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:e6ab667ba76450084eb64013762c438ea76d9d29cc676dcd6c2e9892ba37f841", size = 5568580, upload-time = "2026-09-06T16:26:09.828Z" },
+ { url = "https://files.pythonhosted.org/packages/23/fb/c72a8f25d4b6e96c354e7ab45ace3b27dc11e5d6a13b6c7d0cd6b08bf112/numpy-2.5.3-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:f7fabeb6cea87d65f3b926de33d03fb016cfdc29314c90974383b5582ae72891", size = 6882634, upload-time = "2026-09-06T16:26:12.524Z" },
+ { url = "https://files.pythonhosted.org/packages/45/56/78194492883ff5eec90423fe56a3a44b154da047d88a6307f629713c584f/numpy-2.5.3-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:a6391fafaba97500887132cd582abc6e19452b1ac775a47caa7b24490e152058", size = 16996531, upload-time = "2026-09-06T16:26:37.287Z" },
+ { url = "https://files.pythonhosted.org/packages/11/39/dd55c0af90bbab564b09ae3b0aa60ec5c02b900fa4f1ba23440525c8b32d/numpy-2.5.3-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:09d5a423c71ad5feb5625844ad58050e35df43871004b52ac9c0ad44a56775be", size = 12012569, upload-time = "2026-09-06T16:26:40.707Z" },
+ { url = "https://files.pythonhosted.org/packages/b6/51/04f67d32e4862b281b1cb84ceeaed3421189a84fb6fb51a391cd6d5009f7/numpy-2.5.3-cp315-cp315-macosx_14_0_arm64.whl", hash = "sha256:f9579f383d1bf9df80081e72760e84960a7fd4f88cf0c9e535a8597c9bb646f5", size = 5448498, upload-time = "2026-09-06T16:26:43.435Z" },
+ { url = "https://files.pythonhosted.org/packages/a3/c9/25b4dc0dd1344ec26c7319e84fd4e9809d2b5628f4e12decd618036e5178/numpy-2.5.3-cp315-cp315-macosx_14_0_x86_64.whl", hash = "sha256:86bff898a431c0fb71f7610b75726e75a54d47b37edc9d537f48de63bb3c0b90", size = 6783026, upload-time = "2026-09-06T16:26:46.374Z" },
+ { url = "https://files.pythonhosted.org/packages/44/bf/a97ffb01e41d50a32a9177aef942a4d0e389a3daf451d04e5f38ef6afb87/numpy-2.5.3-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:6cef4bb1706dfec49243c05d921eefb4e190d41e2528b30d8035ea1f36b4c24a", size = 17090092, upload-time = "2026-09-06T16:27:12.907Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/24/136c02f2c2af9a067a84d0c3aa10c99012c0476fa5066732fa4a4202557d/numpy-2.5.3-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:d1c89973648c85069c5046ad460f7b8a00218b29a2e42359ac8cc63e9ab94832", size = 12129429, upload-time = "2026-09-06T16:27:16.089Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/6c/b47582d6597789bf946d5efbeb6b9e56fd8bcbd5efc6fbf51dbe1ea31eb3/numpy-2.5.3-cp315-cp315t-macosx_14_0_arm64.whl", hash = "sha256:214045a5bf00113a146ab9ee9730c44501af6723cdf1f6830932f7b5ef2e7af0", size = 5565452, upload-time = "2026-09-06T16:27:19.868Z" },
+ { url = "https://files.pythonhosted.org/packages/be/b4/ef3cc6da73774202d4deae16bb321fd8298a4e0561e3539f8c4be237d916/numpy-2.5.3-cp315-cp315t-macosx_14_0_x86_64.whl", hash = "sha256:8617bbfae4486cf99c9f899966699428d19da931d06ca94ad3da986c76e15997", size = 6876736, upload-time = "2026-09-06T16:27:22.232Z" },
+]
+
+[[package]]
+name = "opencv-python"
+version = "4.14.0.94"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },
+ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" },
+ { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/ed/e8/c2959c0f969ea4ae96b55ad10c108c0410de4e8b3550d9941a4cfdd52703/opencv_python-4.14.0.94.tar.gz", hash = "sha256:afadc76a38a07713a4c2b4702da917cf0ed489be57e2a40a34e670189731de7d", size = 96400225, upload-time = "2026-07-28T19:23:09.546Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/19/91/e4fd7c2b64fda9792bc1f5dcb5a6cbdb54d50c3a2fa9dccc3943fd47afcf/opencv_python-4.14.0.94-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:04456937c8f12ca64ff94df8bfd813ca98f5c9767da792948969a759c716ebe2", size = 46491087, upload-time = "2026-07-29T03:52:01.842Z" },
+ { url = "https://files.pythonhosted.org/packages/f4/a7/8895ca8731f741925acf238f87ccb21fa8f47378d5291792e932b9a4ab71/opencv_python-4.14.0.94-cp37-abi3-macosx_14_0_x86_64.whl", hash = "sha256:6a49842cc0ba9f43e35a289e61c0e15a1f8be8df60145ee5c7d42593b0d4f4b8", size = 33084035, upload-time = "2026-07-28T20:05:52.633Z" },
+]
+
+[[package]]
+name = "packaging"
+version = "26.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" },
+]
+
+[[package]]
+name = "pathspec"
+version = "1.1.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" },
+]
+
+[[package]]
+name = "pdoc"
+version = "16.0.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "jinja2" },
+ { name = "markdown2" },
+ { name = "markupsafe" },
+ { name = "pygments" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/ac/fe/ab3f34a5fb08c6b698439a2c2643caf8fef0d61a86dd3fdcd5501c670ab8/pdoc-16.0.0.tar.gz", hash = "sha256:fdadc40cc717ec53919e3cd720390d4e3bcd40405cb51c4918c119447f913514", size = 111890, upload-time = "2025-10-27T16:02:16.345Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/16/a1/56a17b7f9e18c2bb8df73f3833345d97083b344708b97bab148fdd7e0b82/pdoc-16.0.0-py3-none-any.whl", hash = "sha256:070b51de2743b9b1a4e0ab193a06c9e6c12cf4151cf9137656eebb16e8556628", size = 100014, upload-time = "2025-10-27T16:02:15.007Z" },
+]
+
+[[package]]
+name = "pluggy"
+version = "1.6.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
+]
+
+[[package]]
+name = "pygments"
+version = "2.21.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
+]
+
+[[package]]
+name = "pyobjc-core"
+version = "12.2.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/a5/78/abc4ce5920305780aeb36b4067a86253378b36e29ba96673a3deb02eb03a/pyobjc_core-12.2.2.tar.gz", hash = "sha256:3906452339cd06a3bb07df103c2511d4cb0f7a22d8771c0b802eba15d9a642b6", size = 1067701, upload-time = "2026-08-11T19:43:39.059Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/00/1d/baf7197cee12f32a8eb9f8633093da1ec1ea702b0e1346bc1c7bfe022673/pyobjc_core-12.2.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:56c6c39f1de059fcbb174ebca5525505fc8feaa89be2a28c329bf09b6b25ee75", size = 6483051, upload-time = "2026-08-11T13:55:45.262Z" },
+ { url = "https://files.pythonhosted.org/packages/ce/8e/18284fec7913ef78b25a1c97f9689ebef98bc14038386191491516abeb25/pyobjc_core-12.2.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b9cdd686e32db8e451feb19f8a85bc4cd52c2893103881d04aca51e1f35371d1", size = 6481574, upload-time = "2026-08-11T14:13:27.153Z" },
+ { url = "https://files.pythonhosted.org/packages/86/b2/bbf7f049880ab40d110e66f25122342a1f6c98d6fe3c59bb98985503c660/pyobjc_core-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:122e6ad302a2abf5d4d4adb0156db751600ddf2768441696cba17b31323085e7", size = 6427637, upload-time = "2026-08-11T14:51:36.038Z" },
+ { url = "https://files.pythonhosted.org/packages/1b/ed/a8bf040caf3704023d74086b7fb96cf4ed2e844e24bd94e5248ba214b700/pyobjc_core-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:950bd2d9c74634398c4e3d24ef2f213d4e23d705083697464fa67afedc53c1ad", size = 6427113, upload-time = "2026-08-11T15:04:39.424Z" },
+ { url = "https://files.pythonhosted.org/packages/e7/5a/760f8b9e116edd43c57e33844dc17619158fbdd311250d4209910192d72d/pyobjc_core-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:3772b406edb3ff78171530a17cda1c4a7817f87b87ded0d8715b3fa664df16db", size = 6666817, upload-time = "2026-08-11T19:30:17.01Z" },
+ { url = "https://files.pythonhosted.org/packages/13/37/486d38a173b0b8dce973a3e13c74cf402ed1b8621586b5963bc9efd49a48/pyobjc_core-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:2062e8ad30a310441cd022544a897553408bebeaa7820d5edba3c96fd7fd693b", size = 6421184, upload-time = "2026-08-11T19:30:21.081Z" },
+ { url = "https://files.pythonhosted.org/packages/04/f1/d138fd9b9a66ea8db56a8138b77d3413b85da3defe13363a19f364f85529/pyobjc_core-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:2c7ef3d2f865b4b3ebb14ec3556f7a3e8abb6d130c67275cd9daa08dbd6e4e4e", size = 6671824, upload-time = "2026-08-11T19:30:25.005Z" },
+ { url = "https://files.pythonhosted.org/packages/d5/85/577e2265cccf59daf48c460f0a8deeaf7dbe2991227a8859ab1eeab4945e/pyobjc_core-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:89acc6bc13aaa6e3f52b0ce652ede7e201edb6bf062741b246b0c5a44582f25f", size = 6477694, upload-time = "2026-08-11T19:30:28.821Z" },
+ { url = "https://files.pythonhosted.org/packages/77/0a/bd9f830c64c6f334530831e75c01bfe0a770a3fbb00fddc70329223118b3/pyobjc_core-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:59a77038ebe0ab1240f61c341e7fb67b8674f2b4cd41bc71a6472511a12b50f7", size = 6712233, upload-time = "2026-08-11T19:30:33.032Z" },
+]
+
+[[package]]
+name = "pyobjc-framework-cocoa"
+version = "12.2.2"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "pyobjc-core" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/75/76/49c6da2c6a831020b4854ba20079d5a1030474bffc776b7b73c2eeff8c15/pyobjc_framework_cocoa-12.2.2.tar.gz", hash = "sha256:c96c0ef69a71afbbb0e6a7d594b455c5fe47d62e0db376ee7a2b4b828c16ace9", size = 3132831, upload-time = "2026-08-11T19:44:02.288Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/e1/dd/aba439652cae293a736680ef5ed5cc29419adbbac1c6d4555b910741d516/pyobjc_framework_cocoa-12.2.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5a751c8033a3b51f7996f0327e0675eb44dcfdfe7920fae01e3d78b662723fff", size = 387296, upload-time = "2026-08-11T19:32:40.684Z" },
+ { url = "https://files.pythonhosted.org/packages/f6/a7/370f12143661dff66f2c68a735938afab6530aa3b153f6a7a6f12b5eabab/pyobjc_framework_cocoa-12.2.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:851dca4c16e70b405e5cd5a8c166cf7c445ae54a4cdd95ce9a523803172f32d1", size = 387300, upload-time = "2026-08-11T19:32:42.043Z" },
+ { url = "https://files.pythonhosted.org/packages/fd/2f/b67e73d8bc367e03fe7861cd9c49fff9dcfa6db83bc0630c0adcfb25b7fa/pyobjc_framework_cocoa-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e106f395531e67694376b0f1184612cbeea3ec8b9bf56b55ef41d026171d2a2d", size = 388117, upload-time = "2026-08-11T19:32:43.161Z" },
+ { url = "https://files.pythonhosted.org/packages/db/e1/5d9b04ebb60042b9cb49adc2d33115e2f2c2e4ff7d548017bfaff8b7f536/pyobjc_framework_cocoa-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:600b1723184ca094931330e79355274949965460e23de38628d601b5a967baf9", size = 388181, upload-time = "2026-08-11T19:32:44.537Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/25/2a343357d5fe09bbe9c0e294dc03450866a0d6c1792fad36b6bcc00174c0/pyobjc_framework_cocoa-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:875f2aad73963faa81a6b36ae674fd494a4658d6d999e1075e0e2aca3d2391df", size = 392275, upload-time = "2026-08-11T19:32:45.631Z" },
+ { url = "https://files.pythonhosted.org/packages/1f/1a/b99521999b9f54b89aad928ddff0faad507abfe33bc46599454bfa48a4b2/pyobjc_framework_cocoa-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:889d7bbd4ba2d4941078bfbbfb882138e51dbead27df006abfe0f2e0d49b5b2e", size = 388368, upload-time = "2026-08-11T19:32:46.781Z" },
+ { url = "https://files.pythonhosted.org/packages/6d/26/0c697dbc73dcc76bc0f68ea5aeed25bf7b05217df5102659e878501b2d5f/pyobjc_framework_cocoa-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:de69c5933750f3a4599ed962eccd92b6a71914c7e4318dacc7895738a8ae60d7", size = 392404, upload-time = "2026-08-11T19:32:47.918Z" },
+ { url = "https://files.pythonhosted.org/packages/df/82/502f740fd8f4e9ef741c9d40ba67467ab2c8196f2c09dcba12936d28a4fd/pyobjc_framework_cocoa-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:0e8ace0d44a00d281281a723d17fcd05eea7544a38a6a512e1fd018ddb7aece2", size = 388585, upload-time = "2026-08-11T19:32:49.171Z" },
+ { url = "https://files.pythonhosted.org/packages/7d/3b/07ce3c0ab8d1e9e1bed74fea1bf1cce73527a365a7a23c755051d3be9865/pyobjc_framework_cocoa-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8fe5b2e79c9530f667b4e58a87a3a15ea62f86a5d19eec405517ecbd4f454868", size = 392693, upload-time = "2026-08-11T19:32:50.283Z" },
+]
+
+[[package]]
+name = "pyobjc-framework-metal"
+version = "12.2.2"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "pyobjc-core" },
+ { name = "pyobjc-framework-cocoa" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/b8/1c/c15b606d805a392696806f119ad3ac42ff3bfbfa4b3a46aaebebffc99076/pyobjc_framework_metal-12.2.2.tar.gz", hash = "sha256:0e7289281cb44ac9f4379ad9c6a6602a7a15fd491acc35949cdc05c5b9790b94", size = 238970, upload-time = "2026-08-11T19:44:55.48Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/c0/f3/5551d6fefa29638d8be98d42e44e6698fa2730939058257d62a3b0cf530a/pyobjc_framework_metal-12.2.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:19e8c78597679138df47c237e492aaef24f1981061bc72c73a12e7969b517130", size = 76012, upload-time = "2026-08-11T19:38:17.618Z" },
+ { url = "https://files.pythonhosted.org/packages/94/4a/92f2d1af37dbebddf33fed9605e1f80515f03dbf211693f4cd7f890fa6f5/pyobjc_framework_metal-12.2.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9e56862fd12eb3d3da429f15d6721f966d5791e27419ea0fa08f5f3dd0981fe8", size = 76005, upload-time = "2026-08-11T19:38:18.64Z" },
+ { url = "https://files.pythonhosted.org/packages/ef/ce/3a1869818af2140f7bcbb1959bf2ee4b93abe4d5bc51fc7fa1acae6261a9/pyobjc_framework_metal-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:fb0421195ded2a02a83c94dbc1bf815b4a879c51804c43bcaf4680a6dc1b4aa2", size = 75928, upload-time = "2026-08-11T19:38:19.474Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/36/c5c732b4b8e47aab7c988c26a523b3a01f1052721d515243f135a593ab25/pyobjc_framework_metal-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:121e5501f850999982a7cdc3cce04fa48ce5e1005c6757fa696e1d10d960a84f", size = 75951, upload-time = "2026-08-11T19:38:20.294Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/2e/9a1a2ae62332d6a91391aef6dbf1be458a079a390513dc89e1d66e2dec1b/pyobjc_framework_metal-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:64865408c918872470fd52b3f92a9287bce9fe1e9f4bfb5289f8a02e2bdf2077", size = 76511, upload-time = "2026-08-11T19:38:21.259Z" },
+ { url = "https://files.pythonhosted.org/packages/c7/b0/9458ecf710f5f06e33ec3e614d8f7784cca60c38fe04573b03702fc968d2/pyobjc_framework_metal-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:c317b2a3312e5f5d753a554496669815de71c50481ab393d8fc99e63da46db3c", size = 75953, upload-time = "2026-08-11T19:38:22.08Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/0a/6f4e256e5d6a4f0c4359e4bf1a3e5d82b6635bd7eedd8eb1da90812281f6/pyobjc_framework_metal-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:6f4d6001e86b28db2ab63e6a9d52741073e68f2b9e705e9a2e27b9ba266b93fa", size = 76568, upload-time = "2026-08-11T19:38:23.35Z" },
+ { url = "https://files.pythonhosted.org/packages/2e/d8/c25faaadbb63497711cf28e189a330bc957d013451201c63107ce811607a/pyobjc_framework_metal-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:56edbd775af718d6cd0a3cb3eecc0abbb0cfc72ae656a0d2317e794050f38e1e", size = 76078, upload-time = "2026-08-11T19:38:24.183Z" },
+ { url = "https://files.pythonhosted.org/packages/de/ac/d267ad8f66d7e612b0ddb4475a624d4dae014f9d7638f8143eca1351a7be/pyobjc_framework_metal-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:c77574aad25613735827b9622dc56ae8a7f408bb101d376fb89304eec104530d", size = 76703, upload-time = "2026-08-11T19:38:25.045Z" },
+]
+
+[[package]]
+name = "pyopengl"
+version = "3.1.10"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/6f/16/912b7225d56284859cd9a672827f18be43f8012f8b7b932bc4bd959a298e/pyopengl-3.1.10.tar.gz", hash = "sha256:c4a02d6866b54eb119c8e9b3fb04fa835a95ab802dd96607ab4cdb0012df8335", size = 1915580, upload-time = "2025-08-18T02:33:01.76Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/de/e4/1ba6f44e491c4eece978685230dde56b14d51a0365bc1b774ddaa94d14cd/pyopengl-3.1.10-py3-none-any.whl", hash = "sha256:794a943daced39300879e4e47bd94525280685f42dbb5a998d336cfff151d74f", size = 3194996, upload-time = "2025-08-18T02:32:59.902Z" },
+]
+
+[[package]]
+name = "pytest"
+version = "9.1.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "exceptiongroup", marker = "python_full_version < '3.11'" },
+ { name = "iniconfig" },
+ { name = "packaging" },
+ { name = "pluggy" },
+ { name = "pygments" },
+ { name = "tomli", marker = "python_full_version < '3.11'" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" },
+]
+
+[[package]]
+name = "ruff"
+version = "0.16.9"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/96/bf/c935ca98e73fe8ce65b87ef08a280c0c1e85295d569228c15e87d8fdfaf1/ruff-0.16.9.tar.gz", hash = "sha256:12b625c6cfba78d285d9f48eda5f053374f1e53cb10ef17342a383750db99161", size = 4948764, upload-time = "2026-09-24T20:37:49.416Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/a5/27/7bf51f5a7aa375e9f339280a303aab44ca75dc1525f1cdc5991761685b0f/ruff-0.16.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:a5f27be168556594a86d2f415db0cf43f5291917849318f873c7e2791f7a8c67", size = 10236360, upload-time = "2026-09-24T20:37:16.049Z" },
+ { url = "https://files.pythonhosted.org/packages/b6/63/09659283f92f02dff45809da194a70da2f688d87c55d8875c4fae3536072/ruff-0.16.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:1632eb1d6197f33bd00b1acbc5b71009e89a8895c158e2d2b03a834fac964ab6", size = 9892940, upload-time = "2026-09-24T20:37:17.957Z" },
+]
+
+[[package]]
+name = "syphon-python"
+version = "0.2.0"
+source = { editable = "." }
+dependencies = [
+ { name = "pyobjc-core" },
+ { name = "pyobjc-framework-cocoa" },
+ { name = "pyobjc-framework-metal" },
+]
+
+[package.optional-dependencies]
+numpy = [
+ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },
+ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" },
+ { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
+]
+opengl = [
+ { name = "pyopengl" },
+]
+
+[package.dev-dependencies]
+dev = [
+ { name = "hatchling" },
+ { name = "packaging" },
+ { name = "pytest" },
+ { name = "ruff" },
+]
+docs = [
+ { name = "pdoc" },
+]
+examples = [
+ { name = "glfw" },
+ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" },
+ { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.11.*'" },
+ { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" },
+ { name = "opencv-python" },
+]
+test = [
+ { name = "hatchling" },
+ { name = "packaging" },
+ { name = "pytest" },
+]
+
+[package.metadata]
+requires-dist = [
+ { name = "numpy", marker = "extra == 'numpy'", specifier = ">=2,<3" },
+ { name = "pyobjc-core", specifier = "~=12.2.2" },
+ { name = "pyobjc-framework-cocoa", specifier = "~=12.2.2" },
+ { name = "pyobjc-framework-metal", specifier = "~=12.2.2" },
+ { name = "pyopengl", marker = "extra == 'opengl'", specifier = ">=3.1.10,<4" },
+]
+provides-extras = ["opengl", "numpy"]
+
+[package.metadata.requires-dev]
+dev = [
+ { name = "hatchling", specifier = ">=1.27,<2" },
+ { name = "packaging", specifier = ">=25" },
+ { name = "pytest", specifier = ">=8" },
+ { name = "ruff", specifier = ">=0.12" },
+]
+docs = [{ name = "pdoc", specifier = ">=16,<17" }]
+examples = [
+ { name = "glfw", specifier = ">=2.9,<3" },
+ { name = "numpy", specifier = ">=2,<3" },
+ { name = "opencv-python", specifier = ">=4.12,<5" },
+]
+test = [
+ { name = "hatchling", specifier = ">=1.27,<2" },
+ { name = "packaging", specifier = ">=25" },
+ { name = "pytest", specifier = ">=8" },
+]
+
+[[package]]
+name = "tomli"
+version = "2.4.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/22/de/48c59722572767841493b26183a0d1cc411d54fd759c5607c4590b6563a6/tomli-2.4.1.tar.gz", hash = "sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f", size = 17543, upload-time = "2026-03-25T20:22:03.828Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/f4/11/db3d5885d8528263d8adc260bb2d28ebf1270b96e98f0e0268d32b8d9900/tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30", size = 154704, upload-time = "2026-03-25T20:21:10.473Z" },
+ { url = "https://files.pythonhosted.org/packages/6d/f7/675db52c7e46064a9aa928885a9b20f4124ecb9bc2e1ce74c9106648d202/tomli-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a", size = 149454, upload-time = "2026-03-25T20:21:12.036Z" },
+ { url = "https://files.pythonhosted.org/packages/c1/ba/42f134a3fe2b370f555f44b1d72feebb94debcab01676bf918d0cb70e9aa/tomli-2.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a", size = 155924, upload-time = "2026-03-25T20:21:21.626Z" },
+ { url = "https://files.pythonhosted.org/packages/dc/c7/62d7a17c26487ade21c5422b646110f2162f1fcc95980ef7f63e73c68f14/tomli-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085", size = 150018, upload-time = "2026-03-25T20:21:23.002Z" },
+ { url = "https://files.pythonhosted.org/packages/07/06/b823a7e818c756d9a7123ba2cda7d07bc2dd32835648d1a7b7b7a05d848d/tomli-2.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54", size = 155866, upload-time = "2026-03-25T20:21:31.65Z" },
+ { url = "https://files.pythonhosted.org/packages/14/6f/12645cf7f08e1a20c7eb8c297c6f11d31c1b50f316a7e7e1e1de6e2e7b7e/tomli-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a", size = 149887, upload-time = "2026-03-25T20:21:33.028Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/fb/9a5c8d27dbab540869f7c1f8eb0abb3244189ce780ba9cd73f3770662072/tomli-2.4.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf", size = 155726, upload-time = "2026-03-25T20:21:42.23Z" },
+ { url = "https://files.pythonhosted.org/packages/62/05/d2f816630cc771ad836af54f5001f47a6f611d2d39535364f148b6a92d6b/tomli-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac", size = 149859, upload-time = "2026-03-25T20:21:43.386Z" },
+ { url = "https://files.pythonhosted.org/packages/45/4b/b877b05c8ba62927d9865dd980e34a755de541eb65fffba52b4cc495d4d2/tomli-2.4.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4", size = 164263, upload-time = "2026-03-25T20:21:52.543Z" },
+ { url = "https://files.pythonhosted.org/packages/24/79/6ab420d37a270b89f7195dec5448f79400d9e9c1826df982f3f8e97b24fd/tomli-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c", size = 160736, upload-time = "2026-03-25T20:21:53.674Z" },
+ { url = "https://files.pythonhosted.org/packages/7b/61/cceae43728b7de99d9b847560c262873a1f6c98202171fd5ed62640b494b/tomli-2.4.1-py3-none-any.whl", hash = "sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe", size = 14583, upload-time = "2026-03-25T20:22:03.012Z" },
+]
+
+[[package]]
+name = "tomlkit"
+version = "0.15.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/94/96/e07752635b98536177fa1f37671c8f3cdde2e724c6bcf6034b2cfb571565/tomlkit-0.15.1.tar.gz", hash = "sha256:e25bbf38843005246210a12982776f27f99cb9be67160e14434d0c0d21ee1e97", size = 180129, upload-time = "2026-07-17T01:48:04.562Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/13/bc/8c13eb66537dce1d2bd3a57132902f38d0e7f5bb46fa9f4daed9fe9d76ee/tomlkit-0.15.1-py3-none-any.whl", hash = "sha256:177a05aece5a8ca5266fd3c448abb47b8d352f09d477d3ca8332db4d89b24304", size = 49449, upload-time = "2026-07-17T01:48:05.728Z" },
+]
+
+[[package]]
+name = "trove-classifiers"
+version = "2026.9.21.13"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/bf/93/af436dfaa845cab5d96f0adbc1e4f3730532d37fa249e4eb796fb1d7fc82/trove_classifiers-2026.9.21.13.tar.gz", hash = "sha256:0a9ebc8d4e2f3e8a22848c5258033035bec17a3012ac3fea16dbaa764489eb71", size = 17085, upload-time = "2026-09-21T13:29:07.301Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/30/81/0da8afb52a71d0a4f2bd3152357b1a441e393b286374802b9d3addab4ab5/trove_classifiers-2026.9.21.13-py3-none-any.whl", hash = "sha256:8b1ff4f9c191b1040b71c37f1e445ab99732911e3cd91de52838453a854d7a17", size = 14232, upload-time = "2026-09-21T13:29:06.123Z" },
+]
+
+[[package]]
+name = "typing-extensions"
+version = "4.16.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
+]
diff --git a/vendor/Syphon b/vendor/Syphon
index 39e3138..f476167 160000
--- a/vendor/Syphon
+++ b/vendor/Syphon
@@ -1 +1 @@
-Subproject commit 39e31383fff8bfb244bba0abbc7233e2606c82a9
+Subproject commit f4761677a45b8034a3c2069ec0f3d2553da81fba