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

Raspberry Pi OS Bookworm + Pep 668 #13

Merged
merged 22 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8ebf5b3
Enforce use of a virtual environment.
Gadgetoid Oct 16, 2023
fc12d7d
Add option to manage venv if it's not detected.
Gadgetoid Oct 16, 2023
c8b2011
QA: Drop --format argument from ruff.
Gadgetoid Oct 17, 2023
d9710f7
Drop an auto venv script into ~/Pimoroni, update venv prompt
Gadgetoid Oct 19, 2023
896b3b5
Switch venv location to virtualenvwrapper default.
Gadgetoid Oct 23, 2023
bd3bf8b
Tweaks to install and tool.pimoroni
Gadgetoid Oct 23, 2023
6e4dabc
CI: Set term in check.sh for GitHub Actions.
Gadgetoid Nov 6, 2023
b74d0c6
Better handling of /boot/config.txt and /boot/firmware/config.txt
Gadgetoid Nov 15, 2023
66f69e3
Fix VENV_DIR path.
Gadgetoid Nov 21, 2023
a9db28c
Fix auto_venv.sh creation.
Gadgetoid Nov 22, 2023
5a2228e
install.sh: normalise whitespace.
Gadgetoid Nov 22, 2023
fceeafb
install.sh: rework for better error reporting and fix some bugs.
Gadgetoid Nov 23, 2023
e8f9443
README.md: Correct coveralls badge branch.
Gadgetoid Dec 5, 2023
39d73f7
CI: Update GitHub Actions versions.
damacus Jan 8, 2024
5e294af
QA: Add shellcheck and fix/ignore all issues.
Gadgetoid Jan 9, 2024
f0e3f93
install.sh: slightly better feedback for setup commands.
Gadgetoid Jan 10, 2024
d6a2c6d
install.sh: fix quoting bug in do_config_backup.
Gadgetoid Jan 10, 2024
3c9d88a
install.sh: don't output printf commands.
Gadgetoid Jan 10, 2024
367cd22
install.sh: drop symlink warning for /boot/config.txt.
Gadgetoid Mar 11, 2024
31b961c
install.sh: drop quotes around apt packages.
Gadgetoid Apr 17, 2024
6bb337c
Makefile: fail make tag if dev tools not installed.
Gadgetoid Apr 29, 2024
c2d4193
tox.ini: update ruff invocation to avoid deprecation warning.
Gadgetoid May 10, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -35,7 +35,7 @@ jobs:
make build

- name: Upload Packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}
path: dist/
9 changes: 6 additions & 3 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ jobs:
test:
name: linting & spelling
runs-on: ubuntu-latest

env:
TERM: xterm-256color

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python '3,11'
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.11'

Expand All @@ -34,3 +33,7 @@ jobs:
- name: Run Code Checks
run: |
make check

- name: Run Bash Code Checks
run: |
make shellcheck
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ endif
@echo "deploy: build and upload to PyPi"
@echo "tag: tag the repository with the current version\n"

version:
@hatch version

install:
./install.sh --unstable

Expand All @@ -30,11 +33,14 @@ uninstall:

dev-deps:
python3 -m pip install -r requirements-dev.txt
sudo apt install dos2unix
sudo apt install dos2unix shellcheck

check:
@bash check.sh

shellcheck:
shellcheck *.sh

qa:
tox -e qa

Expand All @@ -44,7 +50,7 @@ pytest:
nopost:
@bash check.sh --nopost

tag:
tag: version
git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}"

build: check
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# __TITLE__

[![Build Status](https://img.shields.io/github/actions/workflow/status/pimoroni/PROJECT_NAME-python/test.yml?branch=main)](https://github.com/pimoroni/PROJECT_NAME-python/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/pimoroni/PROJECT_NAME-python/badge.svg?branch=master)](https://coveralls.io/github/pimoroni/PROJECT_NAME-python?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/pimoroni/PROJECT_NAME-python/badge.svg?branch=main)](https://coveralls.io/github/pimoroni/PROJECT_NAME-python?branch=main)
[![PyPi Package](https://img.shields.io/pypi/v/PROJECT_NAME.svg)](https://pypi.python.org/pypi/PROJECT_NAME)
[![Python Versions](https://img.shields.io/pypi/pyversions/PROJECT_NAME.svg)](https://pypi.python.org/pypi/PROJECT_NAME)

Expand Down
21 changes: 9 additions & 12 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# This script handles some basic QA checks on the source

NOPOST=$1
LIBRARY_NAME=`hatch project metadata name`
LIBRARY_VERSION=`hatch version | awk -F "." '{print $1"."$2"."$3}'`
POST_VERSION=`hatch version | awk -F "." '{print substr($4,0,length($4))}'`
LIBRARY_NAME=$(hatch project metadata name)
LIBRARY_VERSION=$(hatch version | awk -F "." '{print $1"."$2"."$3}')
POST_VERSION=$(hatch version | awk -F "." '{print substr($4,0,length($4))}')
TERM=${TERM:="xterm-256color"}

success() {
echo -e "$(tput setaf 2)$1$(tput sgr0)"
Expand All @@ -28,7 +29,7 @@ while [[ $# -gt 0 ]]; do
;;
*)
if [[ $1 == -* ]]; then
printf "Unrecognised option: $1\n";
printf "Unrecognised option: %s\n" "$1";
exit 1
fi
POSITIONAL_ARGS+=("$1")
Expand All @@ -39,8 +40,7 @@ done
inform "Checking $LIBRARY_NAME $LIBRARY_VERSION\n"

inform "Checking for trailing whitespace..."
grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
if [[ $? -eq 0 ]]; then
if grep -IUrn --color "[[:blank:]]$" --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO; then
warning "Trailing whitespace found!"
exit 1
else
Expand All @@ -49,8 +49,7 @@ fi
printf "\n"

inform "Checking for DOS line-endings..."
grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
if [[ $? -eq 0 ]]; then
if grep -lIUrn --color $'\r' --exclude-dir=dist --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile; then
warning "DOS line-endings found!"
exit 1
else
Expand All @@ -59,8 +58,7 @@ fi
printf "\n"

inform "Checking CHANGELOG.md..."
cat CHANGELOG.md | grep ^${LIBRARY_VERSION} > /dev/null 2>&1
if [[ $? -eq 1 ]]; then
if ! grep "^${LIBRARY_VERSION}" CHANGELOG.md > /dev/null 2>&1; then
warning "Changes missing for version ${LIBRARY_VERSION}! Please update CHANGELOG.md."
exit 1
else
Expand All @@ -69,8 +67,7 @@ fi
printf "\n"

inform "Checking for git tag ${LIBRARY_VERSION}..."
git tag -l | grep -E "${LIBRARY_VERSION}$"
if [[ $? -eq 1 ]]; then
if ! git tag -l | grep -E "${LIBRARY_VERSION}$"; then
warning "Missing git tag for version ${LIBRARY_VERSION}"
fi
printf "\n"
Expand Down
Loading
Loading