Skip to content

Commit c60ebd2

Browse files
authored
numpy 2 support & drop python 3.8 (#126)
1 parent b6dc175 commit c60ebd2

File tree

6 files changed

+39
-71
lines changed

6 files changed

+39
-71
lines changed

.github/workflows/ci.yml

+30-62
Original file line numberDiff line numberDiff line change
@@ -37,107 +37,91 @@ jobs:
3737
matrix:
3838
config:
3939
# NOTE: When updating this list, also update the 'test' job!
40-
- os-image: ubuntu-latest
41-
os-name: linux
42-
docker-image: quay.io/pypa/manylinux2014_x86_64
43-
python-version: '3.8'
44-
numpy-version: '1.17.*'
4540
- os-image: ubuntu-latest
4641
os-name: linux
4742
docker-image: quay.io/pypa/manylinux2014_x86_64
4843
python-version: '3.9'
49-
numpy-version: '1.19.*'
44+
numpy-version: '2.0.*'
5045
- os-image: ubuntu-latest
5146
os-name: linux
5247
docker-image: quay.io/pypa/manylinux2014_x86_64
5348
python-version: '3.10'
54-
numpy-version: '1.21.*'
49+
numpy-version: '2.0.*'
5550
- os-image: ubuntu-latest
5651
os-name: linux
5752
docker-image: quay.io/pypa/manylinux2014_x86_64
5853
python-version: '3.11'
59-
numpy-version: '1.23.*'
54+
numpy-version: '2.0.*'
6055
- os-image: ubuntu-latest
6156
os-name: linux
6257
docker-image: quay.io/pypa/manylinux2014_x86_64
6358
python-version: '3.12'
64-
numpy-version: '1.26.*'
59+
numpy-version: '2.0.*'
6560

66-
- os-image: macos-12
67-
os-name: mac
68-
arch: x86_64
69-
macos-min-version: '10.9'
70-
python-version: '3.8'
71-
numpy-version: '1.17.*'
7261
- os-image: macos-12
7362
os-name: mac
7463
arch: x86_64
7564
macos-min-version: '10.9'
7665
python-version: '3.9'
77-
numpy-version: '1.19.*'
66+
numpy-version: '2.0.*'
7867
- os-image: macos-12
7968
os-name: mac
8069
arch: x86_64
8170
macos-min-version: '10.9'
8271
python-version: '3.10'
83-
numpy-version: '1.21.*'
72+
numpy-version: '2.0.*'
8473
- os-image: macos-12
8574
os-name: mac
8675
arch: x86_64
8776
macos-min-version: '10.9'
8877
python-version: '3.11'
89-
numpy-version: '1.23.*'
78+
numpy-version: '2.0.*'
9079
- os-image: macos-12
9180
os-name: mac
9281
arch: x86_64
9382
macos-min-version: '10.9'
9483
python-version: '3.12'
95-
numpy-version: '1.26.*'
84+
numpy-version: '2.0.*'
9685

9786
- os-image: macos-14 # M1
9887
os-name: mac
9988
arch: arm64
10089
macos-min-version: '11.0'
10190
python-version: '3.10'
102-
numpy-version: '1.21.*'
91+
numpy-version: '2.0.*'
10392
- os-image: macos-14 # M1
10493
os-name: mac
10594
arch: arm64
10695
macos-min-version: '11.0'
10796
python-version: '3.11'
108-
numpy-version: '1.23.*'
97+
numpy-version: '2.0.*'
10998
- os-image: macos-14 # M1
11099
os-name: mac
111100
arch: arm64
112101
macos-min-version: '11.0'
113102
python-version: '3.12'
114-
numpy-version: '1.26.*'
103+
numpy-version: '2.0.*'
115104

116-
- os-image: windows-latest
117-
os-name: windows
118-
python-version: '3.8'
119-
python-arch: '64'
120-
numpy-version: '1.17.*'
121105
- os-image: windows-latest
122106
os-name: windows
123107
python-version: '3.9'
124108
python-arch: '64'
125-
numpy-version: '1.19.*'
109+
numpy-version: '2.0.*'
126110
- os-image: windows-latest
127111
os-name: windows
128112
python-version: '3.10'
129113
python-arch: '64'
130-
numpy-version: '1.21.*'
114+
numpy-version: '2.0.*'
131115
- os-image: windows-latest
132116
os-name: windows
133117
python-version: '3.11'
134118
python-arch: '64'
135-
numpy-version: '1.23.*'
119+
numpy-version: '2.0.*'
136120
- os-image: windows-latest
137121
os-name: windows
138122
python-version: '3.12'
139123
python-arch: '64'
140-
numpy-version: '1.26.*'
124+
numpy-version: '2.0.*'
141125

142126
permissions:
143127
security-events: write
@@ -211,107 +195,91 @@ jobs:
211195
# GitHub Actions doesn't support YAML anchors,
212196
# so this has to be duplicated here.
213197
config:
214-
- os-image: ubuntu-latest
215-
os-name: linux
216-
docker-image: quay.io/pypa/manylinux2014_x86_64
217-
python-version: '3.8'
218-
numpy-version: '1.17.*'
219198
- os-image: ubuntu-latest
220199
os-name: linux
221200
docker-image: quay.io/pypa/manylinux2014_x86_64
222201
python-version: '3.9'
223-
numpy-version: '1.19.*'
202+
numpy-version: '2.0.*'
224203
- os-image: ubuntu-latest
225204
os-name: linux
226205
docker-image: quay.io/pypa/manylinux2014_x86_64
227206
python-version: '3.10'
228-
numpy-version: '1.21.*'
207+
numpy-version: '2.0.*'
229208
- os-image: ubuntu-latest
230209
os-name: linux
231210
docker-image: quay.io/pypa/manylinux2014_x86_64
232211
python-version: '3.11'
233-
numpy-version: '1.23.*'
212+
numpy-version: '2.0.*'
234213
- os-image: ubuntu-latest
235214
os-name: linux
236215
docker-image: quay.io/pypa/manylinux2014_x86_64
237216
python-version: '3.12'
238-
numpy-version: '1.26.*'
217+
numpy-version: '2.0.*'
239218

240-
- os-image: macos-12
241-
os-name: mac
242-
arch: x86_64
243-
macos-min-version: '10.9'
244-
python-version: '3.8'
245-
numpy-version: '1.17.*'
246219
- os-image: macos-12
247220
os-name: mac
248221
arch: x86_64
249222
macos-min-version: '10.9'
250223
python-version: '3.9'
251-
numpy-version: '1.19.*'
224+
numpy-version: '2.0.*'
252225
- os-image: macos-12
253226
os-name: mac
254227
arch: x86_64
255228
macos-min-version: '10.9'
256229
python-version: '3.10'
257-
numpy-version: '1.21.*'
230+
numpy-version: '2.0.*'
258231
- os-image: macos-12
259232
os-name: mac
260233
arch: x86_64
261234
macos-min-version: '10.9'
262235
python-version: '3.11'
263-
numpy-version: '1.23.*'
236+
numpy-version: '2.0.*'
264237
- os-image: macos-12
265238
os-name: mac
266239
arch: x86_64
267240
macos-min-version: '10.9'
268241
python-version: '3.12'
269-
numpy-version: '1.26.*'
242+
numpy-version: '2.0.*'
270243

271244
- os-image: macos-14 # M1
272245
os-name: mac
273246
arch: arm64
274247
macos-min-version: '11.0'
275248
python-version: '3.10'
276-
numpy-version: '1.21.*'
249+
numpy-version: '2.0.*'
277250
- os-image: macos-14 # M1
278251
os-name: mac
279252
arch: arm64
280253
macos-min-version: '11.0'
281254
python-version: '3.11'
282-
numpy-version: '1.23.*'
255+
numpy-version: '2.0.*'
283256
- os-image: macos-14 # M1
284257
os-name: mac
285258
arch: arm64
286259
macos-min-version: '11.0'
287260
python-version: '3.12'
288-
numpy-version: '1.26.*'
261+
numpy-version: '2.0.*'
289262

290-
- os-image: windows-latest
291-
os-name: windows
292-
python-version: '3.8'
293-
python-arch: '64'
294-
numpy-version: '1.17.*'
295263
- os-image: windows-latest
296264
os-name: windows
297265
python-version: '3.9'
298266
python-arch: '64'
299-
numpy-version: '1.19.*'
267+
numpy-version: '2.0.*'
300268
- os-image: windows-latest
301269
os-name: windows
302270
python-version: '3.10'
303271
python-arch: '64'
304-
numpy-version: '1.21.*'
272+
numpy-version: '2.0.*'
305273
- os-image: windows-latest
306274
os-name: windows
307275
python-version: '3.11'
308276
python-arch: '64'
309-
numpy-version: '1.23.*'
277+
numpy-version: '2.0.*'
310278
- os-image: windows-latest
311279
os-name: windows
312280
python-version: '3.12'
313281
python-arch: '64'
314-
numpy-version: '1.26.*'
282+
numpy-version: '2.0.*'
315283

316284
runs-on: ${{ matrix.config.os-image }}
317285
# container: ${{ matrix.config.docker-image }}

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.12.0] - 2024-07-14
8+
### Changed
9+
- Support numpy 2.
10+
11+
### Removed
12+
- Drop Python 3.8 support.
13+
714
## [0.11.1] - 2023-02-08
815
### Added
916
- macOS arm64 support (Python 3.10 and higher).

dev-requirements.txt

-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
# test dependencies
22
pytest
33
# https://github.com/opencv/opencv-python/issues/291#issuecomment-841816850
4-
# 4.5.1.48 is the last version for macOS that works without requiring
5-
# media capture authorization which is unsupported in GitHub Actions.
6-
# There is no Python 3.10 wheel though, which means that this work-around
7-
# only works for <= 3.9.
8-
# Tests that require OpenCV on macOS are disabled in CI for >= 3.10.
9-
opencv-python==4.5.1.48 ; python_version < '3.10' and sys_platform == 'darwin'
104
opencv-python; sys_platform != 'darwin'
115
imageio
126

pyvirtualcam/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.11.1"
1+
__version__ = "0.12.0"

pyvirtualcam/camera.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def send(self, frame: np.ndarray) -> None:
345345

346346
print(s)
347347

348-
frame = np.array(frame.reshape(-1), copy=False, order='C')
348+
frame = np.asarray(frame.reshape(-1), order='C')
349349
self._backend.send(frame)
350350

351351
@property

test/test_capture.py

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
except ImportError:
2222
if os.environ.get('CI'):
2323
assert platform.system() == 'Darwin'
24-
assert sys.version_info[:2] >= (3, 10)
2524
print('Skipping due to https://github.com/opencv/opencv-python/issues/291#issuecomment-841816850')
2625
pytest.skip('OpenCV is not installed', allow_module_level=True)
2726

0 commit comments

Comments
 (0)