diff --git a/Makefile b/Makefile index 34f4a7d..56cf0df 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -47,7 +50,7 @@ pytest: nopost: @bash check.sh --nopost -tag: +tag: version git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}" build: check diff --git a/install.sh b/install.sh index 495919b..61f1a4a 100755 --- a/install.sh +++ b/install.sh @@ -58,11 +58,6 @@ find_config() { if [ ! -f "$CONFIG_DIR/$CONFIG_FILE" ]; then fatal "Could not find $CONFIG_FILE!" fi - else - if [ -f "/boot/$CONFIG_FILE" ] && [ ! -L "/boot/$CONFIG_FILE" ]; then - warning "Oops! It looks like /boot/$CONFIG_FILE is not a link to $CONFIG_DIR/$CONFIG_FILE" - warning "You might want to fix this!" - fi fi inform "Using $CONFIG_FILE in $CONFIG_DIR" } @@ -171,6 +166,12 @@ function pip_pkg_install { check_for_error } +function pip_requirements_install { + # A null Keyring prevents pip stalling in the background + PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install -r "$@" + check_for_error +} + while [[ $# -gt 0 ]]; do K="$1" case $K in @@ -340,6 +341,15 @@ fi printf "\n" +if [ -f "requirements-examples.txt" ]; then + if confirm "Would you like to install example dependencies?"; then + inform "Installing dependencies from requirements-examples.txt..." + pip_requirements_install requirements-examples.txt + fi +fi + +printf "\n" + # Use pdoc to generate basic documentation from the installed module if confirm "Would you like to generate documentation?"; then diff --git a/pyproject.toml b/pyproject.toml index 7c565bb..057079f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,13 +41,7 @@ dependencies = [ "pms5003 >= 1.0.1", "ltr559 >= 1.0.0", "st7735 >= 1.0.0", - "ads1015 >= 1.0.0", - "fonts", - "font-roboto", - "astral", - "pytz", - "sounddevice", - "paho-mqtt" + "ads1015 >= 1.0.0" ] [project.urls] diff --git a/requirements-examples.txt b/requirements-examples.txt new file mode 100644 index 0000000..96def71 --- /dev/null +++ b/requirements-examples.txt @@ -0,0 +1,7 @@ +fonts +font-roboto +astral +pytz +sounddevice +paho-mqtt +pillow diff --git a/tox.ini b/tox.ini index 44c8654..2b6d87b 100644 --- a/tox.ini +++ b/tox.ini @@ -20,15 +20,8 @@ commands = python -m build --no-isolation python -m twine check dist/* isort --check . - ruff . + ruff check . codespell . deps = - check-manifest - ruff - codespell - isort - twine - build - hatch - hatch-fancy-pypi-readme + -r{toxinidir}/requirements-dev.txt