Skip to content

Commit

Permalink
numpy 2 support & drop python 3.8 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
letmaik authored Jul 14, 2024
1 parent b6dc175 commit c60ebd2
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 71 deletions.
92 changes: 30 additions & 62 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
6 changes: 0 additions & 6 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyvirtualcam/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.11.1"
__version__ = "0.12.0"
2 changes: 1 addition & 1 deletion pyvirtualcam/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/test_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c60ebd2

Please sign in to comment.