Changeset - aeafe7d0b033
[Not reviewed]
default
0 2 1
drewp@bigasterisk.com - 3 years ago 2022-04-07 08:07:54
drewp@bigasterisk.com
have bin/* run via pdm's python config
3 files changed with 5 insertions and 39 deletions:
0 comments (0 inline, 0 general)
bin/python
Show inline comments
 
new file 100755
 
#!/bin/sh
 
pdm run python3 "$@"
bin/run_local.py
Show inline comments
 
# allows bin/* to work without installation
 

	
 
# this should be turned off when the programs are installed
 

	
 
import sys, os, socket
 

	
 
from twisted.python.failure import Failure
 

	
 
def fixSysPath():
 
    root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),
 
                                        '..')) + '/'
 
    sys.path = [
 
        root,
 
        root + 'env/lib/python3.7',
 
        root + 'env/lib/python3.7/plat-x86_64-linux-gnu',
 
        root + 'env/lib/python3.7/lib-tk',
 
        root + 'env/lib/python3.7/lib-old',
 
        root + 'env/lib/python3.7/lib-dynload',
 
        '/usr/lib/python3/dist-packages/',
 
        '/usr/lib/python3.7',
 
        #        '/usr/lib/python3.7/plat-x86_64-linux-gnu',
 
        #        '/usr/lib/python3.7/lib-tk',
 
        #        root + 'env/local/lib/python3.7/site-packages',
 
        #        root + 'env/local/lib/python3.7/site-packages/gtk-2.0',
 
        root + 'env/lib/python3.7/site-packages',
 
        #        root + 'env/lib/python3.7/site-packages/gtk-2.0',
 
    ]
 

	
 

	
 
fixSysPath()
 

	
 
from twisted.python.failure import Failure
 
# to support 'import light9' until I rearrange things better:
 
sys.path.append('.')
 

	
 
try:
 
    import tkinter
 
except ImportError:
 
    pass
 
else:
 

	
 
    def rce(self, exc, val, tb):
 
        sys.stderr.write("Exception in Tkinter callback\n")
 
        if True:
 
            sys.excepthook(exc, val, tb)
 
        else:
makefile
Show inline comments
 
### setup ###
 

	
 
packages:
 
	sudo aptitude install coffeescript normalize-audio audacity python3-pygame libffi-dev tix libzmq3-dev python3-dev libssl-dev python3-opencv python3-cairo npm git virtualenv python3-virtualenv nginx-full python3-tk zlib1g-dev libjpeg8-dev curl
 

	
 
# also pip3 install -U invoke (don't use ubuntu's version)
 

	
 
gst_packages:
 
	sudo aptitude install python3-gi gir1.2-gst-plugins-base-1.0 libgirepository-1.0-1 gir1.2-gstreamer-1.0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-pulseaudio python3-gst-1.0 gir1.2-goocanvas-2.0
 

	
 
PYTHON=/usr/bin/python3
 

	
 
create_virtualenv:
 
	mkdir -p env
 
	virtualenv -p $(PYTHON) env
 
	env/bin/pip install -U pip
 
	ln -sf ../env/bin/python bin/python
 

	
 
install_python_deps:
 
	env/bin/pip install --index-url https://projects.bigasterisk.com/ --extra-index-url https://pypi.org/simple -U -r requirements.txt
 

	
 
binexec:
 
	chmod a+x bin/*
 

	
 

	
 
node_modules/bower/bin/bower:
 
	npm install
 

	
 
bin/node:
 
	ln -sf `which nodejs` bin/node
 

	
 
bower: node_modules/bower/bin/bower bin/node
 
	cd light9/web/lib; nodejs ../../../node_modules/bower/bin/bower install
 

	
 
npm_install:
 
	npm install
 

	
0 comments (0 inline, 0 general)