Skip to content

Commit 7954cfb

Browse files
committed
new version
1 parent 7b1bd27 commit 7954cfb

654 files changed

Lines changed: 2315 additions & 1692 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, newest, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -e .[dev]
31+
32+
- name: Lint with flake8
33+
run: |
34+
flake8 pydiplink --count --select=E9,F63,F7,F82 --show-source --statistics
35+
flake8 pydiplink --count --max-complexity=10 --max-line-length=100 --statistics
36+
37+
- name: Check formatting with black
38+
run: |
39+
black --check pydiplink
40+
41+
- name: Check import sorting with isort
42+
run: |
43+
isort --check-only pydiplink
44+
45+
- name: Type check with mypy
46+
run: |
47+
mypy pydiplink --ignore-missing-imports
48+
continue-on-error: true # Don't fail build on type errors initially
49+
50+
- name: Run tests with pytest
51+
run: |
52+
pytest --cov=pydiplink --cov-report=xml --cov-report=term
53+
54+
- name: Upload coverage to Codecov
55+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
56+
uses: codecov/codecov-action@v3
57+
with:
58+
file: ./coverage.xml
59+
fail_ci_if_error: false
60+
61+
build:
62+
name: Build distribution
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.11'
71+
72+
- name: Install build dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install build twine
76+
77+
- name: Build package
78+
run: |
79+
python -m build
80+
81+
- name: Check package
82+
run: |
83+
twine check dist/*
84+
85+
- name: Upload artifacts
86+
uses: actions/upload-artifact@v3
87+
with:
88+
name: dist
89+
path: dist/

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
test:
13+
name: Run tests before release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -e .[dev]
27+
28+
- name: Run tests
29+
run: |
30+
pytest --cov=pydiplink
31+
32+
build-and-publish:
33+
name: Build and publish to PyPI
34+
needs: test
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: '3.11'
43+
44+
- name: Install build dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install build twine
48+
49+
- name: Build package
50+
run: |
51+
python -m build
52+
53+
- name: Publish to PyPI
54+
env:
55+
TWINE_USERNAME: __token__
56+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
57+
run: |
58+
twine upload dist/*
59+
60+
create-release:
61+
name: Create GitHub Release
62+
needs: build-and-publish
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Extract release notes
68+
id: extract-release-notes
69+
uses: ffurrer2/extract-release-notes@v1
70+
71+
- name: Create Release
72+
uses: softprops/action-gh-release@v1
73+
with:
74+
body: ${{ steps.extract-release-notes.outputs.release_notes }}
75+
draft: false
76+
prerelease: false

.gitignore

Lines changed: 160 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,164 @@
1+
# Byte-compiled / optimized / DLL files
12
__pycache__/
2-
*.pyc
3-
*.pyo
4-
*.pyd
5-
*.egg-info/
6-
dist/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
7+
# Distribution / packaging
8+
.Python
79
build/
10+
develop-eggs/
11+
dist/
12+
downloads/
13+
eggs/
14+
.eggs/
15+
lib/
16+
lib64/
17+
parts/
18+
sdist/
19+
var/
20+
wheels/
21+
pip-wheel-metadata/
22+
share/python-wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.nox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*.cover
46+
*.py,cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
db.sqlite3-journal
59+
60+
# Flask stuff:
61+
instance/
62+
.webassets-cache
63+
64+
# Scrapy stuff:
65+
.scrapy
66+
67+
# Sphinx documentation
68+
docs/_build/
69+
70+
# PyBuilder
71+
target/
72+
73+
# Jupyter Notebook
74+
.ipynb_checkpoints
75+
76+
# IPython
77+
profile_default/
78+
ipython_config.py
79+
80+
# pyenv
81+
.python-version
82+
83+
# pipenv
84+
Pipfile.lock
85+
86+
# PEP 582
87+
__pypackages__/
88+
89+
# Celery stuff
90+
celerybeat-schedule
91+
celerybeat.pid
92+
93+
# SageMath parsed files
94+
*.sage.py
95+
96+
# Environments
897
.env
98+
.venv
99+
env/
100+
venv/
101+
ENV/
102+
env.bak/
103+
venv.bak/
9104
myenv/
105+
106+
# Spyder project settings
107+
.spyderproject
108+
.spyproject
109+
110+
# Rope project settings
111+
.ropeproject
112+
113+
# mkdocs documentation
114+
/site
115+
116+
# mypy
117+
.mypy_cache/
118+
.dmypy.json
119+
dmypy.json
120+
121+
# Pyre type checker
122+
.pyre/
123+
124+
# IDEs
125+
.vscode/
126+
.idea/
127+
*.swp
128+
*.swo
129+
*~
130+
.DS_Store
131+
132+
# PyDIPLink specific
133+
received_images/
134+
esp-recieved/
135+
lite_results/
136+
realistic_results/
137+
standard-test-images-for-Image-Processing-master/
138+
histogram_output.*
139+
*.avi
140+
output.avi
141+
142+
# Test images and data
143+
*.png
144+
*.jpg
145+
*.jpeg
146+
*.jfif
147+
*.bmp
148+
*.gif
149+
!docs/**/*.png
150+
!docs/**/*.jpg
151+
!examples/**/*.png
152+
!examples/**/*.jpg
153+
!assets/**/*.png
154+
!assets/**/*.jpg
155+
156+
# Archive files
157+
*.zip
158+
*.tar.gz
159+
*.tgz
160+
161+
# Temporary files
162+
tmp/
163+
temp/
164+
*.tmp

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
args: ['--maxkb=1000']
10+
- id: check-merge-conflict
11+
- id: check-toml
12+
- id: debug-statements
13+
- id: mixed-line-ending
14+
15+
- repo: https://github.com/psf/black
16+
rev: 24.1.1
17+
hooks:
18+
- id: black
19+
language_version: python3
20+
21+
- repo: https://github.com/pycqa/isort
22+
rev: 5.13.2
23+
hooks:
24+
- id: isort
25+
args: ["--profile", "black"]
26+
27+
- repo: https://github.com/pycqa/flake8
28+
rev: 7.0.0
29+
hooks:
30+
- id: flake8
31+
args: ['--max-line-length=100', '--extend-ignore=E203,W503']
32+
additional_dependencies: [flake8-docstrings]
33+
34+
- repo: https://github.com/pre-commit/mirrors-mypy
35+
rev: v1.8.0
36+
hooks:
37+
- id: mypy
38+
additional_dependencies: [types-Pillow]
39+
args: [--ignore-missing-imports, --python-version=3.7]
-3.62 MB
Binary file not shown.
-1.03 MB
Binary file not shown.

AF.png

-703 KB
Binary file not shown.

AFA.png

-50.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)