From 730fe8632950fe5a44f1a30c9523473d136cb226 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Thu, 5 Sep 2024 10:00:28 +0200 Subject: [PATCH 1/3] Version bump (#567) --- CHANGELOG.md | 19 +++++++++++++++++++ wgpu/__init__.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eb9dbbd..e97cd37b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,25 @@ Possible sections in each release: * Security: in case of vulnerabilities. +### [v0.17.0] - 05-08-2024 + +Added: + +* Support for occlusion queries. +* Support for render bundles. +* Support for IMGUI, via `wgpu.utils.imgui`. +* Wx is now a fully supported GUI backend. +* A `BaseEnum` class was added to `wgpu.utils`, so it can be used in downstream libs like pygfx. + +Changed: + +* The flags and enums are implemented using a new enum class, enabling better static code analysis (i.e. autocompletion in IDE's). +* Native (desktop) features must now be specified in the same way as normal (WebGPU) features: lowercase and whith hyphens between the words. +* Bindings can omit offset and size (the full size will be used). This makes our API follow WebGPU better. +* Support omitting fields from `BindGroupLayoutEntry`, `BufferBindingLayout`, `SamplerBindingLayout`, `StorageTextureBindingLayout`, `VertexState`. See https://github.com/pygfx/wgpu-py/pull/534 for details. +* In cases where a `view_dimension` is given, it must be provided as a string (e.g. '2d'). Ints are no longer allowed, because e.g. 2 does *not* mean '2d', which can be a source of confusion. + + ### [v0.16.0] - 13-06-2024 Changed: diff --git a/wgpu/__init__.py b/wgpu/__init__.py index ae9dced6..a42bf33f 100644 --- a/wgpu/__init__.py +++ b/wgpu/__init__.py @@ -13,7 +13,7 @@ from . import resources # noqa: F401,F403 -__version__ = "0.16.0" +__version__ = "0.17.0" version_info = tuple(map(int, __version__.split("."))) From b3f2ace3399688469ab07d9db560d409a0bccf5c Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Thu, 5 Sep 2024 22:46:06 +0200 Subject: [PATCH 2/3] Refactor and fix cd (#570) * Refactor and fix cd * add cd * tweak * mmm * try older version * fix * fix artifacts and set-output * try * mac-latest also builds x86 * turn it on --- .github/workflows/cd.yml | 152 ++++++++++++++++++++++++ .github/workflows/ci.yml | 191 ++++-------------------------- .github/workflows/screenshots.yml | 10 +- 3 files changed, 180 insertions(+), 173 deletions(-) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..e9ac5b3f --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,152 @@ +name: CD + +on: + workflow_dispatch: + push: + tags: + - 'v*' + pull_request: + branches: + - main + +jobs: + + # The release builds are done for the platforms that we want to build wheels for. + # We build wheels, test them, and then upload the wheel as an artifact. + release-builds: + name: Build wheels on ${{ matrix.os }} + timeout-minutes: 10 + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install dev dependencies + run: | + python -m pip install --upgrade pip wheel setuptools twine + - name: Build wheels + # Use v2.16, v2.20 fails the osx builds + uses: pypa/cibuildwheel@v2.16 + env: + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 + CIBW_ARCHS_LINUX: x86_64 + CIBW_SKIP: cp39-musllinux_x86_64 + with: + output-dir: dist + - name: Twine check + run: | + twine check dist/* + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + path: dist + name: ${{ matrix.os }}-build + + # These release builds uses QEMU so that we can build wheels for arm64. + # We build wheels and upload the wheel as an artifact, but we don't test them here. + qemu-release-builds: + name: Build wheels on ubuntu-latest with QEMU + timeout-minutes: 10 + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - name: Build wheels + uses: pypa/cibuildwheel@v2.20 + env: + CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64 + CIBW_ARCHS_LINUX: aarch64 + CIBW_SKIP: cp39-musllinux_aarch64 + with: + output-dir: dist + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + path: dist + name: qemu-build + + sdist-build: + name: Build sdist + timeout-minutes: 5 + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install dev dependencies + run: | + python -m pip install --upgrade pip + pip install -U -r dev-requirements.txt + - name: Create source distribution + run: | + python setup.py sdist + - name: Test sdist + shell: bash + run: | + rm -rf ./wgpu + pushd $HOME + pip install $GITHUB_WORKSPACE/dist/*.tar.gz + popd + # don't run tests, we just want to know if the sdist can be installed + pip uninstall -y wgpu + git reset --hard HEAD + - name: Twine check + run: | + twine check dist/* + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + path: dist + name: sdist-build + + publish: + name: Publish to Github and Pypi + runs-on: ubuntu-latest + needs: [release-builds, qemu-release-builds, sdist-build] + if: success() && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Download assets + uses: actions/download-artifact@v4 + with: + path: dist + - name: Set version from git ref + run: echo "WGPU_PY_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + - name: Upload Release Assets + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.WGPU_PY_VERSION }} + name: ${{ env.WGPU_PY_VERSION }} + token: ${{ secrets.GITHUB_TOKEN }} + files: | + dist/**/*.tar.gz + dist/**/*.whl + body: | + Autogenerated binary wheels that include wgpu-native. + See [the changelog](https://github.com/pygfx/wgpu-py/blob/main/CHANGELOG.md) for details. + draft: false + prerelease: false + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c78be07c..3393c4b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: '3.12' - name: Install dev dependencies run: | python -m pip install --upgrade pip @@ -40,11 +40,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -60,11 +60,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -88,11 +88,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: '3.12' - name: Install dev dependencies run: | python -m pip install --upgrade pip @@ -109,11 +109,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install llvmpipe and lavapipe for offscreen canvas run: | sudo apt-get update -y -qq @@ -137,11 +137,11 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -181,9 +181,9 @@ jobs: os: ubuntu-latest pyversion: 'pypy3.9' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.pyversion }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.pyversion }} - name: Install llvmpipe and lavapipe for offscreen canvas @@ -203,148 +203,3 @@ jobs: - name: Memory tests run: | pytest -v tests_mem - - # The release builds are done for the platforms that we want to build wheels for. - # We build wheels, test them, and then upload the wheel as an artifact. - release-builds: - name: Build wheels on ${{ matrix.os }} - timeout-minutes: 10 - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Install dev dependencies - run: | - python -m pip install --upgrade pip wheel setuptools twine - - name: Build wheels - uses: pypa/cibuildwheel@v2.16 - env: - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 - CIBW_ARCHS_LINUX: x86_64 - CIBW_SKIP: cp39-musllinux_x86_64 - with: - output-dir: dist - - name: Twine check - run: | - twine check dist/* - - name: Upload distributions - uses: actions/upload-artifact@v2 - with: - path: dist - name: dist - - # Thees release builds uses QEMU so that we can build wheels for arm64. - # We build wheels and upload the wheel as an artifact, but we don't test them here. - qemu-release-builds: - name: Build wheels on ubuntu-latest with QEMU - timeout-minutes: 10 - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v3 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - name: Build wheels - uses: pypa/cibuildwheel@v2.16.2 - env: - CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64 - CIBW_ARCHS_LINUX: aarch64 - CIBW_SKIP: cp39-musllinux_aarch64 - with: - output-dir: dist - - name: Upload distributions - uses: actions/upload-artifact@v2 - with: - path: dist - name: dist - - sdist-build: - name: Build sdist - timeout-minutes: 5 - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Install dev dependencies - run: | - python -m pip install --upgrade pip - pip install -U -r dev-requirements.txt - - name: Create source distribution - run: | - python setup.py sdist - - name: Test sdist - shell: bash - run: | - rm -rf ./wgpu - pushd $HOME - pip install $GITHUB_WORKSPACE/dist/*.tar.gz - popd - # don't run tests, we just want to know if the sdist can be installed - pip uninstall -y wgpu - git reset --hard HEAD - - name: Twine check - run: | - twine check dist/* - - name: Upload distributions - uses: actions/upload-artifact@v2 - with: - path: dist - name: dist - - publish: - name: Publish to Github and Pypi - runs-on: ubuntu-latest - needs: [test-builds, release-builds, qemu-release-builds, sdist-build] - if: success() && startsWith(github.ref, 'refs/tags/v') - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Download assets - uses: actions/download-artifact@v4.1.7 - with: - name: dist - - name: Get version from git ref - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Create GH release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.get_version.outputs.VERSION }} - release_name: Release ${{ steps.get_version.outputs.VERSION }} - body: | - Autogenerated binary wheels that include wgpu-native. - See [the changelog](https://github.com/pygfx/wgpu-py/blob/main/CHANGELOG.md) for details. - draft: false - prerelease: false - - name: Upload release assets - # Move back to official action after fix https://github.com/actions/upload-release-asset/issues/4 - uses: AButler/upload-release-assets@v2.0 - with: - release-tag: ${{ steps.get_version.outputs.VERSION }} - files: 'dist/*.tar.gz;dist/*.whl' - repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 276d53bd..bf32d297 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -12,11 +12,11 @@ jobs: timeout-minutes: 10 runs-on: 'ubuntu-latest' steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' - name: Install llvmpipe and lavapipe for offscreen canvas run: | sudo apt-get update -y -qq @@ -32,7 +32,7 @@ jobs: - name: Regenerate screenshots run: | pytest -v --regenerate-screenshots -k test_examples_screenshots examples - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: always() with: name: screenshots From c62e65bcbe7375415807c53aca1df0f705a66891 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Thu, 5 Sep 2024 23:08:17 +0200 Subject: [PATCH 3/3] Bump again (#571) --- CHANGELOG.md | 2 +- wgpu/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e97cd37b..cf2ed0e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ Possible sections in each release: * Security: in case of vulnerabilities. -### [v0.17.0] - 05-08-2024 +### [v0.17.1] - 05-08-2024 Added: diff --git a/wgpu/__init__.py b/wgpu/__init__.py index a42bf33f..9be8aebb 100644 --- a/wgpu/__init__.py +++ b/wgpu/__init__.py @@ -13,7 +13,7 @@ from . import resources # noqa: F401,F403 -__version__ = "0.17.0" +__version__ = "0.17.1" version_info = tuple(map(int, __version__.split(".")))