From c60ebd2b420a81a252d350b999e2602aca8bdf88 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Sun, 14 Jul 2024 09:05:25 +0100 Subject: [PATCH] numpy 2 support & drop python 3.8 (#126) --- .github/workflows/ci.yml | 92 +++++++++++++--------------------------- CHANGELOG.md | 7 +++ dev-requirements.txt | 6 --- pyvirtualcam/_version.py | 2 +- pyvirtualcam/camera.py | 2 +- test/test_capture.py | 1 - 6 files changed, 39 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0255684..e40b93d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,107 +37,91 @@ jobs: matrix: config: # NOTE: When updating this list, also update the 'test' job! - - os-image: ubuntu-latest - os-name: linux - docker-image: quay.io/pypa/manylinux2014_x86_64 - python-version: '3.8' - numpy-version: '1.17.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.9' - numpy-version: '1.19.*' + numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.10' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.11' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.12' - numpy-version: '1.26.*' + numpy-version: '2.0.*' - - os-image: macos-12 - os-name: mac - arch: x86_64 - macos-min-version: '10.9' - python-version: '3.8' - numpy-version: '1.17.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.9' - numpy-version: '1.19.*' + numpy-version: '2.0.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.10' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.11' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.12' - numpy-version: '1.26.*' + numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac arch: arm64 macos-min-version: '11.0' python-version: '3.10' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac arch: arm64 macos-min-version: '11.0' python-version: '3.11' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac arch: arm64 macos-min-version: '11.0' python-version: '3.12' - numpy-version: '1.26.*' + numpy-version: '2.0.*' - - os-image: windows-latest - os-name: windows - python-version: '3.8' - python-arch: '64' - numpy-version: '1.17.*' - os-image: windows-latest os-name: windows python-version: '3.9' python-arch: '64' - numpy-version: '1.19.*' + numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.10' python-arch: '64' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.11' python-arch: '64' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.12' python-arch: '64' - numpy-version: '1.26.*' + numpy-version: '2.0.*' permissions: security-events: write @@ -211,107 +195,91 @@ jobs: # GitHub Actions doesn't support YAML anchors, # so this has to be duplicated here. config: - - os-image: ubuntu-latest - os-name: linux - docker-image: quay.io/pypa/manylinux2014_x86_64 - python-version: '3.8' - numpy-version: '1.17.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.9' - numpy-version: '1.19.*' + numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.10' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.11' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.12' - numpy-version: '1.26.*' + numpy-version: '2.0.*' - - os-image: macos-12 - os-name: mac - arch: x86_64 - macos-min-version: '10.9' - python-version: '3.8' - numpy-version: '1.17.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.9' - numpy-version: '1.19.*' + numpy-version: '2.0.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.10' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.11' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: macos-12 os-name: mac arch: x86_64 macos-min-version: '10.9' python-version: '3.12' - numpy-version: '1.26.*' + numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac arch: arm64 macos-min-version: '11.0' python-version: '3.10' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac arch: arm64 macos-min-version: '11.0' python-version: '3.11' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: macos-14 # M1 os-name: mac arch: arm64 macos-min-version: '11.0' python-version: '3.12' - numpy-version: '1.26.*' + numpy-version: '2.0.*' - - os-image: windows-latest - os-name: windows - python-version: '3.8' - python-arch: '64' - numpy-version: '1.17.*' - os-image: windows-latest os-name: windows python-version: '3.9' python-arch: '64' - numpy-version: '1.19.*' + numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.10' python-arch: '64' - numpy-version: '1.21.*' + numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.11' python-arch: '64' - numpy-version: '1.23.*' + numpy-version: '2.0.*' - os-image: windows-latest os-name: windows python-version: '3.12' python-arch: '64' - numpy-version: '1.26.*' + numpy-version: '2.0.*' runs-on: ${{ matrix.config.os-image }} # container: ${{ matrix.config.docker-image }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 103fe62..e6ec0ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.12.0] - 2024-07-14 +### Changed +- Support numpy 2. + +### Removed +- Drop Python 3.8 support. + ## [0.11.1] - 2023-02-08 ### Added - macOS arm64 support (Python 3.10 and higher). diff --git a/dev-requirements.txt b/dev-requirements.txt index 2332ec4..55e2879 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,12 +1,6 @@ # test dependencies pytest # https://github.com/opencv/opencv-python/issues/291#issuecomment-841816850 -# 4.5.1.48 is the last version for macOS that works without requiring -# media capture authorization which is unsupported in GitHub Actions. -# There is no Python 3.10 wheel though, which means that this work-around -# only works for <= 3.9. -# Tests that require OpenCV on macOS are disabled in CI for >= 3.10. -opencv-python==4.5.1.48 ; python_version < '3.10' and sys_platform == 'darwin' opencv-python; sys_platform != 'darwin' imageio diff --git a/pyvirtualcam/_version.py b/pyvirtualcam/_version.py index fee46bd..ea370a8 100644 --- a/pyvirtualcam/_version.py +++ b/pyvirtualcam/_version.py @@ -1 +1 @@ -__version__ = "0.11.1" +__version__ = "0.12.0" diff --git a/pyvirtualcam/camera.py b/pyvirtualcam/camera.py index 17e3718..e095b04 100644 --- a/pyvirtualcam/camera.py +++ b/pyvirtualcam/camera.py @@ -345,7 +345,7 @@ def send(self, frame: np.ndarray) -> None: print(s) - frame = np.array(frame.reshape(-1), copy=False, order='C') + frame = np.asarray(frame.reshape(-1), order='C') self._backend.send(frame) @property diff --git a/test/test_capture.py b/test/test_capture.py index 07deeb2..6d80dc0 100644 --- a/test/test_capture.py +++ b/test/test_capture.py @@ -21,7 +21,6 @@ except ImportError: if os.environ.get('CI'): assert platform.system() == 'Darwin' - assert sys.version_info[:2] >= (3, 10) print('Skipping due to https://github.com/opencv/opencv-python/issues/291#issuecomment-841816850') pytest.skip('OpenCV is not installed', allow_module_level=True)