From 73721840f46f325a47252c23d979df9017ffeec5 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Fri, 8 Dec 2023 19:34:07 +0000 Subject: [PATCH 1/5] add python 3.12 wheels, drop python 3.7 --- .github/scripts/build-linux.sh | 6 ++-- .github/scripts/test-linux.sh | 6 ++-- .github/workflows/ci.yml | 60 +++++++++++++++++----------------- CHANGELOG.md | 7 ++++ pyvirtualcam/_version.py | 2 +- 5 files changed, 44 insertions(+), 37 deletions(-) diff --git a/.github/scripts/build-linux.sh b/.github/scripts/build-linux.sh index c34bc27..9bffec8 100755 --- a/.github/scripts/build-linux.sh +++ b/.github/scripts/build-linux.sh @@ -4,9 +4,7 @@ set -e -x # List python versions ls /opt/python -if [ $PYTHON_VERSION == "3.7" ]; then - PYBIN="/opt/python/cp37-cp37m/bin" -elif [ $PYTHON_VERSION == "3.8" ]; then +if [ $PYTHON_VERSION == "3.8" ]; then PYBIN="/opt/python/cp38-cp38/bin" elif [ $PYTHON_VERSION == "3.9" ]; then PYBIN="/opt/python/cp39-cp39/bin" @@ -14,6 +12,8 @@ elif [ $PYTHON_VERSION == "3.10" ]; then PYBIN="/opt/python/cp310-cp310/bin" elif [ $PYTHON_VERSION == "3.11" ]; then PYBIN="/opt/python/cp311-cp311/bin" +elif [ $PYTHON_VERSION == "3.12" ]; then + PYBIN="/opt/python/cp312-cp312/bin" else echo "Unsupported Python version $PYTHON_VERSION" exit 1 diff --git a/.github/scripts/test-linux.sh b/.github/scripts/test-linux.sh index 83fa986..a76cf87 100755 --- a/.github/scripts/test-linux.sh +++ b/.github/scripts/test-linux.sh @@ -4,9 +4,7 @@ set -e -x # List python versions ls /opt/python -if [ $PYTHON_VERSION == "3.7" ]; then - PYBIN="/opt/python/cp37-cp37m/bin" -elif [ $PYTHON_VERSION == "3.8" ]; then +if [ $PYTHON_VERSION == "3.8" ]; then PYBIN="/opt/python/cp38-cp38/bin" elif [ $PYTHON_VERSION == "3.9" ]; then PYBIN="/opt/python/cp39-cp39/bin" @@ -14,6 +12,8 @@ elif [ $PYTHON_VERSION == "3.10" ]; then PYBIN="/opt/python/cp310-cp310/bin" elif [ $PYTHON_VERSION == "3.11" ]; then PYBIN="/opt/python/cp311-cp311/bin" +elif [ $PYTHON_VERSION == "3.12" ]; then + PYBIN="/opt/python/cp312-cp312/bin" else echo "Unsupported Python version $PYTHON_VERSION" exit 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abe6414..c2ac55e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,11 +37,6 @@ 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.7' - numpy-version: '1.14.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 @@ -62,12 +57,12 @@ jobs: docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.11' numpy-version: '1.23.*' + - os-image: ubuntu-latest + os-name: linux + docker-image: quay.io/pypa/manylinux2014_x86_64 + python-version: '3.12' + numpy-version: '1.26.*' - - os-image: macos-11 - os-name: mac - macos-min-version: '10.9' - python-version: '3.7' - numpy-version: '1.14.*' - os-image: macos-11 os-name: mac macos-min-version: '10.9' @@ -88,12 +83,12 @@ jobs: macos-min-version: '10.9' python-version: '3.11' numpy-version: '1.23.*' + - os-image: macos-11 + os-name: mac + macos-min-version: '10.9' + python-version: '3.12' + numpy-version: '1.26.*' - - os-image: windows-latest - os-name: windows - python-version: '3.7' - python-arch: '64' - numpy-version: '1.14.*' - os-image: windows-latest os-name: windows python-version: '3.8' @@ -114,6 +109,11 @@ jobs: python-version: '3.11' python-arch: '64' numpy-version: '1.23.*' + - os-image: windows-latest + os-name: windows + python-version: '3.12' + python-arch: '64' + numpy-version: '1.26.*' permissions: security-events: write @@ -182,11 +182,6 @@ 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.7' - numpy-version: '1.14.*' - os-image: ubuntu-latest os-name: linux docker-image: quay.io/pypa/manylinux2014_x86_64 @@ -207,12 +202,12 @@ jobs: docker-image: quay.io/pypa/manylinux2014_x86_64 python-version: '3.11' numpy-version: '1.23.*' + - os-image: ubuntu-latest + os-name: linux + docker-image: quay.io/pypa/manylinux2014_x86_64 + python-version: '3.12' + numpy-version: '1.26.*' - - os-image: macos-11 - os-name: mac - macos-min-version: '10.9' - python-version: '3.7' - numpy-version: '1.14.*' - os-image: macos-11 os-name: mac macos-min-version: '10.9' @@ -233,12 +228,12 @@ jobs: macos-min-version: '10.9' python-version: '3.11' numpy-version: '1.23.*' + - os-image: macos-11 + os-name: mac + macos-min-version: '10.9' + python-version: '3.12' + numpy-version: '1.26.*' - - os-image: windows-latest - os-name: windows - python-version: '3.7' - python-arch: '64' - numpy-version: '1.14.*' - os-image: windows-latest os-name: windows python-version: '3.8' @@ -259,6 +254,11 @@ jobs: python-version: '3.11' python-arch: '64' numpy-version: '1.23.*' + - os-image: windows-latest + os-name: windows + python-version: '3.12' + python-arch: '64' + numpy-version: '1.26.*' runs-on: ${{ matrix.config.os-image }} container: ${{ matrix.config.docker-image }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 36267d2..fd866af 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.11.0] - 2023-12-08 +### Added +- Python 3.12 support. + +### Removed +- Drop Python 3.7 support. + ## [0.10.2] - 2022-10-30 ### Added - Python 3.11 support. diff --git a/pyvirtualcam/_version.py b/pyvirtualcam/_version.py index 17c1a62..ae6db5f 100644 --- a/pyvirtualcam/_version.py +++ b/pyvirtualcam/_version.py @@ -1 +1 @@ -__version__ = "0.10.2" +__version__ = "0.11.0" From 534bb5eb9198442fc40ac1799a3ddbc9f56c870f Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Sun, 10 Dec 2023 07:39:23 +0000 Subject: [PATCH 2/5] fix macos build --- .github/scripts/build-macos.sh | 2 +- setup.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/build-macos.sh b/.github/scripts/build-macos.sh index aea2173..c0d514b 100755 --- a/.github/scripts/build-macos.sh +++ b/.github/scripts/build-macos.sh @@ -29,7 +29,7 @@ set -x popd # Install dependencies -pip install numpy==$NUMPY_VERSION wheel delocate +pip install numpy==$NUMPY_VERSION wheel delocate setuptools # List installed packages pip freeze diff --git a/setup.py b/setup.py index 52491e0..0ce7345 100644 --- a/setup.py +++ b/setup.py @@ -3,11 +3,12 @@ import platform import sys import glob -from distutils.unixccompiler import UnixCCompiler from setuptools import setup, Extension, find_packages from setuptools.command.build_ext import build_ext import setuptools +from distutils.unixccompiler import UnixCCompiler + class get_pybind_include(object): """Helper class to determine the pybind11 include path The purpose of this class is to postpone importing pybind11 @@ -85,7 +86,7 @@ def has_flag(compiler, flagname): fname = f.name try: compiler.compile([fname], extra_postargs=[flagname]) - except setuptools.distutils.errors.CompileError: + except setuptools.errors.CompileError: return False finally: try: From 7addaf283f8f548dd70a4fc66bea383b45532b39 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Sun, 10 Dec 2023 09:52:04 +0000 Subject: [PATCH 3/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd866af..fd25d23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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.11.0] - 2023-12-08 +## [0.11.0] - 2023-12-10 ### Added - Python 3.12 support. @@ -131,7 +131,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Windows only, Python 3.5 - 3.8. - Support for [OBS-VirtualCam](https://github.com/CatxFish/obs-virtual-cam). - +[0.11.0]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.2...v0.11.0 [0.10.2]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.1...v0.10.2 [0.10.1]: https://github.com/letmaik/pyvirtualcam/compare/v0.10.0...v0.10.1 [0.10.0]: https://github.com/letmaik/pyvirtualcam/compare/v0.9.1...v0.10.0 From 57277c59cab0843ad2493246e93e0c11ed102aa5 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Mon, 29 Jan 2024 23:14:52 +0000 Subject: [PATCH 4/5] Update README.md (#114) --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96e0568..bee5989 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,9 @@ To use the Unity Capture virtual camera, follow the [installation instructions]( [OBS](https://obsproject.com/) includes a built-in virtual camera for macOS (since 26.1). -**NOTE**: Starting with pyvirtualcam 0.10, only OBS 28 is supported. Install an older version if you need OBS 26 / 27 support. +**NOTE**: Starting with pyvirtualcam 0.10, only OBS 28 or higher is supported. Install an older version if you need OBS 26 / 27 support. + +**HELP WANTED**: pyvirtualcam requires code updates to run on macOS 14 and higher. If you own a Mac, consider contributing: https://github.com/letmaik/pyvirtualcam/issues/111#issuecomment-1763398540. To use the OBS virtual camera, follow these one-time setup steps: - [Install OBS](https://obsproject.com/). From 894352e44087f559ee13cc6289f8b5179c0e262c Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Tue, 30 Jan 2024 09:02:44 +0000 Subject: [PATCH 5/5] Linux: rethrow exceptions correctly (#115) --- .github/scripts/test-windows.ps1 | 2 +- pyvirtualcam/native_linux_v4l2loopback/virtual_output.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/test-windows.ps1 b/.github/scripts/test-windows.ps1 index 4d33b96..173d5c0 100644 --- a/.github/scripts/test-windows.ps1 +++ b/.github/scripts/test-windows.ps1 @@ -97,7 +97,7 @@ exec { python -m pip install -r dev-requirements.txt } # Install test helper package Push-Location test/win-dshow-capture -exec { python -m pip install wheel } +exec { python -m pip install wheel setuptools } exec { python -u setup.py bdist_wheel } python -m pip uninstall -y pyvirtualcam_win_dshow_capture ls dist\*cp${PYVER}*win*.whl | % { exec { python -m pip install $_ } } diff --git a/pyvirtualcam/native_linux_v4l2loopback/virtual_output.h b/pyvirtualcam/native_linux_v4l2loopback/virtual_output.h index 266b5e6..9810bec 100644 --- a/pyvirtualcam/native_linux_v4l2loopback/virtual_output.h +++ b/pyvirtualcam/native_linux_v4l2loopback/virtual_output.h @@ -130,7 +130,7 @@ class VirtualOutput { } catch (std::exception &ex) { close(_camera_fd); _camera_fd = -1; - throw ex; + throw; } };