Skip to content

Commit af09595

Browse files
authored
Merge pull request #23 from pimoroni/repackage
Bookworm/Pi5 Compatibility: Upgrade to latest boilerplate, port to gpiod
2 parents 973acf6 + 043b2e3 commit af09595

37 files changed

Lines changed: 1250 additions & 689 deletions

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
name: Python ${{ matrix.python }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python: ['3.9', '3.10', '3.11']
16+
17+
env:
18+
RELEASE_FILE: ${{ github.event.repository.name }}-${{ github.event.release.tag_name || github.sha }}-py${{ matrix.python }}
19+
20+
steps:
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python ${{ matrix.python }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python }}
28+
29+
- name: Install Dependencies
30+
run: |
31+
make dev-deps
32+
33+
- name: Build Packages
34+
run: |
35+
make build
36+
37+
- name: Upload Packages
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: ${{ env.RELEASE_FILE }}
41+
path: dist/

.github/workflows/qa.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: QA
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
name: linting & spelling
12+
runs-on: ubuntu-latest
13+
env:
14+
TERM: xterm-256color
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python '3,11'
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install Dependencies
26+
run: |
27+
make dev-deps
28+
29+
- name: Run Quality Assurance
30+
run: |
31+
make qa
32+
33+
- name: Run Code Checks
34+
run: |
35+
make check
36+
37+
- name: Run Bash Code Checks
38+
run: |
39+
make shellcheck

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
name: Python ${{ matrix.python }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python: ['3.9', '3.10', '3.11']
16+
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v3
20+
21+
- name: Set up Python ${{ matrix.python }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python }}
25+
26+
- name: Install Dependencies
27+
run: |
28+
make dev-deps
29+
30+
- name: Run Tests
31+
run: |
32+
make pytest
33+
34+
- name: Coverage
35+
if: ${{ matrix.python == '3.9' }}
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
python -m pip install coveralls
40+
coveralls --service=github
41+

.gitignore

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
__pycache__/
1+
build/
2+
_build/
3+
*.o
4+
*.so
5+
*.a
26
*.py[cod]
7+
*.egg-info
38
dist/
4-
sdist/
5-
env/
6-
build/
7-
develop-eggs/
8-
eggs/
9-
*.egg-info/
10-
.installed.cfg
11-
*.egg
9+
__pycache__
10+
.DS_Store
1211
*.deb
1312
*.dsc
1413
*.build
1514
*.changes
1615
*.orig.*
17-
library/debian/
1816
packaging/*tar.xz
19-
pip-log.txt
20-
pip-delete-this-directory.txt
21-
.DS_Store
22-
17+
library/debian/
18+
.coverage
19+
.pytest_cache
20+
.tox
File renamed without changes.

Makefile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
LIBRARY_NAME := $(shell hatch project metadata name 2> /dev/null)
2+
LIBRARY_VERSION := $(shell hatch version 2> /dev/null)
3+
4+
.PHONY: usage install uninstall check pytest qa build-deps check tag wheel sdist clean dist testdeploy deploy
5+
usage:
6+
ifdef LIBRARY_NAME
7+
@echo "Library: ${LIBRARY_NAME}"
8+
@echo "Version: ${LIBRARY_VERSION}\n"
9+
else
10+
@echo "WARNING: You should 'make dev-deps'\n"
11+
endif
12+
@echo "Usage: make <target>, where target is one of:\n"
13+
@echo "install: install the library locally from source"
14+
@echo "uninstall: uninstall the local library"
15+
@echo "dev-deps: install Python dev dependencies"
16+
@echo "check: perform basic integrity checks on the codebase"
17+
@echo "qa: run linting and package QA"
18+
@echo "pytest: run Python test fixtures"
19+
@echo "clean: clean Python build and dist directories"
20+
@echo "build: build Python distribution files"
21+
@echo "testdeploy: build and upload to test PyPi"
22+
@echo "deploy: build and upload to PyPi"
23+
@echo "tag: tag the repository with the current version\n"
24+
25+
install:
26+
./install.sh --unstable
27+
28+
uninstall:
29+
./uninstall.sh
30+
31+
dev-deps:
32+
python3 -m pip install -r requirements-dev.txt
33+
sudo apt install dos2unix shellcheck
34+
35+
check:
36+
@bash check.sh
37+
38+
shellcheck:
39+
shellcheck *.sh
40+
41+
qa:
42+
tox -e qa
43+
44+
pytest:
45+
tox -e py
46+
47+
nopost:
48+
@bash check.sh --nopost
49+
50+
tag:
51+
git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}"
52+
53+
build: check
54+
@hatch build
55+
56+
clean:
57+
-rm -r dist
58+
59+
testdeploy: build
60+
twine upload --repository testpypi dist/*
61+
62+
deploy: nopost build
63+
twine upload dist/*

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
# Cap1xxx
2-
3-
Python library for Microchip Capacitive Touch devices in the Cap1xxx family.
1+
# Cap1xxx
2+
3+
Python library for Microchip Capacitive Touch devices in the Cap1xxx family.
4+

0 commit comments

Comments
 (0)