Skip to content

Commit

Permalink
Merge pull request #14 from KCL-BMEIS/13-python-312
Browse files Browse the repository at this point in the history
#13 - Python 3.12 support
  • Loading branch information
crnbaker authored Nov 2, 2023
2 parents c370f9a + dfcc225 commit 91ea045
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pymagewell-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:

matrix:
python-version: ["3.11"]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pymagewell-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 6 additions & 6 deletions linters_and_black.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
echo 'Formatting code with black...'
black --line-length 120 src/pymagewell
black --line-length 120 src/tests
python -m black --line-length 120 src/pymagewell
python -m black --line-length 120 src/tests
echo 'Running mypy...'
mypy src/pymagewell
mypy src/tests
python -m mypy src/pymagewell
python -m mypy src/tests
echo 'Running flake8...'
flake8 src/pymagewell
flake8 src/tests
python -m flake8 src/pymagewell
python -m flake8 src/tests
12 changes: 7 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ classifiers =
Operating System :: MacOS :: MacOS X
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Multimedia :: Video :: Capture
Typing :: Typed
project_urls =
Expand Down Expand Up @@ -50,12 +52,12 @@ test=pytest

[options.extras_require]
test =
pytest == 6.2.5
pytest == 7.4.3
dev =
flake8 == 4.0
flake8-bugbear == 21.9.2
black == 22.3.0
mypy == 0.982
flake8 == 6.1.0
flake8-bugbear == 23.9.16
black == 23.10.1
mypy == 1.6.1
doc =
pdoc == 12.2.0

Expand Down
1 change: 0 additions & 1 deletion src/pymagewell/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def convert_rgb_bytes_to_array(
output_channel_order: RGBChannelOrder,
output_alpha_location: AlphaChannelLocation,
) -> NDArray[Union[uint8, uint16]]:

if colour_format in [
ColourFormat.BGRA,
ColourFormat.ABGR,
Expand Down
1 change: 0 additions & 1 deletion src/pymagewell/pro_capture_device/device_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ class FrameInfo:

@classmethod
def from_mwcap_video_frame_info(cls, info: mwcap_video_frame_info, init_time: DeviceInitTime) -> "FrameInfo":

buffering_start_time_device_ticks = (
info.allFieldStartTimes[1] if info.bInterlaced else info.allFieldStartTimes[0]
)
Expand Down
1 change: 0 additions & 1 deletion src/pymagewell/pro_capture_device/pro_capture_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def event(self) -> TimerEvent:
return self._timer_event

def schedule_timer_event(self, device_time_now: mw_device_time) -> None:

if self._frame_expire_time is None:
self._frame_expire_time = device_time_now
self._frame_expire_time.m_ll_device_time.value += int(
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_capture_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def setUp(self) -> None:
device_settings = ProCaptureSettings()
device_settings.transfer_mode = TransferMode.TIMER
assert hasattr(self, "hardware_mode_is_set")
if self.hardware_mode_is_set: # type: ignore
if self.hardware_mode_is_set:
self._device: ProCaptureDeviceInterface = ProCaptureDevice(device_settings)
else:
self._device = MockProCaptureDevice(device_settings)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setUp(self) -> None:
device_settings.transfer_mode = TransferMode.TIMER

assert hasattr(self, "hardware_mode_is_set")
if self.hardware_mode_is_set: # type: ignore
if self.hardware_mode_is_set:
self._device: ProCaptureDeviceInterface = ProCaptureDevice(device_settings)
else:
self._device = MockProCaptureDevice(device_settings)
Expand Down
1 change: 0 additions & 1 deletion src/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def _make_frame(test_frame_rgb24_array: NDArray[uint8], colour_format: ColourFor
if colour_format == ColourFormat.RGB24:
image_bytes = test_frame_rgb24_array.tobytes()
else:

image_bytes = FFMPEG_INSTANCE.encode_rgb24_array(test_frame_rgb24_array, colour_format)
frame = VideoFrame(
string_buffer=image_bytes, dimensions=_frame_dimensions, timestamps=_frame_timestamps, format=colour_format
Expand Down

0 comments on commit 91ea045

Please sign in to comment.