diff --git a/.github/workflows/pymagewell-linters.yml b/.github/workflows/pymagewell-linters.yml index b5a06ae..7941d7d 100644 --- a/.github/workflows/pymagewell-linters.yml +++ b/.github/workflows/pymagewell-linters.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - python-version: ["3.11"] + python-version: ["3.12"] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/pymagewell-unit-tests.yml b/.github/workflows/pymagewell-unit-tests.yml index 1ca05b6..71334cc 100644 --- a/.github/workflows/pymagewell-unit-tests.yml +++ b/.github/workflows/pymagewell-unit-tests.yml @@ -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 diff --git a/linters_and_black.bat b/linters_and_black.bat index c8cca32..ee64152 100644 --- a/linters_and_black.bat +++ b/linters_and_black.bat @@ -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 diff --git a/setup.cfg b/setup.cfg index 712cc5b..8fad269 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 = @@ -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 diff --git a/src/pymagewell/conversion.py b/src/pymagewell/conversion.py index 768994d..d500a2a 100644 --- a/src/pymagewell/conversion.py +++ b/src/pymagewell/conversion.py @@ -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, diff --git a/src/pymagewell/pro_capture_device/device_status.py b/src/pymagewell/pro_capture_device/device_status.py index bbdaaf0..c61b159 100644 --- a/src/pymagewell/pro_capture_device/device_status.py +++ b/src/pymagewell/pro_capture_device/device_status.py @@ -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] ) diff --git a/src/pymagewell/pro_capture_device/pro_capture_device.py b/src/pymagewell/pro_capture_device/pro_capture_device.py index 92b04ca..23840e7 100644 --- a/src/pymagewell/pro_capture_device/pro_capture_device.py +++ b/src/pymagewell/pro_capture_device/pro_capture_device.py @@ -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( diff --git a/src/tests/test_capture_controller.py b/src/tests/test_capture_controller.py index 89dd897..928d28f 100644 --- a/src/tests/test_capture_controller.py +++ b/src/tests/test_capture_controller.py @@ -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) diff --git a/src/tests/test_device.py b/src/tests/test_device.py index 916c6ae..3c4473d 100644 --- a/src/tests/test_device.py +++ b/src/tests/test_device.py @@ -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) diff --git a/src/tests/test_frame.py b/src/tests/test_frame.py index a77195c..1178739 100644 --- a/src/tests/test_frame.py +++ b/src/tests/test_frame.py @@ -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