Add simple support for dependent python modules (#11)

* add pipinstall script and append py_modules to PYTHONPATH

allows dependent python modules to be installed

* separate build_frontend and pip_install

* use prepare script for installing python modules

* use pip3 instead of pip

* always create requirements.txt, even if empty
This commit is contained in:
Luis Finke 2023-01-05 18:37:38 -05:00 committed by GitHub
parent 965b1ea7d0
commit 229c2aa079
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

1
.gitignore vendored
View file

@ -22,6 +22,7 @@ coverage
# Dependency directory # Dependency directory
node_modules node_modules
bower_components bower_components
py_modules
# Editors # Editors
.idea .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 import logging
logging.basicConfig(filename="/tmp/template.log", logging.basicConfig(filename="/tmp/template.log",

View file

@ -3,6 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack", "description": "A template to quickly create decky plugins from scratch, based on TypeScript and webpack",
"scripts": { "scripts": {
"prepare": "touch requirements.txt && pip3 install --upgrade -r requirements.txt -t py_modules",
"build": "shx rm -rf dist && rollup -c", "build": "shx rm -rf dist && rollup -c",
"watch": "rollup -c -w", "watch": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"