summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-15 16:51:01 +0200
committerViljami Ilola <+@hix.fi>2024-03-15 16:51:01 +0200
commit4bd0381cef63e59801ec05786ec17d567bc4245c (patch)
treee879466e145df6e48c59bc91fe7c7418cdb40ebf
parente5aebeba1201cbed041adc0f8d5b8d7a1e007f0f (diff)
dev.sh and dev dependencies
-rw-r--r--.gitignore5
-rwxr-xr-xdev.sh101
-rw-r--r--pyproject.toml8
3 files changed, 112 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index e7bca89..40e5945 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,5 @@
-#Editor backups
+# Editor backups
*~
+
+# poetry.lock - as project only developed in one place
+poetry.lock
diff --git a/dev.sh b/dev.sh
new file mode 100755
index 0000000..9bee2dc
--- /dev/null
+++ b/dev.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+
+[ x$1 = x ] && echo "\
+Pieni ja kevyt skripti helppoa kehitystyökalujen ajoa varten.
+
+Käyttö: $0 <komento>
+
+Komennot:
+
+dev Asenna devausymäristö
+pytest Aja yksikkötestit pytestillä
+pylint Tarkista muotoilu pylintillä
+covhtml Tee haarakattavuus raportti html muodossa
+covxml Sama mutta xml muoto (codecov tarvitsee tämän)
+covff Tee html haarakattavuusraportti ja avaa se firefoxissa
+all Sama kuin '$0 covff && $0 pylint'
+install Rakenna ja asenna paketti käyttäen pipx & poetry
+" && exit 0
+
+[ x$PIP = x ] && PIP="pipx"
+export DEVSH_PRIN=">>$DEVSH_PRIN"
+export DEVSH_PROUT="<<$DEVSH_PROUT"
+
+echo "\033[32m$DEVSH_PRIN $0 $1 - started.\033[0m"
+
+case $1 in
+
+ install-poetry)
+ $PIP install poetry
+ ;;
+
+ install-latest-build)
+ $PIP install `ls dist/*.tar.gz -t -c -1 | head -1` \
+ && echo "For uninstall please use '$PIP uninstall ...'"
+ ;;
+
+ poetry-dev-deps)
+ PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring \
+ poetry install --no-root
+ ;;
+
+ dev)
+ $0 install-poetry \
+ && $0 poetry-dev-deps
+ ;;
+
+ pytest)
+ poetry run pytest -v
+ ;;
+
+ pylint)
+ poetry run python3 -m pylint src/miinaharava/
+ ;;
+
+ coverage)
+ poetry run python3 -m coverage run --branch -m pytest -v
+ ;;
+
+ covhtml)
+ $0 coverage \
+ && poetry run python3 -m coverage html
+ ;;
+
+ covxml)
+ $0 coverage \
+ && poetry run python3 -m coverage xml
+ ;;
+
+ covff)
+ $0 covhtml \
+ && firefox htmlcov/index.html
+ ;;
+
+ all)
+ $0 covff \
+ && $0 pylint
+ ;;
+
+ poetry-build)
+ poetry build
+ ;;
+
+ install)
+ $0 install-poetry \
+ && $0 poetry-build \
+ && $0 install-latest-build
+ ;;
+
+ *)
+ echo "\033[31m$DEVSH_PROUT $0 $1 - unknown command.\033[0m"
+ exit 1
+ ;;
+esac
+
+STATUS=$?
+
+[ $STATUS != 0 ] \
+ && echo "\033[31m$DEVSH_PROUT $0 $1 - exited with code $STATUS.\033[0m" \
+ && exit $STATUS
+
+echo "\033[32m$DEVSH_PROUT $0 $1 - done.\033[0m"
diff --git a/pyproject.toml b/pyproject.toml
index dc2ef91..483d69f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sliceitoff"
-version = "0.1.0"
+version = "0.0-alpha"
description = ""
authors = ["Viljami Ilola <+@hix.fi>"]
readme = "README.md"
@@ -8,8 +8,14 @@ packages = [{include = "sliceitoff", from = "src"}]
[tool.poetry.dependencies]
python = "^3.11"
+pygame = "^2.5.2"
+[tool.poetry.group.dev.dependencies]
+pylint = "^3.1.0"
+pytest = "^8.1.1"
+coverage = "^7.4.4"
+
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"