add pipinstall script and append py_modules to PYTHONPATH

allows dependent python modules to be installed
This commit is contained in:
Luis Finke 2022-12-30 10:43:05 -05:00
commit 561751e028
3 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View file

@ -22,6 +22,7 @@ coverage
# Dependency directory
node_modules
bower_components
py_modules
# Editors
.idea

View file

@ -1,3 +1,8 @@
import os
import sys
# append py_modules to PYTHONPATH
sys.path.append(os.path.dirname(os.path.realpath(__file__))+"/py_modules")
import logging
logging.basicConfig(filename="/tmp/template.log",

View file

@ -3,7 +3,8 @@
"version": "0.0.1",
"description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
"pipinstall": "if [ -f requirements.txt ]; then\n\tpip install -U -r requirements.txt -t py_modules\nfi",
"build": "pnpm run pipinstall && shx rm -rf dist && rollup -c",
"watch": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},