Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package data now included in install #9

Merged
merged 3 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/pymagewell-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 pymagewell --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 tests --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/pymagewell --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/tests --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 pymagewell --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 src/pymagewell --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 src/tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Cache mypy cache
uses: AustinScola/mypy-cache-github-action@v1
- name: Check typing with mypy
run: |
mypy pymagewell
mypy tests
mypy src/pymagewell
mypy src/tests
- name: Fix formatting with Black
run: |
black --line-length 120 --diff --color --check pymagewell
black --line-length 120 --diff --color --check tests
black --line-length 120 --diff --color --check src/pymagewell
black --line-length 120 --diff --color --check src/tests
7 changes: 5 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include versioneer.py
include pymagewell/_version.py
include pymagewell/py.typed
include src/pymagewell/_version.py
include src/pymagewell/py.typed
include src/mwcapture/bin/x64/*.dll
include src/mwcapture/bin/x86/*.dll
include src/mwcapture/README.md
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,31 @@ A full working example is provided in
[`example_script.py`](https://github.com/KCL-BMEIS/pymagewell/blob/main/example_script.py).

First, create a `ProCaptureSettings` dataclass:

```python
from pymagewell import (
from src.pymagewell import (
ProCaptureSettings, ImageSizeInPixels, TransferMode, ColourFormat
)

device_settings = ProCaptureSettings(
dimensions=ImageSizeInPixels(1920, 1080),
color_format=ColourFormat.BGR24, # Color format of captured video frames
transfer_mode = TransferMode.LOW_LATENCY,
num_lines_per_chunk = 64 # has effect only in low latency mode
transfer_mode=TransferMode.LOW_LATENCY,
num_lines_per_chunk=64 # has effect only in low latency mode
)
```
Then create a `ProCaptureDevice` (or `MockProCaptureDevice` for testing on a system without a grabber) configured with
your chosen settings:

```python
from pymagewell import ProCaptureDevice
from src.pymagewell import ProCaptureDevice

device = ProCaptureDevice(settings=device_settings)
```
Then create a `ProCaptureDeviceController` to transfer frames from the device to your PC:

```python
from pymagewell import ProCaptureController
from src.pymagewell import ProCaptureController

controller = ProCaptureController(device)
```
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 pymagewell
black --line-length 120 tests
black --line-length 120 src/pymagewell
black --line-length 120 src/tests
echo 'Running mypy...'
mypy pymagewell
mypy tests
mypy src/pymagewell
mypy src/tests
echo 'Running flake8...'
flake8 pymagewell
flake8 tests
flake8 src/pymagewell
flake8 src/tests
16 changes: 5 additions & 11 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = https://github.com/KCL-BMEIS/pymagewell
author = Christian Baker
author_email = [email protected],
license = MIT
license_file = LICENSE
license_files = LICENSE
classifiers =
Development Status :: 4 - Beta
Intended Audience :: Developers
Expand All @@ -28,15 +28,9 @@ project_urls =

[options]
zip_safe = False
packages =
pymagewell
pymagewell.events
pymagewell.events.mock_win32api
pymagewell.events.mock_win32event
pymagewell.pro_capture_device
mwcapture
packages = find:
package_dir =
=.
= src
include_package_data = True
install_requires =
numpy>=1.23.4
Expand All @@ -45,8 +39,8 @@ install_requires =

python_requires = >=3.8

[options.package_data]
* = py.typed
[options.packages.find]
where = src

[bdist_wheel]
universal = false
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

class MockProCaptureDevice(ProCaptureDeviceImpl):
"""MockProCaptureDevice is intended to be used during testing, development and CI in the absence of a hardware frame
grabber or Magwell Windows SDK. Does not require Magewell driver or hardware.
grabber or Magewell Windows SDK. Does not require Magewell driver or hardware.

Only TransferMode.Timer is supported.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.