Skip to content

Commit 2109ff6

Browse files
authoredMar 18, 2025··
Merge pull request #152 from pimoroni/patch-sync-boilerplate
Misc boilerplate updates
2 parents a102a25 + 70947aa commit 2109ff6

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed
 

‎Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ endif
2222
@echo "deploy: build and upload to PyPi"
2323
@echo "tag: tag the repository with the current version\n"
2424

25+
version:
26+
@hatch version
27+
2528
install:
2629
./install.sh --unstable
2730

@@ -47,7 +50,7 @@ pytest:
4750
nopost:
4851
@bash check.sh --nopost
4952

50-
tag:
53+
tag: version
5154
git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}"
5255

5356
build: check

‎install.sh

+15-5
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ find_config() {
5858
if [ ! -f "$CONFIG_DIR/$CONFIG_FILE" ]; then
5959
fatal "Could not find $CONFIG_FILE!"
6060
fi
61-
else
62-
if [ -f "/boot/$CONFIG_FILE" ] && [ ! -L "/boot/$CONFIG_FILE" ]; then
63-
warning "Oops! It looks like /boot/$CONFIG_FILE is not a link to $CONFIG_DIR/$CONFIG_FILE"
64-
warning "You might want to fix this!"
65-
fi
6661
fi
6762
inform "Using $CONFIG_FILE in $CONFIG_DIR"
6863
}
@@ -171,6 +166,12 @@ function pip_pkg_install {
171166
check_for_error
172167
}
173168

169+
function pip_requirements_install {
170+
# A null Keyring prevents pip stalling in the background
171+
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install -r "$@"
172+
check_for_error
173+
}
174+
174175
while [[ $# -gt 0 ]]; do
175176
K="$1"
176177
case $K in
@@ -340,6 +341,15 @@ fi
340341

341342
printf "\n"
342343

344+
if [ -f "requirements-examples.txt" ]; then
345+
if confirm "Would you like to install example dependencies?"; then
346+
inform "Installing dependencies from requirements-examples.txt..."
347+
pip_requirements_install requirements-examples.txt
348+
fi
349+
fi
350+
351+
printf "\n"
352+
343353
# Use pdoc to generate basic documentation from the installed module
344354

345355
if confirm "Would you like to generate documentation?"; then

‎pyproject.toml

+1-7
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ dependencies = [
4141
"pms5003 >= 1.0.1",
4242
"ltr559 >= 1.0.0",
4343
"st7735 >= 1.0.0",
44-
"ads1015 >= 1.0.0",
45-
"fonts",
46-
"font-roboto",
47-
"astral",
48-
"pytz",
49-
"sounddevice",
50-
"paho-mqtt"
44+
"ads1015 >= 1.0.0"
5145
]
5246

5347
[project.urls]

‎requirements-examples.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fonts
2+
font-roboto
3+
astral
4+
pytz
5+
sounddevice
6+
paho-mqtt
7+
pillow

‎tox.ini

+2-9
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,8 @@ commands =
2020
python -m build --no-isolation
2121
python -m twine check dist/*
2222
isort --check .
23-
ruff .
23+
ruff check .
2424
codespell .
2525
deps =
26-
check-manifest
27-
ruff
28-
codespell
29-
isort
30-
twine
31-
build
32-
hatch
33-
hatch-fancy-pypi-readme
26+
-r{toxinidir}/requirements-dev.txt
3427

0 commit comments

Comments
 (0)
Please sign in to comment.