I'd like to use PyPy to run my python bot, since I don't use any third-party package, if pypy was on the server it should just run with no problems. However, since pypy isn't on the server, I was going to just run a portable version. I was following @nmalaguti guide: https://2016.forums.halite.io/t/how-to-submit-a-bot-in-any-language/423
So, I made an install.sh file:
#!/bin/bash # fail on any error set -e # cd to the directory of the script cd "$(dirname "$0")" # use curl to download any runtime dependencies curl -sL https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.6-linux_x86_64-portable.tar.bz2 tar -xf ./pypy-5.6-linux_x86_64-portable.tar.bz2
Then MyBot.py looks like this:
from subprocess import call from glob import glob import os import sys import logging # cd to the script directory os.chdir(os.path.dirname(os.path.realpath(__file__))) # look for the node executable pypybin = glob('pypy*/bin/pypy') if len(pypybin) == 0: # if it isn't found we're probably running locally pypybin = 'pypy' else: pypybin = pypybin # call the script with the relative path to node and hook up stdin, stdout, and stderr call(pypybin + " ./pypyBot.py", shell=True)
Unfortunately, I'm getting an error that says that pypy isn't found. Anybody have some ideas on this?